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

Diff of /FigKernelPackages/gjoseqlib.pm

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

revision 1.18, Sun Aug 15 23:51:00 2010 UTC revision 1.19, Sat Aug 21 17:29:14 2010 UTC
# Line 88  Line 88 
88  #  \@packed_seqs = pack_alignment(  @seqs )  #  \@packed_seqs = pack_alignment(  @seqs )
89  #  \@packed_seqs = pack_alignment( \@seqs )  #  \@packed_seqs = pack_alignment( \@seqs )
90  #  #
91    #  Remove all alignment gaps from sequences:
92    #
93    #   @packed_seqs = pack_sequences(  @seqs )
94    #   @packed_seqs = pack_sequences( \@seqs )
95    #  \@packed_seqs = pack_sequences(  @seqs )
96    #  \@packed_seqs = pack_sequences( \@seqs )
97    #
98  # Basic sequence manipulation functions:  # Basic sequence manipulation functions:
99  #  #
100  #  @entry  = subseq_DNA_entry( @seq_entry, $from, $to [, $fix_id] );  #  @entry  = subseq_DNA_entry( @seq_entry, $from, $to [, $fix_id] );
# Line 196  Line 203 
203          seq_data_by_id          seq_data_by_id
204    
205          pack_alignment          pack_alignment
206            pack_sequences
207    
208          subseq_DNA_entry          subseq_DNA_entry
209          subseq_RNA_entry          subseq_RNA_entry
# Line 972  Line 980 
980  }  }
981    
982  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
983    #  Remove all alignment gaps from sequences:
984    #
985    #   @packed_seqs = pack_sequences(  @seqs )
986    #   @packed_seqs = pack_sequences( \@seqs )
987    #  \@packed_seqs = pack_sequences(  @seqs )
988    #  \@packed_seqs = pack_sequences( \@seqs )
989    #
990    #-----------------------------------------------------------------------------
991    
992    sub pack_sequences
993    {
994        my @seqs = ( ref( $_[0] ) eq 'ARRAY' and ref( $_[0]->[0] ) eq 'ARRAY' ) ? @{$_[0]} : @_;
995        @seqs or return wantarray ? () : [];
996    
997        my @seqs2 = map { [ $_->[0], $_->[1], pack_seq( $_->[2] ) ] } @seqs;
998    
999        return wantarray ? @seqs2 : \@seqs2;
1000    }
1001    
1002    #-----------------------------------------------------------------------------
1003  #  Some simple sequence manipulations:  #  Some simple sequence manipulations:
1004  #  #
1005  #     @entry  = subseq_DNA_entry( @seq_entry, $from, $to [, $fix_id] );  #     @entry  = subseq_DNA_entry( @seq_entry, $from, $to [, $fix_id] );
# Line 1177  Line 1205 
1205    
1206  sub pack_seq {  sub pack_seq {
1207      my $seq = shift;      my $seq = shift;
1208      $seq =~ tr/A-Za-z//cd;      $seq =~ tr/A-Za-z*//cd;
1209      return $seq;      $seq;
1210  }  }
1211    
1212    

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3