When should I use the Bio::Sequence::NA class, and when should I use the Bio::Sequence class, if I've got a nucleotide sequence?
I assumed that you should use Bio::Sequence::NA when you know it's a nucleotide sequence, because otherwise, you're throwing information away - namely the fact that it's a nucleotide sequence, not an amino acid sequence.
However, there's methods available for Bio::Sequence, that aren't available for Bio::Sequence::NA. For example, I can do
string = "gattaca"
sequence = Bio::Sequence.new(string)
sequence.output_fasta
but I can't do the following
string = "gattaca"
na = Bio::Sequence::NA.new(string)
na.output_fasta # => NoMethodError
So which class should I be using, and why?
Does that mean I should do
string = "gattaca"; na = Bio::Sequence::NA.new(string); sequence = Bio::Sequence.new(na)?no it means to forget that
Bio::Sequence::NAeven exists use theBio::Sequencedirectly