예제 #1
0
 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))
예제 #2
0
 def testCanonicalPDBWithColonSequenceSuffix(self):
     """
     A DXXX:X:sequence PDB name must be converted as expected.
     """
     self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1MLA:A:sequence'))
예제 #3
0
 def testCanonicalPDBWithUnderscore(self):
     """
     A canonical DXXX_X PDB name must be converted as expected.
     """
     self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1MLA_A'))
예제 #4
0
 def testCanonicalPDBWithHyphen(self):
     """
     A canonical DXXX-X PDB name must be converted as expected.
     """
     self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1MLA-A'))
예제 #5
0
 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'))
예제 #6
0
 def testCanonicalPDBUpperCase(self):
     """
     A canonical DXXX:X PDB name must be converted as expected.
     """
     self.assertEqual('pdb_1mla_a', pdbNameToPythonName('1MLA:A'))
예제 #7
0
            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: