Class Edit.Substitute<C extends Compound>

java.lang.Object
org.biojava3.core.sequence.edits.Edit.AbstractEdit<C>
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.
  • Constructor Details

    • Substitute

      public Substitute(String sequence, int position)
    • Substitute

      public Substitute(Sequence<C> sequence, int position)
  • Method Details

    • 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.