<div dir="ltr"><div><div><div>Hi Ben and all,<br></div>I'm following this thread with interest. <br>Just to examine in depth, what was the reason of the idea of mantaining the sequence atomic? The fact to keep working with the same instantiated object (and hence it's reference) during the software run lifetime?<br></div>If is it so, I like the idea that yourself are suggesting to accomplish the task of a DNA mutation with a SequenceView. <br><br></div>Paolo<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-30 16:36 GMT+02:00 Ben Stöver <span dir="ltr"><<a href="mailto:benstoever@uni-muenster.de" target="_blank">benstoever@uni-muenster.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jonas,<br>
<br>
I have been proposing to inherit a subinterface "EditableSequence" (with<br>
according implementations) from the existing Sequence interface on this list<br>
last November. Some people liked this idea, some did not, mainly because there<br>
seemed to be concerns that existing code (using BioJava) relies on the<br>
assumption of atomic sequences and allowing their modification might break<br>
some of this code (at least this was my interpretation of the concerns). (You<br>
can have a look at these mails in some archive or I can forward them to you,<br>
if you want to have a closer look at that discussion.)<br>
<br>
To my knowledge it is indeed difficult to modify sequences in the current<br>
architecture. The only way I'm aware of, is creating a new SequenceView on<br>
your sequence which provides a modified view on the underlying sequence<br>
modeling you mutation. I think there are even some implementations out there<br>
based on this interface<br>
<a href="https://github.com/biojava/biojava/blob/master/biojava-core/src/main/java/org/biojava/nbio/core/sequence/edits/Edit.java" target="_blank">https://github.com/biojava/biojava/blob/master/biojava-core/src/main/java/org/biojava/nbio/core/sequence/edits/Edit.java</a><br>
but I never tried them. In my opinion, it is mainly a question of performance,<br>
if this approach makes sense for you. (If you e.g. perform many mutations you<br>
would not want to create a copy of your whole sequence for each operation and<br>
have a chain of 1000 sequence views in the end.)<br>
<br>
Of course you are always free to create or modify an existing implementation<br>
of "Sequence" that offer additional methods for modification, but keep in mind<br>
that this would break the assumption of "atomic sequence objects", which seems<br>
to be intended in the current BioJava sequence model.<br>
<br>
Anyway, if anyone knows about any other ways to do that in BioJava or could<br>
think about a good way of integrating this functionality in the existing<br>
architecture (without building up an alternative sequence framework), I would<br>
be very interested to know.<br>
<br>
Best<br>
Ben<br>
<br>
Dipl. Biologe Ben Stöver<br>
Evolution und Biodiversity of Plants Group<br>
Institute for Evolution and Biodiversity<br>
University of Münster<br>
Germany<br>
<a href="http://www2.ieb.uni-muenster.de/EvolBiodivPlants/en/People/Stoever" target="_blank">http://www2.ieb.uni-muenster.de/EvolBiodivPlants/en/People/Stoever</a><br>
<a href="mailto:BenStoever@uni-muenster.de">BenStoever@uni-muenster.de</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
LAW Andy schrieb am 2015-03-30:<br>
> I think the philosophical view on this is that the mutated sequence<br>
> is a *new* and *different* sequence.<br>
<br>
> On 30 Mar 2015, at 09:30, Jose Manuel Duarte <<a href="mailto:jose.duarte@psi.ch">jose.duarte@psi.ch</a>><br>
> wrote:<br>
<br>
> > Hi Jonas<br>
<br>
> > I'm not very familiar with the sequence part of Biojava, but after<br>
> > looking around a bit it seems that indeed there's no available way<br>
> > to mutate sequences. It looks like people using Biojava before had<br>
> > "read-only" applications in mind. I agree a setCompoundAt(int<br>
> > position) would be needed, it should actually be part of the<br>
> > Sequence interface. It would be a nice addition for 4.1.<br>
<br>
> > Anyway sorry I can't be of more help, perhaps someone else has some<br>
> > more background info on this.<br>
<br>
> > Jose<br>
<br>
<br>
<br>
> > On 28.03.2015 17:13, Jonas Dehairs wrote:<br>
> >> I want to introduce a mutation to a DNA sequence at a particular<br>
> >> location.<br>
> >> I can't seem to find a suitable method for this in the 4.0 API.<br>
> >> What would make most sense to me is a setCompoundAt (int position,<br>
> >> c compound) method in the AbstractSequence class, similar to the<br>
> >> getCompoundAt(int position) method, but this doesn't seem to<br>
> >> exist. And the mutator class seems to be for proteins only. How<br>
> >> can I do this?<br>
<br>
<br>
<br>
<br>
> --<br>
> The University of Edinburgh is a charitable body, registered in<br>
> Scotland, with registration number SC005336.<br>
<br>
<br>
> _______________________________________________<br>
> Biojava-l mailing list - <a href="mailto:Biojava-l@mailman.open-bio.org">Biojava-l@mailman.open-bio.org</a><br>
> <a href="http://mailman.open-bio.org/mailman/listinfo/biojava-l" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biojava-l</a><br>
<br>
_______________________________________________<br>
Biojava-l mailing list - <a href="mailto:Biojava-l@mailman.open-bio.org">Biojava-l@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biojava-l" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biojava-l</a><br>
</div></div></blockquote></div><br></div>