@Override public String getShortName() { return getBase(); }
@Override public String getShortName() { return getBase(); }
private NucleotideCompound toLowerCase(NucleotideCompound compound) { return getCompoundForString(compound.getBase().toLowerCase()); }
private NucleotideCompound toLowerCase(NucleotideCompound compound) { return getCompoundForString(compound.getBase().toLowerCase()); }
/** * 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. * * @param compounds Compounds to calculate ambiguity for * @return The ambiguity symbol which represents this set of nucleotides best */ public NucleotideCompound getAmbiguity(NucleotideCompound... compounds) { Set<NucleotideCompound> settedCompounds = new HashSet<NucleotideCompound>(); for(NucleotideCompound compound: compounds) { for(NucleotideCompound subCompound: compound.getConstituents()) { settedCompounds.add(getCompoundForString(subCompound.getBase().toUpperCase())); } } for(NucleotideCompound compound: getAllCompounds()) { if(compound.getConstituents().equals(settedCompounds)) { return compound; } } return null; }
/** * 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. * * @param compounds Compounds to calculate ambiguity for * @return The ambiguity symbol which represents this set of nucleotides best */ public NucleotideCompound getAmbiguity(NucleotideCompound... compounds) { Set<NucleotideCompound> settedCompounds = new HashSet<NucleotideCompound>(); for(NucleotideCompound compound: compounds) { for(NucleotideCompound subCompound: compound.getConstituents()) { settedCompounds.add(getCompoundForString(subCompound.getBase().toUpperCase())); } } for(NucleotideCompound compound: getAllCompounds()) { if(compound.getConstituents().equals(settedCompounds)) { return compound; } } return null; }