# HG changeset patch # User Edward Kirton # Date 1347349234 25200 # Node ID c0fb858f44a2161a06b68288bf9811f4164b50d9 # Parent 376092ae10ed9fbceeeb001becf2172b629f331d fix domtblout hdr diff -r 376092ae10ed -r c0fb858f44a2 hmmer_wrapper.pl --- a/hmmer_wrapper.pl Thu Aug 30 11:58:27 2012 -0700 +++ b/hmmer_wrapper.pl Tue Sep 11 00:40:34 2012 -0700 @@ -12,11 +12,11 @@ $domtblout = $1; my $output = `$cmd 2>&1`; die("HMMer failure: $output\n") unless $? == 0; -reformat($tblout); -reformat($domtblout); +reformat_tblout($tblout); +reformat_domtblout($domtblout); exit; -sub reformat +sub reformat_tblout { my $infile = shift; my $outfile = "$infile.new"; @@ -36,4 +36,23 @@ move($outfile,$infile); } +sub reformat_domtblout +{ + my $infile = shift; + my $outfile = "$infile.new"; + open(IN, "<$infile") or die($!); + open(OUT, ">$outfile") or die($!); + print OUT "#target name\taccession\ttlen\tquery name\taccession\tqlen\tE-value (full)\tscore (full)\tbias (full)\t# (this)\tof (this)\tc-Evalue (this)\ti-Evalue (this)\tscore (this)\tbias (this)\tfrom (hmm)\tto (hmm)\tfrom (ali)\tto (ali)\tfrom (env)\tto (env)\tacc\tdescription of target\n"; + while () + { + next if /^#/; + my @row0 = split(/\s+/); + my @row = @row0[0..21]; + push @row, join(' ', @row0[22..$#row0]); + print OUT join("\t", @row), "\n"; + } + close(IN); + close(OUT); + move($outfile,$infile); +} __END__