[Bio] / FigKernelScripts / make_IPR_PFAM_GO_attributes.pl Repository:
ViewVC logotype

View of /FigKernelScripts/make_IPR_PFAM_GO_attributes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Wed Feb 21 00:08:58 2007 UTC (12 years, 9 months ago) by mkubal
Branch: MAIN
create attribute text files in /vol/seed-attributes/

$genome = shift(@ARGV);
open(IN,"/vol/seed-attributes/computation_results/iprscan_results_for_$genome");
open(IPR,">/vol/seed-attributes/IPR/IPR_attributes_for_$genome.txt");
open(PFAM,">/vol/seed-attributes/PFAM/PFAM_attributes_for_$genome.txt");
open(GO,">/vol/seed-attributes/GO/GO_attributes_for_$genome.txt");

my $id;
my $goid;
my $description;
my $pf;
my $ipr;
my $record_ipr;
    
while ($_ = <IN>){
    if($_ =~/(\d+.\d.peg.\d+)/){
	$id = $1;
	$id = "fig|".$id;
	$record_ipr = 1;
    }
    
    if($record_ipr){
	if($_ =~/interpro id=\"(IPR\d+)\"/){
	    $ipr = $1;
	    $record_ipr = 0;
	}
    }
    
    if($_ =~/GO:(\d+)/){
	$goid = $1;
    }
    
    if($_ =~/<description>(.*)<\/description/){
	$description = $1;
	print GO "$id\tGO\t$goid\n";
    }
    
    if($_ =~/(PF\d+)/){
	$pf = $1;
    }
    
    if($_ =~/location start=\"(\d+)\"\send=\"(\d+)\"\sscore=\"(.*)\"\sstatus/){
	$start = $1;
	$end = $2;
	$score = $3;
	if($score =~/(\d+)e-(\d+)/){
	    $part1 = $1;
	    $part2 = $2;
	    if($part2 > 19){
		$part2 = (1000 - $part2);
		$part1 = $part1 * 10;
		$part1 = (1000 - $part1);
		$score = $part2.".".$part1;
		print PFAM "$id\tPFAM;$pf\t$score;$start-$end\n";
		print IPR "$id\tIPR;$ipr\t$score;$start-$end\n";
	    }
	}
	if($score eq "0"){
	    print PFAM "$id\tPFAM;$pf\t0.0;$start-$end\n";
	    print IPR "$id\tIPR;$ipr\t0.0;$start-$end\n";
	}
    }
}
close(IN);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3