[Bio] / FigKernelPackages / FigFam.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FigFam.pm

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

revision 1.31, Thu Feb 15 19:19:26 2007 UTC revision 1.32, Sun Feb 18 15:45:03 2007 UTC
# Line 20  Line 20 
20  use strict;  use strict;
21  use FIG;  use FIG;
22  use SameFunc;  use SameFunc;
23    use gjoseqlib;
24    use gjoalignment;
25    use PHOB;
26    
27  use Carp;  use Carp;
28  use Data::Dumper;  use Data::Dumper;
# Line 106  Line 109 
109      $fam->{function} = $func;      $fam->{function} = $func;
110    
111      my($peg,$pegs);      my($peg,$pegs);
112      my $pegsL = [sort { &FIG::by_fig_id($a,$b) } grep { $fig->is_real_feature($_) } map { $_ =~ /^\S+\t(\S+)/; $1 } `cat \"$dir/PEGs\"`];      my $pegsL = [
113                     sort { &FIG::by_fig_id($a,$b) }
114                     grep { scalar $fig->function_of($_) eq $func }
115                     grep { $fig->is_real_feature($_) }
116                     map { $_ =~ /^\S+\t(\S+)/; $1 }
117                     `cat \"$dir/PEGs\"`
118                    ];
119    
120        if (@$pegsL < 4)
121        {
122            system "/bin/rm -r $dir";
123            return undef;
124        }
125    
126      $fam->{pegsL} = $pegsL;      $fam->{pegsL} = $pegsL;
127      my $pegsH = {};      my $pegsH = {};
# Line 170  Line 185 
185          close(SIMS);          close(SIMS);
186      }      }
187    
188      if ((! "$dir/built") && (! -f "$dir/bounds"))      if ((! -s "$dir/built") && (! -f "$dir/bounds"))
189      {      {
190          print STDERR " building bounds for $fam_id\n";          print STDERR " building bounds for $fam_id\n";
191          open(BOUNDS,">$dir/bounds")    || die "could not open $dir/bounds";          open(BOUNDS,">$dir/bounds")    || die "could not open $dir/bounds";
# Line 311  Line 326 
326    
327      $fam->{reps} = (-s $rep_file) ? [map { $_ =~ /^(\S+)/; $1 } `grep -v "^>" $rep_file`] : [];      $fam->{reps} = (-s $rep_file) ? [map { $_ =~ /^(\S+)/; $1 } `grep -v "^>" $rep_file`] : [];
328    
329        my $kernel_file = "$dir/kernel_alignment.fasta";
330        my $ali_file = "$dir/kernel_alignment.fasta";
331    
332        if ((! -s $kernel_file) && (! -s "$dir/built") && (-s "$dir/PEGs.fasta"))
333        {
334            my $seqs    = &gjoseqlib::read_fasta("$dir/PEGs.fasta");
335            my $ali     = &PHOB::trimmed_aligned_kernel(seqs => $seqs);
336            $ali        = &PHOB::retrim_seqs(seqs => $seqs, ali => $ali);
337            &gjoseqlib::print_alignment_as_fasta("$kernel_file",$ali);
338            my %in_ali = map { $_->[0] => 1 } @$ali;
339            print STDERR &Dumper(\%in_ali);
340    
341            my($seq);
342            print STDERR "ALL ",&Dumper($seqs);
343            foreach $seq (grep { ! $in_ali{$_->[0]} } @$seqs)
344            {
345                print STDERR "adding ",&Dumper($seq);
346                $ali     = &gjoalignment::add_to_alignment($seq,$ali,1);
347            }
348            &gjoseqlib::print_alignment_as_fasta("$ali_file",$ali);
349        }
350    
351      if (! -s "$dir/built") { system "echo 1 > $dir/built" }      if (! -s "$dir/built") { system "echo 1 > $dir/built" }
352      bless $fam,$class;      bless $fam,$class;
353      return $fam;      return $fam;

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3