Trim fasta.pl: Difference between revisions
Jump to navigation
Jump to search
m New page: <pre> #! /usr/bin/perl -w # ************************************************************* # This Programme does the following in sequence # -> Parses a multi fasta # -> Removes the sequenc... |
mNo edit summary |
||
| Line 1: | Line 1: | ||
< | <syntax> | ||
#! /usr/bin/perl -w | #! /usr/bin/perl -w | ||
# ************************************************************* | # ************************************************************* | ||
| Line 46: | Line 49: | ||
# END | # END | ||
</ | </syntax> | ||
Revision as of 15:25, 25 December 2009
<syntax>
- ! /usr/bin/perl -w
- *************************************************************
- This Programme does the following in sequence
- -> Parses a multi fasta
- -> Removes the sequence if they have <50bp and of 'N'
- -> Capture the results
- Author : Rajkumar (itc@rajkumar.in)
- Release: DEC 2009
- *************************************************************
- Libraries
use strict; use Bio::Perl; use Bio::SeqIO;
- Variables
my $path = "/home/raj/bio"; my $multifasta = "$path/euca/data/globulus/globulus_est.fa";
- making several Fasta files of GDNA
my $in = Bio::SeqIO->new(-file => "$multifasta", -format => 'Fasta'); my $identifier; my $sequence;
while ( my $seq = $in->next_seq() ) { $identifier = $seq->id;
$sequence = $seq->seq;
my ($fasta) = $_; $fasta = ">$identifier\n$sequence\n";
my $count_seq = length($sequence); my $count_N = ($sequence =~ tr/N//);
my $math = $count_seq * 0.2;
$sequence =~ s/-/N/; if ($count_seq < 50){ next; } if ($count_N > $math){ next; }
print $identifier."\n";
}
- END
</syntax>