[Biojava-dev] Extension of AmbiguityDNACompoundSet

Hannes Brandstätter-Müller biojava at hannes.oib.com
Thu Jan 12 07:34:52 UTC 2012


I came across a small problem when using the AmbiguityDNACompoundSet,
because some of the FASTA files I had to parse contained "I" - Inosin,
a degenerated compound that was used in some primers. I took the
liberty and extended the class, maybe it can be included in the next
release (either as additional class or as extension of the existing
AmbiguityDNACompoundSet)? I was told it should be treated like N, I
hope I wrote that correctly down there.

public class AmbiguityDNACompoundSetWithInosin  extends DNACompoundSet {


  private static class InitaliseOnDemand {
    public static final AmbiguityDNACompoundSetWithInosin INSTANCE =
new AmbiguityDNACompoundSetWithInosin();
  }

  public static AmbiguityDNACompoundSetWithInosin getDNACompoundSet() {
    return InitaliseOnDemand.INSTANCE;
  }

  public AmbiguityDNACompoundSetWithInosin() {
    super();

    addNucleotideCompound("M", "K",
        "A", "C");
    addNucleotideCompound("R", "Y",
        "A", "G");
    addNucleotideCompound("W", "W",
        "A", "T");
    addNucleotideCompound("S", "S",
        "C", "G");
    addNucleotideCompound("Y", "R",
        "C", "T");
    addNucleotideCompound("K", "M",
        "G", "T");
    addNucleotideCompound("V", "B",
        "A", "C", "G");
    addNucleotideCompound("H", "D",
        "A", "C", "T");
    addNucleotideCompound("D", "H",
        "A", "G", "T");
    addNucleotideCompound("B", "V",
        "C", "G", "T");
    addNucleotideCompound("N", "N",
        "A", "C", "G", "T");
    addNucleotideCompound("I", "I",
        "N", "A", "C", "G", "T");

    calculateIndirectAmbiguities();
  }

}



More information about the biojava-dev mailing list