@@ -0,0 +1,2359 @@
+%22%22%22PDB utilities%22%22%22%0A%0A%22%22%22%0AThis file is part of RAPD%0A%0ACopyright (C) 2017, Cornell University%0AAll rights reserved.%0A%0ARAPD is free software: you can redistribute it and/or modify%0Ait under the terms of the GNU Affero General Public License as published by%0Athe Free Software Foundation, version 3.%0A%0ARAPD is distributed in the hope that it will be useful,%0Abut WITHOUT ANY WARRANTY; without even the implied warranty of%0AMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0AGNU Affero General Public License for more details.%0A%0AYou should have received a copy of the GNU Affero General Public License%0Aalong with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A%22%22%22%0A%0A__created__ = %222017-04-27%22%0A__maintainer__ = %22Frank Murphy%22%0A__email__ = %22fmurphy@anl.gov%22%0A__status__ = %22Development%22%0A%0A# Standard imports%0A# import argparse%0A# import from collections import OrderedDict%0A# import datetime%0A# import glob%0A# import json%0A# import logging%0A# import multiprocessing%0Aimport os%0A# import pprint%0A# import pymongo%0A# import re%0A# import redis%0A# import shutil%0A# import subprocess%0A# import sys%0A# import time%0A# import unittest%0A%0A# IOTBX Imports%0Aimport iotbx.pdb%0Aimport iotbx.pdb.mmcif%0A%0A# RAPD imports%0A# import commandline_utils%0A# import detectors.detector_utils as detector_utils%0A# import utils%0A%0A%0Adef cif_as_pdb(args):%0A    %22%22%22%0A    Convert CIF files to PDB format%0A%0A    Taken directly from IOTBX program cif_as_pdb.py%0A    %22%22%22%0A    for file_name in args:%0A        try:%0A            assert os.path.exists(file_name)%0A            # print %22Converting %25s to PDB format.%22 %25file_name%0A            cif_input = iotbx.pdb.mmcif.cif_input(file_name=file_name)%0A            hierarchy = cif_input.construct_hierarchy()%0A            basename = os.path.splitext(os.path.basename(file_name))%5B0%5D%0A            iotbx.pdb.write_whole_pdb_file(%0A                file_name=basename+%22.pdb%22,%0A                output_file=None,%0A                processed_pdb_file=None,%0A                pdb_hierarchy=hierarchy,%0A                crystal_symmetry=cif_input.crystal_symmetry(),%0A                ss_annotation=cif_input.extract_secondary_structure(),%0A                append_end=True,%0A                atoms_reset_serial_first_value=None,%0A                link_records=None)%0A        except Exception, e:%0A            print %22Error converting %25s to PDB format:%22 %25 file_name%0A            print %22 %22, str(e)%0A            continue%0A

Add in pdb in utils.