void MakeMolecules(string[] textData) { _testImporters = new PDBImporter[textData.Length]; for (int i = 0; i < textData.Length; i++) { _testImporters[i] = new PDBImporter(textData[i]); } }
bool RandomAtomsAreCorrect(PDBImporter importer) { PDBAtom testAtom; for (int i = 0; i < randomAtomsToTestPerStructure; i++) { string line = importer.lines[Random.Range(0, importer.lines.Length)]; if (line.Substring(0, 6).Trim().Equals("ATOM")) { testAtom = importer.ParseAtom(-1, line); testAtom.localPosition -= importer.molecule.centerOffset; PDBAtom realAtom = importer.molecule.atoms.Find(a => a.atomNumber == testAtom.atomNumber); if (!realAtom.EqualsAtom(testAtom)) { return(false); } // Debug.Log(realAtom.ToString() + " PASSED"); } } return(true); }
bool ResidueSequenceMatchesAtoms(PDBImporter importer) { int r = 0; List <Residue> residues = importer.residueSequence; List <PDBAtom> atoms = importer.molecule.atoms; for (int a = 0; a < atoms.Count; a++) { if (a > 0 && atoms[a].residueNumber != atoms[a - 1].residueNumber) { r++; } if (atoms[a].residueType != residues[r]) { Debug.Log(importer.molecule.pdbID + " " + atoms[a].ToString() + " does not match " + residues[r] + r); return(false); } } return(true); }