[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.35, Mon Feb 19 23:29:14 2007 UTC revision 1.36, Tue Feb 20 13:10:31 2007 UTC
# Line 327  Line 327 
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";      my $kernel_file = "$dir/kernel_alignment.fasta";
330      my $ali_file = "$dir/kernel_alignment.fasta";      my $ali_file = "$dir/alignment.fasta";
331    
332      if ((! -s $kernel_file) && (! -s "$dir/built") && (-s "$dir/PEGs.fasta"))      if ((! -s $kernel_file) && (! -s "$dir/built") && (-s "$dir/PEGs.fasta"))
333      {      {
# Line 335  Line 335 
335          my $ali     = &PHOB::trimmed_aligned_kernel(seqs => $seqs);          my $ali     = &PHOB::trimmed_aligned_kernel(seqs => $seqs);
336          $ali        = &PHOB::retrim_seqs(seqs => $seqs, ali => $ali);          $ali        = &PHOB::retrim_seqs(seqs => $seqs, ali => $ali);
337          &gjoseqlib::print_alignment_as_fasta("$kernel_file",$ali);          &gjoseqlib::print_alignment_as_fasta("$kernel_file",$ali);
338          my %in_ali = map { $_->[0] => 1 } @$ali;      }
339    
340        if ((! -s $ali_file) && (-s $kernel_file) && (! -s "$dir/built") && (-s "$dir/PEGs.fasta"))
341        {
342            my $seqs    = &gjoseqlib::read_fasta("$dir/PEGs.fasta");
343            my $ali;
344            if (-s "$ali_file.last")
345            {
346                $ali = &gjoseqlib::read_fasta("$ali_file.last");
347            }
348            else
349            {
350                $ali = &gjoseqlib::read_fasta($kernel_file);
351            }
352    
353          my($seq);          my($seq);
354            my %in_ali = map { $_->[0] => 1 } @$ali;
355          foreach $seq (grep { ! $in_ali{$_->[0]} } @$seqs)          foreach $seq (grep { ! $in_ali{$_->[0]} } @$seqs)
356          {          {
357                print STDERR "adding $seq->[0] to alignment\n";
358              $ali     = &gjoalignment::add_to_alignment($seq,$ali,1);              $ali     = &gjoalignment::add_to_alignment($seq,$ali,1);
359                &gjoseqlib::print_alignment_as_fasta("$ali_file.last",$ali);
360          }          }
361          &gjoseqlib::print_alignment_as_fasta("$ali_file",$ali);          rename("$ali_file.last",$ali_file);
362      }      }
363    
364      if (! -s "$dir/built") { system "echo 1 > $dir/built" }      if (! -s "$dir/built") { system "echo 1 > $dir/built" }

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3