[Bio] / DomReg / add_pfam_to_DomReg.pl Repository:
ViewVC logotype

View of /DomReg/add_pfam_to_DomReg.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Thu Dec 14 23:22:17 2006 UTC (12 years, 11 months ago) by mkubal
Branch: MAIN
CVS Tags: HEAD
add domain data

#!/usr/bin/env /home/bartels/FIGdisk/env/cee/bin/perl

use strict;
use warnings;
use DBMaster;

my $dbmaster = DBMaster->new( 'DomReg' );

opendir(DIR,"/home/mkubal/Domain_Analysis/Timelogic_output/");
my @files = readdir(DIR);
foreach my $file (@files){
    if($file =~/parsed/){
	open(IN,"/home/mkubal/Domain_Analysis/Timelogic_output/$file");
	while($_ = <IN>){
	    chomp($_);
	    my @parts = split(" ",$_);
	    my $peg = $parts[0];
            my $name = $parts[1];
	    my $score = $parts[3];
	    my @location = split("_",$parts[2]);
            my $start = $location[0];
	    my $stop = $location[1];

            my $db = "pfam";
	    my $url = "http://www.sanger.ac.uk//cgi-bin/Pfam/getacc?".$name;
            my $version = "11-14-2006";
          
	    my $dt_obj;
            $dt_obj =  $dbmaster->DomainType->get_objects( { 'name' => $name } );   
            if(!$dt_obj){
		$dt_obj = $dbmaster->DomainType->create( { 'db'    => $db,
							   'url' => $url,
							   'vs' => $version,
							   'name' => $name,
						       } );
	    } 	
	    
	    my $domain_obj = $dbmaster->Domain->create( { 'figid'    => $peg,
					   'start' => $start,
					   'stop' => $stop,
                                           'score' => $score,
					   'DomainType' => $dt_obj,  
					 } );
	}
	close(IN);
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3