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

View of /DomReg/scripts/add_Operon_to_FIGRegulons.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Fri Apr 20 20:36:52 2007 UTC (12 years, 10 months ago) by mkubal
Branch: MAIN
CVS Tags: HEAD
v1

#!/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);

my $DataSource_name = "RegTransbase";
my $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/operon_table.txt");
while($_ = <IN>){
    chomp($_);
    my @parts = split("\t",$_);
    my $operon_id = $parts[0];
    my $name = $parts[1];
    my $genome = $parts[2];
    my $contig = $parts[3];
    my $start = $parts[4];
    my $stop = $parts[5];
    my $promoter_list = $parts[6];
    my $terminator_list = $parts[7];
    my $peg_list = $parts[8];
 
    my @pegs = split(",",$peg_list);
    my $pegs_ref = \@pegs;

    my @promoters = split(",",$promoter_list);
    my @terminators = split(",",$terminator_list);
      
    my $operon_objs =  $dbmaster->Operon->get_objects( { 'ext_id' => $operon_id } );
    if(!scalar(@$operon_objs)){
	my $operon_obj = $dbmaster->Operon->create( { 'ext_id' => $operon_id,
						      'name' => $name,
						      'contig' => $contig,
						      'start' => $start,
						      'stop' => $stop,
						      'organism' => $genome,
						      'FigidsProt' => $pegs_ref,
						      'DataSource' => $source_obj
						      } );
	$operon_obj->promoters(\@promoters);
	$operon_obj->terminators(\@terminators);
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3