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

Diff of /FigKernelPackages/SeedUtils.pm

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

revision 1.6, Thu Aug 27 19:44:07 2009 UTC revision 1.7, Mon Aug 31 22:07:19 2009 UTC
# Line 98  Line 98 
98    
99  =head3 create_fasta_record  =head3 create_fasta_record
100    
101      my $fastaString = create_fasta_record($id, $comment, $sequence);      my $fastaString = create_fasta_record($id, $comment, $sequence, $stripped);
102    
103  Create a FASTA record from the specified DNA or protein sequence. The  Create a FASTA record from the specified DNA or protein sequence. The
104  sequence will be split into 60-character lines, and the record will  sequence will be split into 60-character lines, and the record will
# Line 121  Line 121 
121  Sequence of letters to form into FASTA. For purposes of convenience, whitespace  Sequence of letters to form into FASTA. For purposes of convenience, whitespace
122  characters in the sequence will be removed automatically.  characters in the sequence will be removed automatically.
123    
124    =item stripped (optional)
125    
126    If TRUE, then the sequence will be returned unmodified instead of converted
127    to FASTA format. The default is FALSE.
128    
129  =item RETURN  =item RETURN
130    
131  Returns the desired sequence in FASTA format.  Returns the desired sequence in FASTA format.
# Line 131  Line 136 
136    
137  sub create_fasta_record {  sub create_fasta_record {
138      # Get the parameters.      # Get the parameters.
139      my ($id, $comment, $sequence) = @_;      my ($id, $comment, $sequence, $stripped) = @_;
140      # Start with the ID.      # Declare the return variable.
141        my $retVal;
142        # If we're in stripped mode, we just return the sequence.
143        if ($stripped) {
144            $retVal = $sequence;
145        } else {
146            # Here we have to do the FASTA conversion. Start with the ID.
147      my $header = ">$id";      my $header = ">$id";
148      # Add a comment, if any.      # Add a comment, if any.
149      if ($comment) {      if ($comment) {
# Line 149  Line 160 
160      Trace(scalar(@chunks) . " chunks found in sequence of length " .      Trace(scalar(@chunks) . " chunks found in sequence of length " .
161            length($sequence) . ".") if T(3);            length($sequence) . ".") if T(3);
162      # Add the chunks and the trailer.      # Add the chunks and the trailer.
163      my $retVal = join("\n", $header, @chunks);          $retVal = join("\n", $header, @chunks);
164        }
165      # Return the result.      # Return the result.
166      return $retVal;      return $retVal;
167  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3