[Biojava-dev] Changes to Sequence in BioJava3
Andy Yates
ayates at ebi.ac.uk
Wed Nov 3 12:07:19 UTC 2010
It is which is why I want people to check their code still works. I can only run tests from my end :)
Andy
On 2 Nov 2010, at 21:54, Andreas Prlic wrote:
> thanks! looks like a major patch...
> A
>
> On Tue, Nov 2, 2010 at 4:52 PM, Andy Yates <ayates at ebi.ac.uk> wrote:
>> As I said earlier these changes were going in. They are now checked in. Can people check their code still works against this. I've had to do some changes to core (obviously), genomic & alignment. Test cases all pass but I'd be happier once everyone okays this.
>>
>> If so then I can push out a release
>>
>> Andy
>>
>> On 2 Nov 2010, at 15:16, Andy Yates wrote:
>>
>>> Hi everyone,
>>>
>>> As a caution to people with implementations already built on the Sequence interface I'm proposing a couple of changes to it. This will cause a binary class incompatibility & will have impacts in the methods you need to implement but I'll sort them out at the BioJava core end.
>>>
>>> 1). Removal of getSequenceAsString(Integer,Integer,Strand)
>>> ** The implementation is patchy & buggy often exposing data from backing stores
>>>
>>> 2). Addition of SequenceView<C> getReverse()
>>> ** Will return the sequence in the reverse strand
>>> ** Also complemented if applicable
>>>
>>> 3). Addition of isComplementable() to CompoundSet
>>> ** Used to support the above function
>>>
>>> This means substrings of Sequences are retrieved as so:
>>>
>>> DNASequence d = new DNASequence("ATGCGC");
>>> d.getSubSequence(2, 5).getSequenceAsString(); //Returns TGCG
>>> d.getSubSequence(2, 5).getReverse().getSequenceAsString(); //Returns CGCT
>>>
>>> To support -ve strand indexes you can use the Location objects (the returned Location is expressed in +ve coordinates):
>>>
>>> Location l = Location.Tools.location(5, 2, Strand.NEGATIVE, d.getLength());
>>> SequenceView<NucleotideCompound> locationSeq = l.getSubSequence(d);
>>> locationSeq.getSequenceAsString(); //Returns CGCT
>>>
>>> Hopefully the implications of these changes will be small & will benefit the code
>>>
>>> Andy
>>>
>>> p.s. If you are wondering why I am not proposing a deprecation is because I do not want developers writing quite complex code depending on this functionality. If this was not an alpha release then deprecation would be the only way to go
>>>
>>>
>>> _______________________________________________
>>> biojava-dev mailing list
>>> biojava-dev at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/biojava-dev
>>
>> --
>> Andrew Yates Ensembl Genomes Engineer
>> EMBL-EBI Tel: +44-(0)1223-492538
>> Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
>> Cambridge CB10 1SD, UK http://www.ensemblgenomes.org/
>>
>>
>>
>>
>>
>> _______________________________________________
>> biojava-dev mailing list
>> biojava-dev at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biojava-dev
>>
--
Andrew Yates Ensembl Genomes Engineer
EMBL-EBI Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK http://www.ensemblgenomes.org/
More information about the biojava-dev
mailing list