[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.3 - (download) (as text) (annotate)
Thu Oct 11 20:16:36 2007 UTC (12 years, 5 months ago) by mkubal
Branch: MAIN
CVS Tags: rast_rel_2008_06_18, rast_rel_2008_06_16, rast_rel_2008_12_18, rast_rel_2008_07_21, rast_2008_0924, rast_rel_2008_04_23, rast_rel_2008_09_30, mgrast_rel_2008_0924, mgrast_rel_2008_1110_v2, rast_rel_2009_02_05, mgrast_rel_2008_0625, rast_rel_2008_10_09, rast_release_2008_09_29, mgrast_rel_2008_0806, mgrast_rel_2008_0923, mgrast_rel_2008_0919, mgrast_rel_2008_1110, rast_rel_2008_09_29, mgrast_rel_2008_0917, rast_rel_2008_10_29, rast_rel_2009_03_26, rast_rel_2008_11_24, rast_rel_2008_08_07
Changes since 1.2: +6 -1 lines
writes to rp/genome/attributes dir

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