Help for this page

Select Code to Download


  1. or download this
    # Choose any Range of FASTA records
    # Called as perl script_name.pl --start start_line --end end_line file
    +_name
    ...
          print;
       }
    }
    
  2. or download this
    # Choose first N FASTA records
    perl -ne 'BEGIN {$/=">";$o=0}{chomp;$o<N?(/^$/?next:print">$_"):last;$
    +o++}' EXAMPLE.fa
    
  3. or download this
        
    # Choose the Nth FASTA record
    perl -0x3E -e 'chomp(@lines = <>);print $lines[N]' EXAMPLE.fa
    
  4. or download this
    # Choose any Range of FASTA records
    perl -0x3E -e 'chomp(@l=<>);for(STrange..ENDrange){print "record $_ is
    + >$l[$_]\n"}' EXAMPLE.fa
    perl -0x3E -e 'chomp(@l=<>);print @l[STrange..ENDrange]' EXAMPLE.fa
    
  5. or download this
    # show the number of FASTA records in a given FASTA file
    perl -0x3E -e '@l=grep/\s/,<>;print "$ARGV contains ".scalar(@l)." rec
    +ords\n"' EXAMPLE.fa