Skip to content

Instantly share code, notes, and snippets.

@meso-cacase
Created May 31, 2011 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meso-cacase/999784 to your computer and use it in GitHub Desktop.
Save meso-cacase/999784 to your computer and use it in GitHub Desktop.
grep_gbff.pl
#!/usr/bin/perl
# usage: zcat completeXXX.rna.gbff.gz ./grep_gbff.pl 'Homo sapiens'
use warnings ;
use strict ;
my $keyword = $ARGV[0] ;
$/ = "\n//\n" ;
while (<STDIN>){
my $gbf = $_ ;
($gbf =~ /^SOURCE\ +(.*?)\ *$/m) and ($1 =~ /^${ARGV[0]}$/) and
print "$gbf" ;
}
exit ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment