get the base monomer, the return value could be null if this nucleotide
does not have a base

@param monomerStore - store in which base monomer is located
@return base monomer, could be null
497359
public Monomer getBaseMonomer(MonomerStore monomerStore) {

    String baseSymbol = getBaseSymbol();
    if (baseSymbol != null && !baseSymbol.equalsIgnoreCase("")) {
      try {
        Map<String, Monomer> monomers = monomerStore.getMonomers(Monomer.NUCLIEC_ACID_POLYMER_TYPE);
        Monomer m = monomers.get(baseSymbol);
        return m;
      } catch (Exception ex) {
        LOG.info("Unable to get base monomer for "
            + baseSymbol);
        return null;
      }
    } else {
      return null;
    }

  }
1216595
public static Monomer getMonomer(Element monomer) throws MonomerException {
    Monomer m = new Monomer();
    Namespace ns = monomer.getNamespace();
    m.setAlternateId(monomer.getChildText(MONOMER_ID_ELEMENT, ns));
    m.setCanSMILES(monomer.getChildText(MONOMER_SMILES_ELEMENT, ns));
    String encodedMolfile = monomer.getChildText(MONOMER_MOL_FILE_ELEMENT, ns);

    String molfile = null;
    try {
      molfile = MolfileEncoder.decode(encodedMolfile);
    } catch (EncoderException ex) {
      throw new MonomerException("Invalid monomer molfile");
    }
    m.setMolfile(molfile);
    m.setMonomerType(monomer.getChildText(MONOMER_TYPE_ELEMENT, ns));
    m.setPolymerType(monomer.getChildText(POLYMER_TYPE_ELEMENT, ns));
    m.setNaturalAnalog(monomer.getChildText(NATURAL_ANALOG_ELEMENT, ns));
    m.setName(monomer.getChildText(MONOMER_NAME_ELEMENT, ns));
    Element attachmentElement = monomer.getChild(ATTACHEMENTS_ELEMENT, ns);

    if (null != attachmentElement) {
      List attachments = attachmentElement.getChildren(ATTACHEMENT_ELEMENT, ns);
      List<Attachment> l = new ArrayList<Attachment>();
      Iterator i = attachments.iterator();
      while (i.hasNext()) {
        Element attachment = (Element) i.next();
        Attachment att = getAttachment(attachment);
        l.add(att);
      }
      m.setAttachmentList(l);
    }
    return m;
  }
756637
public BaseTable doMakeTable(Record record)
    {
        if (((record.getDatabaseType() & DBConstants.TABLE_TYPE_MASK) == DBConstants.MEMORY)
            || ((record.getDatabaseType() & DBConstants.TABLE_TYPE_MASK) == DBConstants.UNSHAREABLE_MEMORY))
        {
        	BaseDatabase database = (BaseDatabase)this.getDatabaseOwner().getDatabase(DBParams.MEMORY, record.getDatabaseType(), null);
        	return database.doMakeTable(record);
        }
        else
            return null;
    }
691196
public static MonomerStore getMonomerStore(Element rootElement)
      throws MonomerException, IOException {
    MonomerStore monomerStore = new MonomerStore();
    Element monomerListElement = rootElement.getChild("Monomers");
    if (monomerListElement != null) {
      @SuppressWarnings("unchecked")
      List<Element> elementList = monomerListElement.getChildren("Monomer");

      for (Element monomerElement : elementList) {
        Monomer m = MonomerParser.getMonomer(monomerElement);
        monomerStore.addMonomer(m);
      }
    }
    return monomerStore;
  }
525294
Key getPublicKey(String trustedAlias, String trustStoreRef, String signatureAlgorithm)
			throws KeyStoreServiceException, KeyException {
		Key signingKey = getPublicKeyFromKeystore(trustedAlias, trustStoreRef, signatureAlgorithm);
		if (tc.isDebugEnabled()) {
			Tr.debug(tc, "Trusted alias: " + trustedAlias + ", Truststore: " + trustStoreRef);
			Tr.debug(tc, "RSAPublicKey: " + (signingKey instanceof RSAPublicKey));
		}
		if (signingKey != null && !(signingKey instanceof RSAPublicKey)) {
			signingKey = null;
		}
		return signingKey;
	}
257575
public static String getOidFromRef(String ref) {
        Matcher matcher = match(ref);
        return matcher != null ? matcher.group(2) : null;
    }
1064711
static private String getBase(String oldBase, XMLStreamReader rdr) {
    String newBase =  resolve(oldBase, rdr.getAttributeValue(XML_NS, BASE));
    if (newBase != oldBase) {
      logger.debug("xml:base is now {}", newBase);
    }
    return newBase;
  }
505419
public BinaryStore findBinaryStoreContainingKey( BinaryKey key ) {
        Iterator<Map.Entry<String, BinaryStore>> binaryStoreIterator = getNamedStoreIterator();

        while (binaryStoreIterator.hasNext()) {
            BinaryStore bs = binaryStoreIterator.next().getValue();
            if (bs.hasBinary(key)) {
                return bs;
            }
        }

        return null;
    }
812083
public String getNaturalAnalog(MonomerStore monomerStore) {
    String baseNotation = null;
    String notation = getNotation();
    char[] notationChar = notation.toCharArray();
    for (int i = 0; i < notationChar.length; i++) {
      if (notationChar[i] == '[') {
        int pos = NucleotideParser.getMatchingBracketPosition(notationChar, i, '[', ']');
        i = pos;
        continue;
      }
      // must be the base
      if (notationChar[i] == '(') {
        int pos = NucleotideParser.getMatchingBracketPosition(notationChar, i, '(', ')');
        baseNotation = notation.substring(i + 1, pos);
        break;

      }
    }

    // No base found
    if (baseNotation == null) {
      return "X";
    }
    // remove first and last bracket
    if ((baseNotation.charAt(0) == '[')
        && (baseNotation.charAt(baseNotation.length() - 1) == ']')) {
      baseNotation = baseNotation.substring(1, baseNotation.length() - 1);
    } else {
      baseNotation = baseNotation;
    }

    try {

      Map<String, Monomer> monomers = monomerStore.getMonomers(Monomer.NUCLIEC_ACID_POLYMER_TYPE);
      Monomer m = monomers.get(baseNotation);

      if (m == null) {
        Map<String, Monomer> smiles = monomerStore.getSmilesMonomerDB();
        m = smiles.get(baseNotation);
      }

      return m.getNaturalAnalog();
    } catch (Exception e) {
      LOG.info("Unable to get natural analog for "
          + baseNotation);
      return "X";
    }
  }
839272
public Store getStore(StoreConfiguration storeConfiguration, List<Class<?>> types) {
        StoreKey key = StoreKey.builder().uri(storeConfiguration.getUri().normalize()).username(storeConfiguration.getUsername()).build();
        Store store = storesByKey.get(key);
        if (store == null) {
            store = StoreFactory.getStore(storeConfiguration);
            store.start(types);
            storesByKey.put(key, store);
            keysByStore.put(store, key);
        }
        return store;
    }
1277916
public javax.swing.JMenuBar getBaseMenuBar()
	{
		if (baseMenuBar == null)
		{
			baseMenuBar = new javax.swing.JMenuBar();
			baseMenuBar.setName("baseMenuBar");
			baseMenuBar.add(getMenu_File());
			baseMenuBar.add(getMenu_View());
			baseMenuBar.add(getMenu_LookAndFeel());
			baseMenuBar.add(getMenu_Help());
		}
		return baseMenuBar;
	}
667236
public KVStore toKVStore() {
        KVStore store = new KVStore();
        store.putValue("status", statusCode());
        store.putValue("message", getLocalizedMessage());
        store.putValue("timestamp", timestamp());
        Integer code = errorCode();
        if (null != code) {
            store.putValue("code", code);
        }
        Object payload = attachment();
        if (null != payload) {
            store.putValue("payload", payload);
        }
        return store;
    }
1123126
def get_monomers(self, ligands=True):
        
        if ligands and self.ligands:
            monomers = self._monomers + self.ligands._monomers
        else:
            monomers = self._monomers
        return iter(monomers)
564595
public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IBond bond) {
        IAtomContainer result = null;
        if (chemModel.getMoleculeSet() != null) {
            IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
            result = MoleculeSetManipulator.getRelevantAtomContainer(moleculeSet, bond);
            if (result != null) {
                return result;
            }
        }
        if (chemModel.getReactionSet() != null) {
            IReactionSet reactionSet = chemModel.getReactionSet();
            return ReactionSetManipulator.getRelevantAtomContainer(reactionSet, bond);
        }
        // This should never happen.
        return null;
    }
617098
private static Class<? extends Annotation> getContainer(Class<? extends Annotation> annoType) {
        Repeatable repeatable = annoType.getAnnotation(Repeatable.class);
        return (repeatable == null) ? null : repeatable.value();
    }
1103231
public void addMonomer(Monomer monomer, boolean dbChanged)
      throws IOException, MonomerException {
    Map<String, Monomer> monomerMap = monomerDB.get(monomer.getPolymerType());
    String polymerType = monomer.getPolymerType();
    String alternateId = monomer.getAlternateId();
    String smilesString = monomer.getCanSMILES();

    try {
      smilesString = SMILES.getUniqueExtendedSMILES(smilesString);
    } catch (Exception e) {
      smilesString = monomer.getCanSMILES();
    }

    boolean hasSmilesString = (smilesString != null && smilesString.length() > 0);

    if (null == monomerMap) {
      monomerMap = new TreeMap<String, Monomer>(String.CASE_INSENSITIVE_ORDER);
      monomerDB.put(polymerType, monomerMap);
    }

    Monomer copyMonomer = DeepCopy.copy(monomer);

    // ensure the canonical SMILES is indexed in the monomer store
    if (hasSmilesString) {
      copyMonomer.setCanSMILES(smilesString);
    }

    boolean alreadyAdded = false;
    alreadyAdded = monomerMap.containsKey(alternateId);

    if (!alreadyAdded) {
      monomerMap.put(alternateId, copyMonomer);

      boolean alreadyInSMILESMap = hasSmilesString
          && (smilesMonomerDB.containsKey(smilesString));

      if (!alreadyInSMILESMap) {
        smilesMonomerDB.put(smilesString, copyMonomer);
      }
    }

    if (dbChanged) {
      MonomerFactory.setDBChanged(true);
    }
  }
53238
private static float calculateExtinctionFromRNA(List<Monomer> monomers) throws CalculationException, IOException {
    LOG.debug("ExtinctionCalculation of RNA");
    float resultSingle = 0.0f;
    float resultDi = 0.0f;
    String previous = "";
    if (monomers.size() == 0) {
      throw new CalculationException("Input sequence cannot be null");
    } else {
      if (monomers.size() == 1) {
        if (monoNucleotideMap.containsKey(monomers.get(0).getNaturalAnalog())) {
          return monoNucleotideMap.get(monomers.get(0).getNaturalAnalog()).floatValue();

        } else {
          throw new CalculationException("Unknown nucleotide found");
        }
      }
      for (int i = 0; i < monomers.size(); i++) {
        if (i > 0 && i < monomers.size() - 1) {
          if (monoNucleotideMap.containsKey(monomers.get(i).getNaturalAnalog())) {
            Float value = monoNucleotideMap.get(monomers.get(i).getNaturalAnalog()).floatValue();
            resultSingle += (value.floatValue() * 1.0);

          }
        }
        if (previous != "") {
          if (diNucleotideMap.containsKey(previous + monomers.get(i).getNaturalAnalog())) {
            Float value = diNucleotideMap.get(previous + monomers.get(i).getNaturalAnalog()).floatValue();
            resultDi += (value.floatValue() * 1.0);
          }
        }

        previous = monomers.get(i).getNaturalAnalog();
      }

    }
    resultSingle = BigDecimal.valueOf(resultSingle).floatValue();
    resultDi = BigDecimal.valueOf(resultDi).floatValue();
    return 2 * resultDi - resultSingle;
  }