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

Diff of /FigKernelScripts/get_neighbors_and_corr_to_ref.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Thu Jan 7 23:38:01 2010 UTC revision 1.5, Thu Jan 7 23:55:55 2010 UTC
# Line 11  Line 11 
11    
12  ($gdir   =  shift @ARGV)  ($gdir   =  shift @ARGV)
13      || die $usage;      || die $usage;
14    ($gdir =~ /(\d+\.\d+)$/) || die "Invalid Genome Directory: $gdir";
15    my $gdir_id = $1;
16    
17  my @fasta = &gjoseqlib::read_fasta("$gdir/Features/peg/fasta");  my @fasta = &gjoseqlib::read_fasta("$gdir/Features/peg/fasta");
18  my %id2seqH = map { ($_->[2] && (length($_->[2]) > 30)) ? ($_->[0] => $_->[2]) : () } @fasta;  my %id2seqH = map { ($_->[2] && (length($_->[2]) > 30)) ? ($_->[0] => $_->[2]) : () } @fasta;
# Line 38  Line 40 
40  open(CLOSE,">$gdir/closest.genomes") || die "could not open closest.genomes";  open(CLOSE,">$gdir/closest.genomes") || die "could not open closest.genomes";
41  foreach my $g2 (@reference)  foreach my $g2 (@reference)
42  {  {
43        if ($g2 ne $gdir_id)
44        {
45      &generate_correspondence_table($g2,$gdir);      &generate_correspondence_table($g2,$gdir);
46      print CLOSE join("\t",($g2,$genomesH->{$g2})),"\n";      print CLOSE join("\t",($g2,$genomesH->{$g2})),"\n";
47  }  }
48    }
49  close(CLOSE);  close(CLOSE);
50    
51  sub generate_correspondence_table {  sub generate_correspondence_table {
# Line 48  Line 53 
53    
54      ($gdir =~ /(\d+\.\d+)$/) || die "Invalid Genome Directory: $gdir";      ($gdir =~ /(\d+\.\d+)$/) || die "Invalid Genome Directory: $gdir";
55      my $g1 = $1;      my $g1 = $1;
56        if ($g1 ne $g2)
57        {
58      system "svr_corresponding_genes -d $gdir $g1 $g2 > $gdir/CorrToReferenceGenomes/$g2";      system "svr_corresponding_genes -d $gdir $g1 $g2 > $gdir/CorrToReferenceGenomes/$g2";
59  }  }
60    }
61    
62  sub prioritize_pegs_used_to_find_neighbors {  sub prioritize_pegs_used_to_find_neighbors {
63      my($gdir) = @_;      my($gdir) = @_;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3