<div dir="ltr">Did you see the getSequenceAsString method?<div><pre style="color:rgb(0,0,0);font-family:Menlo;font-size:12pt">ProteinSequence ps = <span style="color:#000080;font-weight:bold">new </span>ProteinSequence(results.get(frame).getSequenceAsString());<br></pre>The difference is that you go from a view of a sequence, (which, if I remember correctly, does not take much memory), to an newly allocated sequence instance.</div><div><br></div><div>Andreas<br><pre style="color:rgb(0,0,0);font-family:Menlo;font-size:12pt"><br></pre></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 11, 2015 at 4:43 AM, John Stalker <span dir="ltr">&lt;<a href="mailto:jstalker@coreinformatics.com" target="_blank">jstalker@coreinformatics.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
<div>
<div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
Hi Andreas,</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
  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.</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
  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&lt;AminoAcid&gt; 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.</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
  In my code, I abandoned the .multipleFrameTranslation call and simply did this:</div>
<div><font face="Calibri,sans-serif">for (Frame frame : Frame.getAllFrames()) {</font></div>
<div><font face="Calibri,sans-serif">  ProteinSequence seq = dna.getRNASequence(frame).getProteinSequence(te);</font></div>
<div><font face="Calibri,sans-serif">  //etc</font></div>
<div><font face="Calibri,sans-serif">}</font></div>
<div><font face="Calibri,sans-serif"><br>
</font></div>
<div><font face="Calibri,sans-serif">  Ultimately, it’s not obvious what the is ‘right’ way to go from Sequence&lt;C&gt; to the proper wrapper class (i.e. Sequence&lt;AminoAcidCompound&gt; -&gt; ProteinSequence)</font></div>
<div><font face="Calibri,sans-serif">  Thanks!</font></div>
<div><font face="Calibri,sans-serif">John</font></div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<div></div>
</div>
</div>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<br>
</div>
<span style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<div style="font-family:Calibri;font-size:12pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>&lt;<a href="mailto:andreas.prlic@gmail.com" target="_blank">andreas.prlic@gmail.com</a>&gt; on behalf of Andreas Prlic<br>
<span style="font-weight:bold">Date: </span>Tuesday, August 11, 2015 at 12:58 AM<br>
<span style="font-weight:bold">To: </span>John Stalker<br>
<span style="font-weight:bold">Cc: </span>&quot;<a href="mailto:biojava-l@mailman.open-bio.org" target="_blank">biojava-l@mailman.open-bio.org</a>&quot;<br>
<span style="font-weight:bold">Subject: </span>Re: [Biojava-l] Constructing (wrapping) DNASequence from a SequenceView&lt;NucleotideCompound&gt;<br>
</div><div><div class="h5">
<div><br>
</div>
<div>
<div>
<div dir="ltr">Hi John,
<div><br>
</div>
<div>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</div>
<div><br>
</div>
<div><a href="https://github.com/biojava/biojava-tutorial/blob/master/core/translating.md" target="_blank">https://github.com/biojava/biojava-tutorial/blob/master/core/translating.md</a><br>
</div>
<div><br>
</div>
<div>Does that help? If not, perhaps provide some more info, what you want to do?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Andreas</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Aug 7, 2015 at 6:29 AM, John Stalker <span dir="ltr">
&lt;<a href="mailto:jstalker@coreinformatics.com" target="_blank">jstalker@coreinformatics.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>
<div>Hi there,</div>
<div>  I’m working on some code multi-frame translation code and I think I’m missing a fundamental property here.</div>
<div><br>
</div>
<div>  I want to be using DNASequence, RNASequence, and ProteinSequence classes, but operations I’m using end up returning Sequence&lt;C&gt; or SequenceView&lt;C&gt;.  What is the conversion / wrapper path from the latter to the former?</div>
<div><br>
</div>
<div>  So for example, if I get a subSequence from DNASequence, I have a SequenceView&lt;NucleotideCompound&gt;.  How do I wrap that in a new DNASequence?  Similarly, when I have instances of Sequence&lt;AminoAcidCompound&gt; (the result of TranscriptionEngine.multipleFrameTranslation),
 how do I wrap that with ProteinSequence?</div>
<div>  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.</div>
<div><br>
</div>
<div>  I’m might just be dense here, but any help would be appreciated!  Thanks!</div>
<span><font color="#888888">
<div>John</div>
<div>
<div></div>
</div>
</font></span></div>
</div>
</div>
<br>
_______________________________________________<br>
Biojava-l mailing list  -  <a href="mailto:Biojava-l@mailman.open-bio.org" target="_blank">Biojava-l@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biojava-l" rel="noreferrer" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biojava-l</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></span>
</div>

</blockquote></div><br><br clear="all"><div><br></div>
</div></div>