Perl script to remove the duplicate sequences from multifasta file
use strict; use Bio::SeqIO; my %unique; my $file = "myseqs.fa"; my $seqio = Bio::SeqIO->new(-file => $file, -format => "fasta"); my $outseq = Bio::SeqIO->new(-f...2732 days ago
Extract fasta sequence from a multifasta file with coordinates
#!/usr/bin/perl use Bio::DB::Fasta; #USAGE perl extractFASTAwithSIZE.pl finalSample_filtered.fa 0 1000 > aaaaaa.fa my $fastaFile = shift; my $querySizeST = shi...2574 days ago
Extract fasta sequence from a multifasta file with fasta header Ids
#!/usr/bin/perl use strict; use warnings; #Usage: perl my $list = shift @ARGV; my $fasta = shift @ARGV; my $out = shift @ARGV; my %select; open LIST, "...2560 days ago
Perl script to remove fasta sequences in multifasta file with certain length threshold
#!/usr/bin/perl use strict; use warnings; my $minlen = shift or die "Error: `minlen` parameter not provided\n"; { local $/=">"; while() { chomp;...2293 days ago
Perl script to count number of Ns in a multifasta file !
#!/usr/bin/perl my ($h, $n, $l); open(I,$ARGV[0]) or die($!); while(){ chomp; next if /^$/; if(/^>/){ $h=substr($_,1); }else{ $n=($_=~tr/nN/nN/...2186 days ago
Perl subroutine for reading multifasta file !
sub readfasta { (my $file)=@_; my %sequence; my $header; my $temp_seq; #suppose fasta files contains multiple sequences; open (IN, "2186 days ago
Perl script to run SATSUMA in loop !
#!/usr/bin/perl -w use strict; use File::Temp qw(tempfile); # Usage perl 1by1.pl for SATSUMA analysis # User need to set the reference multifasta file name here my $seqfile="";...2182 days ago
Bash oneliner to extract all ids from a multifasta file
#List of ids - one per line in allIds.txt $ awk 'BEGIN{while((getline0)l[">"$1]=1}/^>/{f=!l[$1]}f' seq.fa # You can play with this f=!l[$1 ] if wanted to extract or not extract the ids1580 days ago
Perl script to extract sequence by Ids from multifasta file !
#!/usr/bin/perl -w use strict; my $idsfile = "$ARGV[0]"; my $seqfile = "$ARGV[1]"; my %ids = (); open FILE, $idsfile; while() { chomp; $ids{$_} += 1;...2138 days ago
Perl script to extract a sequence from multifasta with range !
# filterfastarange.pl #!/usr/bin/perl use strict; use warnings; #perl filterfastarange.pl 301 600 contigs.fasta > contigs-gt300-lte600.fasta my $minlen = shift o...2108 days ago