def testUnrecognizableWithoutRaising(self): """ An unrecognizable name must return the original name (not raise a RuntimeError) if raiseOnError is passed as False. """ self.assertEqual('x' * 10, pdbNameToPythonName('x' * 10, raiseOnError=False))
def testCanonicalPDBWithColonSequenceSuffix(self): """ A DXXX:X:sequence PDB name must be converted as expected. """ self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1MLA:A:sequence'))
def testCanonicalPDBWithUnderscore(self): """ A canonical DXXX_X PDB name must be converted as expected. """ self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1MLA_A'))
def testCanonicalPDBWithHyphen(self): """ A canonical DXXX-X PDB name must be converted as expected. """ self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1MLA-A'))
def testCanonicalPDBLowerCase(self): """ A canonical DXXX:X PDB name in lower case must be converted as expected. """ self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1mla:a'))
def testCanonicalPDBUpperCase(self): """ A canonical DXXX:X PDB name must be converted as expected. """ self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1MLA:A'))
resolution = pdbResolutions[pdbId] except KeyError: print('PDB id %r has unknown resolution!' % pdbId, file=sys.stderr) else: if resolution == NMR_RESOLUTION and discardNMR: nmr.add(pdbId) continue if resolution > maxResolution: poorResolution.add(pdbId) continue if minLength > 0 and len(sequence) < minLength: tooShort.add(pdbId) continue sequence.id = pdbNameToPythonName(sequence.id) print(sequence.toString(), end='') if deleted: if args.printIgnoredIds: print('%d sequence ids ignored due to being marked as obsolete in ' 'PDB: %s.' % (len(deleted), ', '.join(sorted(deleted))), file=sys.stderr) else: print('%d sequence ids ignored due to being PDB marked as obsolete in ' 'PDB.' % len(deleted), file=sys.stderr) if tooShort: if args.printIgnoredIds: