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

John Stalker jstalker at coreinformatics.com
Tue Aug 11 11:43:14 UTC 2015


Hi Andreas,
  Thanks for the reply!  In fact, the example page you provided is exactly what I was attempting to do, but I moved away from it.
  This example is so very nearly complete, but it’s missing one line in the for loop which prints the 6 frame results — I want to end up with ProteinSequence objects, wrapped from the individual Sequence<AminoAcid> objects.  I can take the naïve approach and create ProteinSequence objects from the String form of the Sequence object, but that doesn’t scale well.

  In my code, I abandoned the .multipleFrameTranslation call and simply did this:
for (Frame frame : Frame.getAllFrames()) {
  ProteinSequence seq = dna.getRNASequence(frame).getProteinSequence(te);
  //etc
}

  Ultimately, it’s not obvious what the is ‘right’ way to go from Sequence<C> to the proper wrapper class (i.e. Sequence<AminoAcidCompound> -> ProteinSequence)
  Thanks!
John

From: <andreas.prlic at gmail.com<mailto:andreas.prlic at gmail.com>> on behalf of Andreas Prlic
Date: Tuesday, August 11, 2015 at 12:58 AM
To: John Stalker
Cc: "biojava-l at mailman.open-bio.org<mailto:biojava-l at mailman.open-bio.org>"
Subject: Re: [Biojava-l] Constructing (wrapping) DNASequence from a SequenceView<NucleotideCompound>

Hi John,

It would help if you would explain a bit more detailed, what you are tyring to do. Have you seen the new BioJava tutorial on github? For example there is a page that explains how to translate various sequence types

https://github.com/biojava/biojava-tutorial/blob/master/core/translating.md

Does that help? If not, perhaps provide some more info, what you want to do?

Thanks,

Andreas





On Fri, Aug 7, 2015 at 6:29 AM, John Stalker <jstalker at coreinformatics.com<mailto:jstalker at coreinformatics.com>> wrote:
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

_______________________________________________
Biojava-l mailing list  -  Biojava-l at mailman.open-bio.org<mailto:Biojava-l at mailman.open-bio.org>
http://mailman.open-bio.org/mailman/listinfo/biojava-l




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biojava-l/attachments/20150811/9ce5a60f/attachment-0001.html>


More information about the Biojava-l mailing list