org.biojava3.core.sequence.edits
Class Edit.Substitute<C extends Compound>

java.lang.Object
  extended by org.biojava3.core.sequence.edits.Edit.AbstractEdit<C>
      extended by org.biojava3.core.sequence.edits.Edit.Substitute<C>
All Implemented Interfaces:
Edit<C>
Enclosing interface:
Edit<C extends Compound>

public static class Edit.Substitute<C extends Compound>
extends Edit.AbstractEdit<C>

Allows for the substitution of bases into an existing Sequence. This allows us to do edits like:

    Sub TT @ position 2
    AAAA -> ATTA
 
We do not support Edits do not require the length of the insertion but do rely on the presence of a CompoundSet to parse a String (if given) which means the eventual length of a Sequence is a lazy operation.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.biojava3.core.sequence.edits.Edit
Edit.AbstractEdit<C extends Compound>, Edit.Delete<C extends Compound>, Edit.Insert<C extends Compound>, Edit.Substitute<C extends Compound>
 
Constructor Summary
Edit.Substitute(Sequence<C> sequence, int position)
           
Edit.Substitute(String sequence, int position)
           
 
Method Summary
 int getEnd(Sequence<C> sequence)
          Must use this rather than the no-args getEnd as this can return -1 and the length of a sub is dependent on the length of the Sequence; we cannot assume 1:1 mapping between characters in a String and the number of compounds we will have to insert.
protected  Sequence<C> getFivePrime(Sequence<C> editingSequence)
          Should return the 5-prime end of the given Sequence according to the edit.
protected  Sequence<C> getThreePrime(Sequence<C> editingSequence)
          Should return the 3-prime end of the given Sequence according to the edit.
 
Methods inherited from class org.biojava3.core.sequence.edits.Edit.AbstractEdit
edit, getEmptySequence, getEnd, getStart, getTargetSequence, setSequence, setStringSequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Edit.Substitute

public Edit.Substitute(String sequence,
                       int position)

Edit.Substitute

public Edit.Substitute(Sequence<C> sequence,
                       int position)
Method Detail

getEnd

public int getEnd(Sequence<C> sequence)
Must use this rather than the no-args getEnd as this can return -1 and the length of a sub is dependent on the length of the Sequence; we cannot assume 1:1 mapping between characters in a String and the number of compounds we will have to insert.


getFivePrime

protected Sequence<C> getFivePrime(Sequence<C> editingSequence)
Description copied from class: Edit.AbstractEdit
Should return the 5-prime end of the given Sequence according to the edit. An empty Sequence is valid.

Specified by:
getFivePrime in class Edit.AbstractEdit<C extends Compound>

getThreePrime

protected Sequence<C> getThreePrime(Sequence<C> editingSequence)
Description copied from class: Edit.AbstractEdit
Should return the 3-prime end of the given Sequence according to the edit. An empty Sequence is valid.

Specified by:
getThreePrime in class Edit.AbstractEdit<C extends Compound>