[Bio] / FigKernelScripts / order_seqs_on_length.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/order_seqs_on_length.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : overbeek 1.1
2 :     use gjoseqlib;
3 :    
4 :     # usage: order_seqs_on_length AllSeqs CoreAli
5 :    
6 :     (
7 :     ($seqsF = shift @ARGV)
8 :     )
9 :     || die "usage: order_seqs_on_length seqs.fasta [ali.fasta]";
10 :    
11 :     my %seen;
12 :     my $seqs = &gjoseqlib::read_fasta($seqsF);
13 :     if ($aliF = shift @ARGV)
14 :     {
15 :     my $ali = &gjoseqlib::read_fasta($aliF);
16 :     %seen = map { $_->[0] => 1 } @$ali;
17 :     }
18 :     my %seq_lns = map { $_->[0] => length($_->[2]) } @$seqs;
19 :     my @seqs = sort { $seq_lns{$b->[0]} <=> $seq_lns{$a->[0]} } grep { ! $seen{$_->[0]} } @$seqs;
20 :     &gjoseqlib::print_alignment_as_fasta(\@seqs);
21 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3