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

Annotation of /DomReg/scripts/add_Operon_to_FIGRegulons.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : mkubal 1.1 #!/usr/bin/env /home/bartels/FIGdisk/env/cee/bin/perl
2 :    
3 :     use strict;
4 :     use warnings;
5 :    
6 :     use lib '/home/mkubal/PPO/';
7 :     use lib '/home/mkubal/DomReg/';
8 :     use DBMaster;
9 :    
10 :     my $dbmaster = DBMaster->new('FIGRegulons');
11 :    
12 :     #$DataSource_name = shift(@ARGV);
13 :     #$DataSource_version = shift(@ARGV);
14 :    
15 :     my $DataSource_name = "RegTransbase";
16 :     my $DataSource_version = "20060209_1006";
17 :    
18 :     my $source_objs;
19 :     my $source_obj;
20 :    
21 :     $source_objs = $dbmaster->DataSource->get_objects( { 'name' => $DataSource_name,
22 :     'version' => $DataSource_version
23 :     } );
24 :     if(!scalar(@$source_objs)){
25 :     $source_obj = $dbmaster->DataSource->create( { 'name' => $DataSource_name,
26 :     'version' => $DataSource_version
27 :     } );
28 :     }
29 :     else{
30 :     $source_obj = $source_objs->[0];
31 :     }
32 :    
33 :     open(IN,"/home/mkubal/DomReg/data/operon_table.txt");
34 :     while($_ = <IN>){
35 :     chomp($_);
36 :     my @parts = split("\t",$_);
37 :     my $operon_id = $parts[0];
38 :     my $name = $parts[1];
39 :     my $genome = $parts[2];
40 :     my $contig = $parts[3];
41 :     my $start = $parts[4];
42 :     my $stop = $parts[5];
43 :     my $promoter_list = $parts[6];
44 :     my $terminator_list = $parts[7];
45 :     my $peg_list = $parts[8];
46 :    
47 :     my @pegs = split(",",$peg_list);
48 :     my $pegs_ref = \@pegs;
49 :    
50 :     my @promoters = split(",",$promoter_list);
51 :     my @terminators = split(",",$terminator_list);
52 :    
53 :     my $operon_objs = $dbmaster->Operon->get_objects( { 'ext_id' => $operon_id } );
54 :     if(!scalar(@$operon_objs)){
55 :     my $operon_obj = $dbmaster->Operon->create( { 'ext_id' => $operon_id,
56 :     'name' => $name,
57 :     'contig' => $contig,
58 :     'start' => $start,
59 :     'stop' => $stop,
60 :     'organism' => $genome,
61 :     'FigidsProt' => $pegs_ref,
62 :     'DataSource' => $source_obj
63 :     } );
64 :     $operon_obj->promoters(\@promoters);
65 :     $operon_obj->terminators(\@terminators);
66 :     }
67 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3