test_class.file: storage/pdb/src/test/java/org/openscience/cdk/templates/AminoAcidsTest.java
test_class.identifier: AminoAcidsTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testCreateAAs() {
          IAminoAcid[] aas = AminoAcids.createAAs();
          Assert.assertNotNull(aas);
          Assert.assertEquals(20, aas.length);
          for (int i = 0; i < 20; i++) {
              Assert.assertNotNull(aas[i]);
              Assert.assertFalse(0 == aas[i].getAtomCount());
              Assert.assertFalse(0 == aas[i].getBondCount());
              Assert.assertNotNull(aas[i].getMonomerName());
              Assert.assertNotNull(aas[i].getProperty(AminoAcids.RESIDUE_NAME_SHORT));
              Assert.assertNotNull(aas[i].getProperty(AminoAcids.RESIDUE_NAME));
          }
      }
test_case.class_method_signature: AminoAcidsTest.testCreateAAs()
test_case.full_signature: @Test public void testCreateAAs()
test_case.identifier: testCreateAAs
test_case.invocations: createAAs assertNotNull assertEquals assertNotNull assertFalse getAtomCount assertFalse getBondCount assertNotNull getMonomerName assertNotNull getProperty assertNotNull getProperty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateAAs()
focal_class.declarator: LOGGER = LoggingToolFactory.createLoggingTool(AminoAcids.class)
focal_class.modifier: private static final
focal_class.original_string: private static final ILoggingTool LOGGER = LoggingToolFactory.createLoggingTool(AminoAcids.class);
focal_class.type: ILoggingTool
focal_class.var_name: LOGGER
focal_class.declarator: aminoAcids         = null
focal_class.modifier: private static
focal_class.original_string: private static AminoAcid[] aminoAcids         = null;
focal_class.type: AminoAcid[]
focal_class.var_name: aminoAcids
focal_class.declarator: RESIDUE_NAME       = "residueName"
focal_class.modifier: public final static
focal_class.original_string: public final static String RESIDUE_NAME       = "residueName";
focal_class.type: String
focal_class.var_name: RESIDUE_NAME
focal_class.declarator: RESIDUE_NAME_SHORT = "residueNameShort"
focal_class.modifier: public final static
focal_class.original_string: public final static String RESIDUE_NAME_SHORT = "residueNameShort";
focal_class.type: String
focal_class.var_name: RESIDUE_NAME_SHORT
focal_class.declarator: NO_ATOMS           = "noOfAtoms"
focal_class.modifier: public final static
focal_class.original_string: public final static String NO_ATOMS           = "noOfAtoms";
focal_class.type: String
focal_class.var_name: NO_ATOMS
focal_class.declarator: NO_BONDS           = "noOfBonds"
focal_class.modifier: public final static
focal_class.original_string: public final static String NO_BONDS           = "noOfBonds";
focal_class.type: String
focal_class.var_name: NO_BONDS
focal_class.declarator: ID                 = "id"
focal_class.modifier: public final static
focal_class.original_string: public final static String ID                 = "id";
focal_class.type: String
focal_class.var_name: ID
focal_class.file: storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java
focal_class.identifier: AminoAcids
focal_class.class_method_signature: AminoAcids.aaBondInfo()
focal_class.full_signature: public static int[][] aaBondInfo()
focal_class.identifier: aaBondInfo
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: int[][]
focal_class.signature: int[][] aaBondInfo()
focal_class.class_method_signature: AminoAcids.createAAs()
focal_class.full_signature: public synchronized static AminoAcid[] createAAs()
focal_class.identifier: createAAs
focal_class.modifiers: public synchronized static
focal_class.parameters: ()
focal_class.return: AminoAcid[]
focal_class.signature: AminoAcid[] createAAs()
focal_class.class_method_signature: AminoAcids.getHashMapBySingleCharCode()
focal_class.full_signature: public static Map<String, IAminoAcid> getHashMapBySingleCharCode()
focal_class.identifier: getHashMapBySingleCharCode
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Map<String, IAminoAcid>
focal_class.signature: Map<String, IAminoAcid> getHashMapBySingleCharCode()
focal_class.class_method_signature: AminoAcids.getHashMapByThreeLetterCode()
focal_class.full_signature: public static Map<String, IAminoAcid> getHashMapByThreeLetterCode()
focal_class.identifier: getHashMapByThreeLetterCode
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Map<String, IAminoAcid>
focal_class.signature: Map<String, IAminoAcid> getHashMapByThreeLetterCode()
focal_class.class_method_signature: AminoAcids.convertThreeLetterCodeToOneLetterCode(String threeLetterCode)
focal_class.full_signature: public static String convertThreeLetterCodeToOneLetterCode(String threeLetterCode)
focal_class.identifier: convertThreeLetterCodeToOneLetterCode
focal_class.modifiers: public static
focal_class.parameters: (String threeLetterCode)
focal_class.return: String
focal_class.signature: String convertThreeLetterCodeToOneLetterCode(String threeLetterCode)
focal_class.class_method_signature: AminoAcids.convertOneLetterCodeToThreeLetterCode(String oneLetterCode)
focal_class.full_signature: public static String convertOneLetterCodeToThreeLetterCode(String oneLetterCode)
focal_class.identifier: convertOneLetterCodeToThreeLetterCode
focal_class.modifiers: public static
focal_class.parameters: (String oneLetterCode)
focal_class.return: String
focal_class.signature: String convertOneLetterCodeToThreeLetterCode(String oneLetterCode)
focal_method.body: public synchronized static AminoAcid[] createAAs() {
          if (aminoAcids != null) {
              return aminoAcids;
          }
  
          // amino-acids only have benzene aromaticity so we can run a simple
          // alternating pi-bond arom model to keep things in a consistent state
          Aromaticity arom = new Aromaticity(ElectronDonation.cdk(),
                                             Cycles.all(6));
  
          // Create set of AtomContainers
          aminoAcids = new AminoAcid[20];
  
          IChemFile list = new ChemFile();
          CMLReader reader = new CMLReader(AminoAcids.class.getClassLoader().getResourceAsStream(
                  "org/openscience/cdk/templates/data/list_aminoacids.cml"));
          try {
              list = (IChemFile) reader.read(list);
              List<IAtomContainer> containersList = ChemFileManipulator.getAllAtomContainers(list);
              Iterator<IAtomContainer> iterator = containersList.iterator();
              int counter = 0;
              while (iterator.hasNext()) {
                  IAtomContainer ac = (IAtomContainer) iterator.next();
                  LOGGER.debug("Adding AA: ", ac);
                  // convert into an AminoAcid
                  AminoAcid aminoAcid = new AminoAcid();
                  Iterator<IAtom> atoms = ac.atoms().iterator();
                  Iterator<Object> props = ac.getProperties().keySet().iterator();
                  while (props.hasNext()) {
                      Object next = props.next();
                      LOGGER.debug("Prop class: " + next.getClass().getName());
                      LOGGER.debug("Prop: " + next.toString());
                      if (next instanceof DictRef) {
                          DictRef dictRef = (DictRef) next;
                          // logger.debug("DictRef type: " + dictRef.getType());
                          if (dictRef.getType().equals("pdb:residueName")) {
                              aminoAcid.setProperty(RESIDUE_NAME, ac.getProperty(dictRef).toString().toUpperCase());
                              aminoAcid.setMonomerName(ac.getProperty(dictRef).toString());
                          } else if (dictRef.getType().equals("pdb:oneLetterCode")) {
                              aminoAcid.setProperty(RESIDUE_NAME_SHORT, ac.getProperty(dictRef));
                          } else if (dictRef.getType().equals("pdb:id")) {
                              aminoAcid.setProperty(ID, ac.getProperty(dictRef));
                              LOGGER.debug("Set AA ID to: " + ac.getProperty(dictRef));
                          } else {
                              LOGGER.error("Cannot deal with dictRef!");
                          }
                      }
                  }
                  while (atoms.hasNext()) {
                      IAtom atom = (IAtom) atoms.next();
                      String dictRef = (String) atom.getProperty("org.openscience.cdk.dict");
                      if (dictRef != null && dictRef.equals("pdb:nTerminus")) {
                          aminoAcid.addNTerminus(atom);
                      } else if (dictRef != null && dictRef.equals("pdb:cTerminus")) {
                          aminoAcid.addCTerminus(atom);
                      } else {
                          aminoAcid.addAtom(atom);
                      }
                  }
                  Iterator<IBond> bonds = ac.bonds().iterator();
                  while (bonds.hasNext()) {
                      IBond bond = (IBond) bonds.next();
                      aminoAcid.addBond(bond);
                  }
                  AminoAcidManipulator.removeAcidicOxygen(aminoAcid);
                  aminoAcid.setProperty(NO_ATOMS, "" + aminoAcid.getAtomCount());
                  aminoAcid.setProperty(NO_BONDS, "" + aminoAcid.getBondCount());
  
                  AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(aminoAcid);
                  arom.apply(aminoAcid);
  
                  if (counter < aminoAcids.length) {
                      aminoAcids[counter] = aminoAcid;
                  } else {
                      LOGGER.error("Could not store AminoAcid! Array too short!");
                  }
                  counter++;
              }
              reader.close();
          } catch (CDKException | IOException exception) {
              LOGGER.error("Failed reading file: ", exception.getMessage());
              LOGGER.debug(exception);
          }
  
          return aminoAcids;
      }
focal_method.class_method_signature: AminoAcids.createAAs()
focal_method.full_signature: public synchronized static AminoAcid[] createAAs()
focal_method.identifier: createAAs
focal_method.invocations: cdk all getResourceAsStream getClassLoader read getAllAtomContainers iterator hasNext next debug iterator atoms iterator keySet getProperties hasNext next debug getName getClass debug toString equals getType setProperty toUpperCase toString getProperty setMonomerName toString getProperty equals getType setProperty getProperty equals getType setProperty getProperty debug getProperty error hasNext next getProperty equals addNTerminus equals addCTerminus addAtom iterator bonds hasNext next addBond removeAcidicOxygen setProperty getAtomCount setProperty getBondCount percieveAtomTypesAndConfigureAtoms apply error close error getMessage debug
focal_method.modifiers: public synchronized static
focal_method.parameters: ()
focal_method.return: AminoAcid[]
focal_method.signature: AminoAcid[] createAAs()