[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.38, Tue Feb 20 19:06:36 2007 UTC revision 1.39, Wed Feb 21 16:09:36 2007 UTC
# Line 326  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        if (! -s "$dir/built") { system "echo 1 > $dir/built" }
330        bless $fam,$class;
331        return $fam;
332    }
333    
334    sub alignment {
335        my($self) = @_;
336    
337        my $dir  = $self->{dir};
338        my $fig  = $self->{fig};
339    
340      my $kernel_file = "$dir/kernel_alignment.fasta";      my $kernel_file = "$dir/kernel_alignment.fasta";
341      my $ali_file = "$dir/alignment.fasta";      my $ali_file = "$dir/alignment.fasta";
342    
343      if ((! -s $kernel_file) && (! -s "$dir/built") && (-s "$dir/PEGs.fasta"))      if ((! -s $kernel_file) && (! -s "$dir/built.ali") && (-s "$dir/PEGs.fasta"))
344      {      {
345          my $seqs    = &gjoseqlib::read_fasta("$dir/PEGs.fasta");          my $seqs    = &gjoseqlib::read_fasta("$dir/PEGs.fasta");
346          my $ali     = &PHOB::trimmed_aligned_kernel(seqs => $seqs, retrim => 1 );          my $ali     = &PHOB::trimmed_aligned_kernel(seqs => $seqs, retrim => 1 );
347          &gjoseqlib::print_alignment_as_fasta("$kernel_file",$ali);          &gjoseqlib::print_alignment_as_fasta("$kernel_file",$ali);
348      }      }
349    
350      if ((! -s $ali_file) && (-s $kernel_file) && (! -s "$dir/built") && (-s "$dir/PEGs.fasta"))      if ((! -s $ali_file) && (-s $kernel_file) && (! -s "$dir/built.ali") && (-s "$dir/PEGs.fasta"))
351      {      {
352          my $seqs    = &gjoseqlib::read_fasta("$dir/PEGs.fasta");          my $seqs    = &gjoseqlib::read_fasta("$dir/PEGs.fasta");
353          my $ali;          my $ali;
# Line 353  Line 364 
364          my %in_ali = map { $_->[0] => 1 } @$ali;          my %in_ali = map { $_->[0] => 1 } @$ali;
365          foreach $seq (grep { ! $in_ali{$_->[0]} } @$seqs)          foreach $seq (grep { ! $in_ali{$_->[0]} } @$seqs)
366          {          {
367  #            print STDERR "adding $seq->[0] to alignment\n";              print STDERR "adding $seq->[0] to alignment\n";
368              $ali     = &gjoalignment::add_to_alignment($seq,$ali,1);              $ali     = &gjoalignment::add_to_alignment($seq,$ali,1);
369                my @tmp = @$ali;
370              &gjoseqlib::print_alignment_as_fasta("$ali_file.last",$ali);              &gjoseqlib::print_alignment_as_fasta("$ali_file.last",$ali);
371                system "cat $ali_file.last >> $dir/log; echo '====' >> $dir/log";
372          }          }
373    
374          if (! -s "$ali_file.last")          if (! -s "$ali_file.last")
# Line 366  Line 379 
379          {          {
380              rename("$ali_file.last",$ali_file);              rename("$ali_file.last",$ali_file);
381          }          }
382            system "echo 1 > $dir/built.ali";
383        }
384        if (-s $ali_file)
385        {
386            return &gjoseqlib::read_fasta($ali_file);
387        }
388        else
389        {
390            return undef;
391      }      }
   
     if (! -s "$dir/built") { system "echo 1 > $dir/built" }  
     bless $fam,$class;  
     return $fam;  
392  }  }
393    
394    

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3