[Biojava-l] biojava3 getting the features from alignedsequence

Marco Valtas mavcunha at gmail.com
Fri Jan 7 22:02:46 UTC 2011


I think in such cases we could throw an exception. what I mean is that having sequences positions counted from 1 and someone tries to fetch a position from 0 a exception could be thrown telling that such index starts at 1. For arrays and lists that not model a sequence will be better keep the computer science convention. Any thoughts?

Marco Valtas
Developer at ThoughtWorks

Sent from my iPhone

On 07/01/2011, at 17:51, Scooter Willis <willishf at ufl.edu> wrote:

> Hara
> 
> Figured out the problem. Welcome to the world of biology indexes start at 1
> and computer science starts at 0.
> 
> If you use 1 as your first index it will work. In the core module we tried
> to make that clear by using BioIndex in the method name. I will see what I
> can do about getting that added/changed in the alignment module.
> 
> Thanks
> 
> Scooter
> 
> On Fri, Jan 7, 2011 at 12:20 PM, Hara Dilley <hdilley at catbio.com> wrote:
> 
>> Thanks Scooter,
>> 
>> Below is the code of how I populate lst. Of course my real sequences are
>> different, but for this example it doesn’t matter.
>> 
>> 
>> 
>>       List<ProteinSequence> lst = *new* ArrayList<ProteinSequence>();
>> 
>>      ProteinSequence s1 = *new* ProteinSequence(“SHALG”);
>> 
>>      ProteinSequence s2 = *new* ProteinSequence(“SWQVLG”);
>> 
>>      lst.add(s1);
>> 
>>      lst.add(s2);
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> *From:* willishf at gmail.com [mailto:willishf at gmail.com] *On Behalf Of *Scooter
>> Willis
>> *Sent:* Thursday, January 06, 2011 6:43 PM
>> *To:* Hara Dilley
>> *Cc:* biojava-l at lists.open-bio.org
>> *Subject:* Re: [Biojava-l] biojava3 getting the features from
>> alignedsequence
>> 
>> 
>> 
>> Hara
>> 
>> 
>> 
>> Can you provide more of the code you are using that shows how you are
>> loading the initial sequences.
>> 
>> 
>> 
>> Thanks
>> 
>> 
>> Scooter
>> 
>> 
>> 
>> On Thu, Jan 6, 2011 at 7:09 PM, Hara Dilley <hdilley at catbio.com> wrote:
>> 
>> Hi,
>> 
>> I would like to align a set of sequences against a scaffold and get the
>> list of the modifications for each aligned sequence.
>> I am using biojava3
>> I have tried to create a profile  thinking that I can get the
>> AlignedSequences from it but that it appears to be null.
>> Here is part of my code:
>> 
>> Profile<ProteinSequence, AminoAcidCompound> profile =
>> Alignments.getMultipleSequenceAlignment(lst);
>> Profile.getAlignedSequence(0);
>> 
>> Can someone please point to an example for this or to the classes I have to
>> use.
>> Thank you,
>> Hara
>> 
>> 
>> _______________________________________________
>> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biojava-l
>> 
>> 
>> 
> 
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l




More information about the Biojava-l mailing list