[Biojava-l] Constructing (wrapping) DNASequence from a SequenceView<NucleotideCompound>

John Stalker jstalker at coreinformatics.com
Fri Aug 7 13:29:30 UTC 2015


Hi there,
  I’m working on some code multi-frame translation code and I think I’m missing a fundamental property here.

  I want to be using DNASequence, RNASequence, and ProteinSequence classes, but operations I’m using end up returning Sequence<C> or SequenceView<C>.  What is the conversion / wrapper path from the latter to the former?

  So for example, if I get a subSequence from DNASequence, I have a SequenceView<NucleotideCompound>.  How do I wrap that in a new DNASequence?  Similarly, when I have instances of Sequence<AminoAcidCompound> (the result of TranscriptionEngine.multipleFrameTranslation), how do I wrap that with ProteinSequence?
  Looking a the constructors for the main *Sequence classes, there’s nothing (save String) that stands out.  The implementations of SequenceReader (for DNASequence) and ProxySequenceReader (for RNASequence and ProteinSequence…why are these not all the same interface is another question) don’t stand out as being appropriate.

  I’m might just be dense here, but any help would be appreciated!  Thanks!
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biojava-l/attachments/20150807/1cc73c32/attachment.html>


More information about the Biojava-l mailing list