glykos

Max_FASTA

May 4th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.42 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2.  
  3. $/ = '>';
  4. $max = 0;
  5.  
  6. while ( $in = <STDIN> )
  7.   {
  8.     if ( $in =~ /.*?\|pdb\|(.*?)\|.*?\n([^>]*)/ )
  9.       {
  10.         $code = $1;
  11.         $seq = $2;
  12.         $seq =~ s/\n//g;
  13.         if ( length( $seq ) > $max )
  14.           {
  15.             $maxcode = $code;
  16.             $max = length( $seq );
  17.           }
  18.        
  19.       }
  20.  
  21.   }
  22.      
  23. print "Max length was $max for $maxcode\n";
  24.  
  25. exit();
Advertisement
Add Comment
Please, Sign In to add comment