Skip to content

Instantly share code, notes, and snippets.

@hyphaltip
Created April 8, 2014 05:04
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 hyphaltip/10092947 to your computer and use it in GitHub Desktop.
Save hyphaltip/10092947 to your computer and use it in GitHub Desktop.
HMMER3 simple parsing
#Here is code for parsing
use strict;
use warnings;
my $hmmertable = shift @ARGV;
open(HMMERTABLE, $hmmertable) || die "$hmmertable: $!";
while(<HMMERTABLE>){
chomp;
next if /^\#/ || /^\s+$/;
my ($domain,$domacc,$tlen,$qname,$qacc,$qlen, $fullevalue,$fullscore,$fullbias,
$n,$ntotal,$cvalue,$ivalue,$domscore,$dombias,$hmmfrom,$hmmto,$alifrom,$alito, $envfrom,$envto) = split(/\s+/,$_,23);
next if $fullevalue > $minE;
print "$qname\t$domain\t$fullevalue\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment