Our Sponsors



Download BioinformaticsOnline(BOL) Apps in your chrome browser.




Extracting FASTA sequences based on position with perl script !!

  • Public
By Shruti Paniwala 2584 days ago
#!/usr/bin/env perl #Uses: perl sub-seq.pl input.txt range use strict; use warnings; my $end = pop; my $start = pop; local $/ = '>'; while (<>) { chomp; next unless /(.+)/; my ($header) = "$/$1_$start-$end\n"; my $seq = ${^POSTMATCH}; $seq =~ s/\s//g; print $header; print +( substr $seq, $start - 1, $end ) . "\n"; }