[Biojava-dev] Changes to DNASeqeunce ReverseComplement Behaviour

PATERSON Trevor trevor.paterson at roslin.ed.ac.uk
Thu Oct 21 14:12:42 UTC 2010


 
Hi 

I am playing with your most recent biojava3-core-3.0-alpha1 release code 

I see that getting substrings from reverse complement sequences etc is now not implemented

e.g. by overriding
 
getSequenceAsString(Integer start, Integer end, Strand strand)  on a  ComplementSequenceView

which now throws an UnsupportedOperationException (not nice)
 
I found the previous behaviour flakey / wrong - and presumably that is why you have overriden it now 
but is there any way to get a reverse complement subsequence easily? I have looked but can't see an obvious way - my use case is stitching together assembly fragments on the fly....
 
For my purposes I added a getReverseComplementSequenceAsString method to my own implementation of ProxySequenceReader to reverse-iterate and return the reverse complement sequence
 
so on my DADNASequence you can call: 
 
seq.getReverseComplementSequenceAsString(4,13) 
 
Otherwise, using a BioJava DNASequence  

- I can see you could make an intermediate DNASequence:
 
(new DNASequence(seq.getSubSequence(4,13).getSequenceAsString())).getReverseComplement().getSequenceAsString()
 
- or you could just do it with subString():

seq.getReverseComplement().getSequenceAsString().substring(seq.getBioEnd()-13, seq.getBioEnd()-4+1)

either of which could be wrapped in DNASequence, the View or the Reader. 

Trevor Paterson PhD
new email trevor.paterson at roslin.ed.ac.uk 

Bioinformatics 
The Roslin Institute
The Royal (Dick) School of Veterinary Studies
University of Edinburgh
Scotland EH25 9PS
phone +44 (0)131 5274197

bioinformatics.roslin.ed.ac.uk

Please consider the environment before printing this e-mail

The University of Edinburgh is a charitable body, registered in Scotland with registration number SC005336
Disclaimer:This e-mail and any attachments are confidential and intended solely for the use of the recipient(s) to whom they are addressed. If you have received it in error, please destroy all copies and inform the sender. 


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.





More information about the biojava-dev mailing list