org.biojava3.core.sequence.template
Class AbstractNucleotideCompoundSet<C extends NucleotideCompound>

java.lang.Object
  extended by org.biojava3.core.sequence.template.AbstractCompoundSet<C>
      extended by org.biojava3.core.sequence.template.AbstractNucleotideCompoundSet<C>
Type Parameters:
C - Type of compound this set will contain but must extend NucleotideCompound
All Implemented Interfaces:
CompoundSet<C>
Direct Known Subclasses:
DNACompoundSet, RNACompoundSet

public abstract class AbstractNucleotideCompoundSet<C extends NucleotideCompound>
extends AbstractCompoundSet<C>

Author:
Andy Yates

Constructor Summary
AbstractNucleotideCompoundSet()
           
 
Method Summary
protected  void addNucleotideCompound(String base, String complement, String... equivalents)
           
protected  void calculateIndirectAmbiguities()
          Loops through all known nucelotides and attempts to find which are equivalent to each other.
 NucleotideCompound getAmbiguity(NucleotideCompound... compounds)
          Calculates the best symbol for a collection of compounds.
 boolean isComplementable()
          NucleotideCompounds can always complement
protected abstract  C newNucleotideCompound(String base, String complement, String... equivalents)
           
 
Methods inherited from class org.biojava3.core.sequence.template.AbstractCompoundSet
addCompound, addCompound, addCompound, addEquivalent, compoundsEqual, compoundsEquivalent, equals, getAllCompounds, getCompoundForString, getEquivalentCompounds, getMaxSingleCompoundStringLength, getStringForCompound, hasCompound, hashCode, isCompoundStringLengthEqual, verifySequence
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNucleotideCompoundSet

public AbstractNucleotideCompoundSet()
Method Detail

addNucleotideCompound

protected void addNucleotideCompound(String base,
                                     String complement,
                                     String... equivalents)

newNucleotideCompound

protected abstract C newNucleotideCompound(String base,
                                           String complement,
                                           String... equivalents)

calculateIndirectAmbiguities

protected void calculateIndirectAmbiguities()
Loops through all known nucelotides and attempts to find which are equivalent to each other. Also takes into account lower casing nucleotides as well as upper-cased ones.


getAmbiguity

public NucleotideCompound getAmbiguity(NucleotideCompound... compounds)
Calculates the best symbol for a collection of compounds. For example if you gave this method a AC it will return a M which is the ambiguity symbol for these compounds.

Parameters:
compounds - Compounds to calculate ambiguity for
Returns:
The ambiguity symbol which represents this set of nucleotides best

isComplementable

public boolean isComplementable()
NucleotideCompounds can always complement

Specified by:
isComplementable in interface CompoundSet<C extends NucleotideCompound>
Overrides:
isComplementable in class AbstractCompoundSet<C extends NucleotideCompound>