Split the string with underscore and store values in array with AWK !
more enriched_ids | grep "WP_" | awk '{split($2,a,"_"); print a[4]"_"a[5]}' #Other extraction more enriched_ids | grep "WP_" | awk '{split($2,a,"_"); print a[4]"_"a[5]}'> enriched_ids_list awk 'NR==FNR{tgts[$1]; next} $1 in tgts' enriched_ids_list result/GO.out > enriched_GO.out.xls907 days ago
Perl script to rename the fasta file !
#Script #1 #!/usr/bin/perl -w use strict; #USAGE #perl extractPattern.pl kmerfasta > uniref100_result_broad my %kHash; local $/ = '>'; my $infile2 = "$ARGV[0]"; # Kmer fasta open( FH2, '871 days ago
Extract the sequences with IDs !
#sed -i 's/\_/ /g' Delta_seqID_from_lineage_report.txt seqtk subseq genomic.fna Delta_seqID_from_lineage_report.txt > Delta.fasta #Split the fasta in 11 equal sequences subsets pyfasta split -n 11 Delta.fasta864 days ago
Bash script to split multifasta file !
#Using awk, we can easily split a file (multi.fa) into chunks of size N (here, N=500), by using the following one-l...nd here: http://genometools.org/, which has the following simple command: gt split...836 days ago
BBmap the reads with all alignments !
bbmap.sh in=../reference/reference.numbered.fa ambig=all vslow perfectmode maxsites=100000 out=fetch_Ids_for_barcode.sam831 days ago
Bash command to count reads in fastq file !
#ref fastq file #ref1_1.fq) echo $(( $(wc -l804 days ago
Extract the mapped and unmapped reads !
PROCESSORS=20 #Single_End_Layout: samtools view --threads $PROCESSORS -b -F 4 in.bam > mapped.bam samtools view --threads $PROCESSORS -b -f 4 in.bam >...m #Paired_End_Layout samtools view --threads $PROCESSORS -b -f 2 in.bam >...603 days ago
107 days ago
Perl and BioPerl script to extract protein sequences using GFF file !
#!/usr/bin/perl use strict; use warnings; use Bio::DB::Fasta; use Bio::SeqIO; # Paths to your GFF file and genome FASTA file my $gff_file = 'path/to/your/file....107 days ago
Raku script to find overlaps between two bed files !
#!/usr/bin/env raku # Check if the correct number of arguments are provided if @*AR...for my $line1 (@bed1) { my @fields1 = $line1.split("\t"); my $chr1 = @field...r my $line2 (@bed2) { my @fields2 = $line2.split...107 days ago