[Bio] / DomReg / scripts / add_IDMapper_to_FIGRegulons.pl Repository:
ViewVC logotype

View of /DomReg/scripts/add_IDMapper_to_FIGRegulons.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Mon Apr 23 20:16:14 2007 UTC (12 years, 8 months ago) by mkubal
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +4 -4 lines
used ext_id

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

#use strict;
#use warnings;

use lib '/home/mkubal/PPO/';
use lib '/home/mkubal/DomReg/';
use DBMaster;

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

#$DataSource_name = shift(@ARGV);
#$DataSource_version = shift(@ARGV);

$DataSource_name = "RegTransbase";
$DataSource_version = "20060209_1006";

my $source_objs;
my $source_obj;

$source_objs =  $dbmaster->DataSource->get_objects( { 'name' => $DataSource_name,
						     'version' => $DataSource_version
						   } );
if(!scalar(@$source_objs)){
    $source_obj = $dbmaster->DataSource->create( { 'name'    => $DataSource_name,
						   'version' => $DataSource_version
						   } );
}
else{
    $source_obj = $source_objs->[0];
}   

open(IN,"/home/mkubal/DomReg/data/rtb_gene_id_to_peg_by_sequence.txt");
while($_ = <IN>){
    chomp($_);
    @parts = split("\t",$_);
    $rtb_id = $parts[0];
    $seed_id  = $parts[1];
    
    $id_objs =  $dbmaster->IDMapper->get_objects( { 'ext_id' => $rtb_id } );
    if(!scalar(@$id_objs)){
	$id_obj = $dbmaster->IDMapper->create( { 'ext_id'    => $rtb_id,
						'someid' => $seed_id
						});
    }
}
close(IN);

open(IN,"/home/mkubal/DomReg/data/rtb_id_name_seed_genome.txt");
while($_ = <IN>){
    chomp($_);
    @parts = split("\t",$_);
    $rtb_id = $parts[0];
    $seed_id  = $parts[2];
    
    $id_objs =  $dbmaster->IDMapper->get_objects( { 'ext_id' => $rtb_id } );
    if(!scalar(@$id_objs)){
	$id_obj = $dbmaster->IDMapper->create( { 'ext_id'    => $rtb_id,
						'someid' => $seed_id
						});
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3