~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to Bio/AlignIO/msf.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: msf.pm,v 1.22.4.3 2006/10/02 23:10:12 sendu Exp $
 
1
# $Id: msf.pm 14883 2008-09-16 18:27:31Z jason $
2
2
#
3
3
# BioPerl module for Bio::AlignIO::msf
4
4
#   based on the Bio::SeqIO::msf module
126
126
                        $seqname = $name;
127
127
                        $start = 1;
128
128
                        $str = $hash{$name};
129
 
                        $str =~ s/[^A-Za-z]//g;
 
129
                        $str =~ s/[^0-9A-Za-z$Bio::LocatableSeq::OTHER_SYMBOLS]//g;
 
130
 
130
131
                        $end = length($str);
131
132
                }
132
133
 
133
 
                $seq = new Bio::LocatableSeq(-seq   => $hash{$name},
134
 
                                                                                          -id    => $seqname,
135
 
                                                                                          -start => $start,
136
 
                                                                                          -end   => $end,
 
134
                $seq = Bio::LocatableSeq->new(-seq   => $hash{$name},
 
135
                                              -id    => $seqname,
 
136
                                              -start => $start,
 
137
                                              -end   => $end,
137
138
                                                                                         );
138
139
                $aln->add_seq($seq);
139
140
 
184
185
                $self->_print (sprintf("\n%s   MSF: %d  Type: %s  %s  Check: 00 ..\n\n",
185
186
                               $name,  $aln->no_sequences, $type, $date));
186
187
 
 
188
    my $seqCountFormat = "%".($maxname > 20 ? $maxname + 2: 22)."s%-27d%27d\n";
 
189
    my $seqNameFormat  = "%-".($maxname > 20 ? $maxname : 20)."s  ";
 
190
        
187
191
                foreach $seq ( $aln->each_seq() ) {
188
192
                        $name = $aln->displayname($seq->get_nse());
189
193
                        $miss = $maxname - length ($name);
201
205
 
202
206
        while( $count < $length ) {
203
207
                        # there is another block to go!
204
 
                        $self->_print (sprintf("%22s%-27d%27d\n",' ',$count+1,$count+50));
 
208
                        $self->_print (sprintf($seqCountFormat,' ',$count+1,$count+50));
205
209
                        foreach $name  ( @arr ) {
206
 
                                $self->_print (sprintf("%-20s  ",$name));
 
210
                                $self->_print (sprintf($seqNameFormat,$name));
207
211
 
208
212
                                $tempcount = $count;
209
213
                                $index = 0;