[Bio] / FortyEight / rp_make_PFAM_HMM_derived_attributes.pl Repository:
ViewVC logotype

View of /FortyEight/rp_make_PFAM_HMM_derived_attributes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (as text) (annotate)
Mon May 18 16:57:14 2009 UTC (10 years, 6 months ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, rast_rel_2009_05_18, mgrast_dev_08022011, rast_rel_2014_0912, mgrast_dev_05262011, mgrast_dev_04082011, rast_rel_2010_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, rast_rel_2009_0925, rast_rel_2010_0526, rast_rel_2014_0729, mgrast_dev_02212011, rast_rel_2010_1206, mgrast_release_3_0, mgrast_dev_03252011, rast_rel_2010_0118, rast_rel_2011_0119, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, rast_rel_2009_07_09, rast_rel_2010_0827, myrast_33, rast_rel_2011_0928, mgrast_dev_04052011, mgrast_dev_02222011, mgrast_dev_10262011, HEAD
Changes since 1.3: +1 -1 lines
use mkdir instead of backticks

my $jobdir = shift(@ARGV);
my $genome = shift(@ARGV);

my $input_file = $jobdir."/$genome_PFAM_HMM_search_results.txt";

if(! -d "$jobdir/rp/$genome/attributes"){
    mkdir("$jobdir/rp/$genome/attributes");
}

my $output_file = $jobdir."/rp/$genome/attributes/PFAM_HMM_derived_attributes_for_$genome.txt";

open(IN,"$input_file");
open(PFAM,">$output_file");

print PFAM "$genome\tPFAM_attribute_by_HMM_search_on_TimeLogic\tPfam_version_22\n";

my $id;
my $pf;
my $start;
my $end;
my $evalue;
my $score;

while ($_ = <IN>){
    if($_ =~/(fig\|\d+.\d+.peg.\d+)/){
	$id = $1;
    }
    
    if($_ =~/^\sA\s=\s(PF\d+)/){
	$pf = $1;
    }
       
    if($_ =~/E_Value =\s+(.*)/){
	$evalue = $1;
	chomp($evalue);
    }
        
    if($_ =~ /QS =\s+(\d+)\s+QE =\s+(\d+)/){
	$start = $1;
	$end = $2;
    	if($evalue =~/(\d+.\d+)e-(\d+)/){
	    $part1 = $1;
	    $part2 = $2;
	    if($part2 > 19){
		$part2 = (1000 - $part2);
		$part1 = $part1 * 100;
		$score = $part2.".".$part1;
		print PFAM "$id\tPFAM::$pf\t$score;$start-$end\n";
	    }
	}
	if($evalue =~/^0/){
	    print PFAM "$id\tPFAM::$pf\t0.0;$start-$end\n";
	}
    }
}
close(IN);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3