Exemple #1
0
    def testReadMapHeaderPygal(self):
        """  Test read map header -- export JSON packet and plot density distribution -
        """
        logger.info("\nStarting %s %s\n" %
                    (self.__class__.__name__, sys._getframe().f_code.co_name))
        try:
            dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                               siteId=self.__siteId,
                               verbose=True)
            #
            inpPath = os.path.join(self.__testFilePath, self.__testMapNormal)
            of = self.__testMapNormal + "_map-header-data_P1.json"
            dp.imp(inpPath)
            dp.op("annot-read-map-header")
            dp.expLog("annot-read-map-header.log")
            dp.exp(of)
            dp.cleanup()
            #
            mD = json.load(open(of, 'r'))
            logger.info("Map header keys: %r\n" % mD.keys())
            logger.info("Map header: %r\n" % mD.items())

            logger.info("Input  header keys: %r\n" % mD['input_header'].keys())
            logger.info("Output header keys: %r\n" %
                        mD['output_header'].keys())
            #
            x = mD['input_histogram_categories']
            y = mD['input_histogram_values']
            logy = []
            for v in y:
                if float(v) <= 0.0:
                    logy.append(math.log10(.1))
                else:
                    logy.append(math.log10(float(v)))

            # width = float(x[-1] - x[0]) / float(len(x))
            #width = 2.0

            logger.info("Starting plot len x %d len y %d \n" %
                        (len(x), len(logy)))
            nL = int(len(x) / 10)
            #
            if False:
                bar_chart = pygal.Bar(x_label_rotation=20,
                                      show_minor_x_labels=False,
                                      style=LightColorizedStyle)
            bar_chart = pygal.Bar(x_label_rotation=20,
                                  show_minor_x_labels=False,
                                  style=LightGreenStyle)
            bar_chart.title = 'Map density distribution'
            bar_chart.x_labels = map(str, [int(t) for t in x])
            bar_chart.x_labels_major = map(str, [int(t) for t in x[::nL]])

            bar_chart.add('Voxels (log(10)', logy)
            plotFileName = "map-density-plot-pygal.svg"
            bar_chart.render_to_file(plotFileName)

        except Exception as e:
            logger.exception("Failing with %s" % str(e))
            self.fail()
 def testAnnotDccReport(self):
     """  Test create DCC report -
     """
     logger.info("\nStarting %s %s\n" %
                 (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         ofn = "dcc-report.cif"
         dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                            siteId=self.__siteId,
                            verbose=True)
         dp.setDebugMode()
         xyzPath = os.path.join(self.__testFilePath,
                                self.__testFileValidateXyz)
         sfPath = os.path.join(self.__testFilePath,
                               self.__testFileValidateSf)
         dp.imp(xyzPath)
         dp.addInput(name="sf_file_path", value=sfPath)
         dp.op("annot-dcc-report")
         dp.expLog("dcc-report.log")
         dp.exp(ofn)
         # dp.expList(dstPathList=[ofpdf,ofxml])
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
    def read_mtz_sf(self, pathin):
        """Reads MTZ structure factor file 

            Return True on success, otherwise False
        """

        logger.debug("Starting mtz read %s" % pathin)

        suffix = '-dir'
        prefix = 'rcsb-'
        if self.__tmppath is not None and os.path.isdir(self.__tmppath):
            workpath = tempfile.mkdtemp(suffix, prefix, self.__tmppath)
        else:
            workpath = tempfile.mkdtemp(suffix, prefix)

        diagfn = os.path.join(workpath, "sf-convert-diags.cif")
        ciffn = os.path.join(workpath, "sf-convert-datafile.cif")
        dmpfn = os.path.join(workpath, "sf-convert-mtzdmp.log")
        logfn = os.path.join(workpath, "sf-convert.log")

        dp = RcsbDpUtility(siteId=self.__siteid, tmpPath=self.__tmppath)
        dp.imp(pathin)
        dp.op('annot-sf-convert')
        dp.expLog(logfn)
        dp.expList(dstPathList=[ciffn, diagfn, dmpfn])
        if os.path.exists(ciffn):
            ret = self.read_mmcif_sf(ciffn)
        else:
            ret = False

        if self.__cleanup:
            dp.cleanup()
            shutil.rmtree(workpath, ignore_errors=True)
        return ret
    def rcsb2Pdbx(self,
                  inpPath,
                  outPath,
                  stripFlag=False,
                  stripEntityFlag=False):
        """  RCSB CIF -> PDBx conversion  (Using the smaller application in the annotation package)
        """
        try:
            dp = RcsbDpUtility(tmpPath=self.__sessionPath,
                               siteId=self.__siteId,
                               verbose=self.__verbose,
                               log=self.__lfh)
            dp.imp(inpPath)

            if stripFlag:
                if stripEntityFlag:
                    dp.op("annot-rcsb2pdbx-strip-plus-entity")
                else:
                    dp.op("annot-rcsb2pdbx-strip")
            else:
                dp.op("annot-rcsb2pdbx")

            logPath = os.path.join(self.__sessionPath, "annot-rcsb2pdbx.log")
            dp.expLog(logPath)
            dp.exp(outPath)
            if (not self.__debug):
                dp.cleanup()
        except:
            traceback.print_exc(file=self.__lfh)
            return False
        #
        return True
 def testPisaAssemblyDownloadModelPdb(self):
     """
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         fPath = os.path.join(self.__testFilePath, self.__testFileCifPisa)
         dp.imp(fPath)
         dp.addInput(name="pisa_session_name", value="session_3re3_cif")
         dp.op("pisa-analysis")
         dp.expLog("pisa-anal-assembly-cif.log.gz")
         dp.op("pisa-assembly-report-xml")
         dp.exp("pisa-assembly-report-cif.xml")
         dp.expLog("pisa-report-xml-cif.log.gz")
         #
         for assemId in ['1', '2', '3', '4', '5']:
             dp.addInput(name="pisa_assembly_id", value=assemId)
             oFileName = '3rer-assembly-' + assemId + '.pdb.gz'
             oLogName = '3rer-assembly-' + assemId + '-pdb.log.gz'
             dp.op("pisa-assembly-coordinates-pdb")
             dp.exp(oFileName)
             dp.expLog(oLogName)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
    def mtz2Pdbx(self,
                 mtzFilePath,
                 outSfFilePath,
                 pdbxFilePath=None,
                 logFilePath=None,
                 diagsFilePath=None,
                 dumpFilePath=None,
                 timeout=120):
        """ Convert input MTZ format to PDBx sf file.
        """
        try:
            diagfn = logFilePath if logFilePath is not None else "sf-convert-diags.cif"
            dmpfn = dumpFilePath if dumpFilePath is not None else "sf-convert-mtzdmp.log"
            #
            dp = RcsbDpUtility(tmpPath=self.__sessionPath,
                               siteId=self.__siteId,
                               verbose=self.__verbose,
                               log=self.__lfh)
            dp.imp(mtzFilePath)
            dp.setTimeout(timeout)
            if pdbxFilePath is not None:
                dp.addInput(name="xyz_file_path", value=pdbxFilePath)
            dp.op("annot-sf-convert")
            dp.expLog(logFilePath)
            dp.expList(dstPathList=[outSfFilePath, diagfn, dmpfn])

            if (not self.__debug):
                dp.cleanup()
            return True
        except:
            self.__lfh.write(
                "+DataFileAdapter.mtz2Pdbx() - failing for mtz file path %s output path %s\n"
                % (mtzFilePath, outSfFilePath))
            traceback.print_exc(file=self.__lfh)
            return False
    def rcsbEps2Pdbx(self,
                     inpPath,
                     outPath,
                     stripFlag=False,
                     stripEntityFlag=False):
        """  RCSB CIFEPS -> PDBx conversion (This still requires using the full maxit application)
        """
        try:
            dp = RcsbDpUtility(tmpPath=self.__sessionPath,
                               siteId=self.__siteId,
                               verbose=self.__verbose,
                               log=self.__lfh)
            dp.imp(inpPath)
            if stripFlag:
                if stripEntityFlag:
                    dp.op("annot-rcsbeps2pdbx-strip-plus-entity")
                else:
                    dp.op("annot-rcsbeps2pdbx-strip")
            else:
                dp.op("annot-cif2cif")

            logPath = os.path.join(self.__sessionPath,
                                   "annot-rcsbeps2pdbx.log")
            dp.expLog(logPath)
            dp.exp(outPath)
            if (not self.__debug):
                dp.cleanup()
        except:
            traceback.print_exc(file=self.__lfh)
            return False
        #
        return True
    def __getLoadFile(self, sessionPath, listfile, sqlfile, logfile):

        fn = os.path.join(self.__sessionPath, listfile)

        mapping = self.__cIcommon.get_site_da_internal_schema_path()

        self.__lfh.write(
            "DbLoadUtil::__getLoadFile(): listfile %s sqlfile %s logfile %s\n"
            % (fn, sqlfile, logfile))
        try:
            dp = RcsbDpUtility(tmpPath=sessionPath,
                               siteId=self.__siteId,
                               verbose=self.__verbose,
                               log=self.__lfh)
            dp.setDebugMode()
            dp.imp(fn)
            dp.addInput(name="mapping_file", value=mapping, type="file")
            dp.addInput(name="file_list", value=True)
            # This code handles model files
            dp.addInput(name="first_block", value=True)

            dp.op("db-loader")
            dp.expLog(logfile)
            dp.exp(sqlfile)
            dp.cleanup()
            return
        except:  # noqa: E722 pylint: disable=bare-except
            self.__lfh.write(
                "DbLoadUtil::__getLoadFile(): failing, with exception.\n")
            traceback.print_exc(file=self.__lfh)
    def testAnnotValidateListNmrTest(self):
        """  Test create validation report for the test list of example PDB ids (NMR examples)
        """
        logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
        try:
            count = 0
            for pdbId in self.__testValidateNmrIdList:
                ofpdf = pdbId + "-valrpt.pdf"
                ofxml = pdbId + "-valdata.xml"
                offullpdf = pdbId + "-valrpt_full.pdf"
                ofpng = pdbId + "-val-slider.png"
                ofsvg = pdbId + "-val-slider.svg"
                #
                testFileValidateXyz = pdbId + ".cif"
                testFileValidateCs = pdbId + "-cs.cif"
                dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)

                xyzPath = os.path.abspath(os.path.join(self.__testFilePath, testFileValidateXyz))
                csPath = os.path.abspath(os.path.join(self.__testFilePath, testFileValidateCs))
                dp.addInput(name="request_annotation_context", value="yes")
                # adding explicit selection of steps --
                # Alternate
                if count % 2 == 0:
                    dp.addInput(name="step_list", value=" coreclust,chemicalshifts,writexml,writepdf ")
                count += 1
                dp.imp(xyzPath)
                dp.addInput(name="cs_file_path", value=csPath)
                dp.op("annot-wwpdb-validate-all")
                dp.expLog(pdbId + "-annot-validate-test.log")
                dp.expList(dstPathList=[ofpdf, ofxml, offullpdf, ofpng, ofsvg])
                dp.cleanup()
        except Exception as e:
            logger.exception("Failing with %s" % str(e))
            self.fail()
Exemple #10
0
 def testPisaAssemblyDownloadModelPdb(self):
     """ """
     logger.info("\nStarting")
     try:
         dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                            siteId=self.__siteId,
                            verbose=True)
         fPath = os.path.join(self.__testFilePath, self.__testFileCifPisa)
         dp.imp(fPath)
         dp.addInput(name="pisa_session_name", value="session_3re3_cif")
         dp.op("pisa-analysis")
         dp.expLog("pisa-anal-assembly-cif.log.gz")
         dp.op("pisa-assembly-report-xml")
         dp.exp("pisa-assembly-report-cif.xml")
         dp.expLog("pisa-report-xml-cif.log.gz")
         #
         for assemId in ["1", "2", "3", "4", "5"]:
             dp.addInput(name="pisa_assembly_id", value=assemId)
             oFileName = "3rer-assembly-" + assemId + ".pdb.gz"
             oLogName = "3rer-assembly-" + assemId + "-pdb.log.gz"
             dp.op("pisa-assembly-coordinates-pdb")
             dp.exp(oFileName)
             dp.expLog(oLogName)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
    def testFixSpecialPosition(self):
        """  Test for fixing atoms on special position
        """
        logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
        try:

            dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
            #
            inpPath = os.path.join(self.__testFilePath, self.__testFileValidateXyz)
            dp.imp(inpPath)
            dp.op("annot-dcc-fix-special-position")
            dp.expLog("special-position-fix.log")
            dp.exp("special-position-output-fix.log")

            # No output - none on special
            self.assertEqual(['missing'], dp.getResultPathList())

            f = open('special-position-output-fix.log', 'r')
            lines = f.read()
            f.close()
            self.assertIn('No atoms sit on special position', lines)
            dp.cleanup()
        except Exception as e:
            logger.exception("Failing with %s" % str(e))
            self.fail()

        # This case has atoms on special position that needs correction
        try:

            dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
            #
            # dp.setDebugMode(True)
            #
            inpPath = os.path.join(self.__testFilePath, self.__testSpecialPosition)
            dp.imp(inpPath)
            dp.op("annot-dcc-fix-special-position")
            dp.expLog("special-position-fix2.log")
            dp.exp("special-position-output-fix2.log")

            print(dp.getResultPathList())

            # We expect output
            self.assertNotEqual(['missing'], dp.getResultPathList())

            dp.expList(dstPathList=['special-position-out-fix2.cif'])
            # Check output - for differences...

            f = open('special-position-output-fix2.log', 'r')
            lines = f.read()
            f.close()
            self.assertIn('Error: Wrong occupancy of 1.00 for atom (O : id=D_HOH_1)', lines)
            dp.cleanup()
        except Exception as e:
            logger.exception("Failing with %s" % str(e))
            self.fail()
    def testSpecialPosition(self):
        """Test for atom on special position"""
        logger.info("\nStarting")
        try:

            dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                               siteId=self.__siteId,
                               verbose=True)
            #
            # dp.setDebugMode(True)
            #
            inpPath = os.path.join(self.__testFilePath,
                                   self.__testFileValidateXyz)
            dp.imp(inpPath)
            dp.op("annot-dcc-special-position")
            dp.expLog("special-position.log")
            dp.exp("special-position-output.log")
            f = open("special-position-output.log", "r")
            lines = f.read()
            f.close()
            self.assertIn("No atoms sit on special position", lines)
            dp.cleanup()
        except Exception as e:
            logger.exception("Failing with %s", str(e))
            self.fail()

        # This case has atoms on special position that needs correction
        try:

            dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                               siteId=self.__siteId,
                               verbose=True)
            #
            # dp.setDebugMode(True)
            #
            inpPath = os.path.join(self.__testFilePath,
                                   self.__testSpecialPosition)
            dp.imp(inpPath)
            dp.op("annot-dcc-special-position")
            dp.expLog("special-position2.log")
            dp.exp("special-position-output2.log")
            f = open("special-position-output2.log", "r")
            lines = f.read()
            f.close()
            self.assertIn(
                "Error: Wrong occupancy of 1.00 for atom (O : id=D_HOH_1)",
                lines)
            dp.cleanup()
        except Exception as e:
            logger.exception("Failing with %s", str(e))
            self.fail()
 def testPisaAnalysisCif(self):
     """
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         cifPath = os.path.join(self.__testFilePath, self.__testFileCifPisa)
         dp.imp(cifPath)
         dp.addInput(name="pisa_session_name", value="session_test_cif")
         dp.op("pisa-analysis")
         dp.expLog("pisa-anal-cif.log.gz")
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
 def cif2Pdbx(self, inpPath, outPath):
     """CIF -> PDBx conversion  (public subset with PDBid conversion)"""
     try:
         dp = RcsbDpUtility(tmpPath=self.__sessionPath, siteId=self.__siteId, verbose=self.__verbose, log=self.__lfh)
         dp.imp(inpPath)
         dp.op("cif2pdbx-public")
         logPath = os.path.join(self.__sessionPath, "annot-cif2pdbx.log")
         dp.expLog(logPath)
         dp.exp(outPath)
         if not self.__debug:
             dp.cleanup()
     except:  # noqa: E722 pylint: disable=bare-except
         traceback.print_exc(file=self.__lfh)
         return False
     #
     return True
 def testAnnotSecondaryStructure(self):
     """  Calculate secondary structure for a complicated case where pro-motif will fail.
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         of = "annot-ss-" + self.__testFileAnnotSS + ".gz"
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         inpPath = os.path.join(self.__testFilePath, self.__testFileAnnotSS)
         dp.imp(inpPath)
         dp.op("annot-secondary-structure")
         dp.expLog("annot-secondary-structure.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
 def rcsb2PdbxWithPdbId(self, inpPath, outPath):
     """RCSB CIF -> PDBx conversion  (converting to PDB ID entry/datablock id.)"""
     try:
         dp = RcsbDpUtility(tmpPath=self.__sessionPath, siteId=self.__siteId, verbose=self.__verbose, log=self.__lfh)
         dp.imp(inpPath)
         dp.op("annot-rcsb2pdbx-withpdbid")
         logPath = os.path.join(self.__sessionPath, "annot-rcsb2pdbx.log")
         dp.expLog(logPath)
         dp.exp(outPath)
         if not self.__debug:
             dp.cleanup()
     except:  # noqa: E722 pylint: disable=bare-except
         traceback.print_exc(file=self.__lfh)
         return False
     #
     return True
 def testAnnotValidation(self):
     """  Calculate geometrical validation -
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         of = "annot-validation-" + self.__testFileAnnotValidate + ".gz"
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         inpPath = os.path.join(self.__testFilePath, self.__testFileAnnotValidate)
         dp.imp(inpPath)
         dp.op("annot-validation")
         dp.expLog("annot-validation.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
 def testAnnotLinkSSBond(self):
     """  Calculate link and ss-bond features -
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         of = "annot-link-" + self.__testFileAnnotLink + ".gz"
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         inpPath = os.path.join(self.__testFilePath, self.__testFileAnnotLink)
         dp.imp(inpPath)
         dp.op("annot-link-ssbond")
         dp.expLog("annot-link-ssbond.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
Exemple #19
0
    def convert_em_volume(self, in_em_volume, out_binary_volume, working_dir):

        logging.info("Converting EM maps to binary cif")
        logging.debug(working_dir)
        rdb = RcsbDpUtility(tmpPath=working_dir,
                            siteId=self.__site_id,
                            verbose=True)
        rdb.imp(in_em_volume)
        rdb.op("em-density-bcif")
        rdb.exp(out_binary_volume)
        rdb.cleanup()

        if out_binary_volume:
            if os.path.exists(out_binary_volume):
                return True
        return False
 def testAnnotRepositionSolventPlusDerived(self):
     """  Calculate distant solvent followed by computing key derived categories --
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         of = "annot-reposition-add-derived-" + self.__testFileAnnotSolvent
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         inpPath = os.path.join(self.__testFilePath, self.__testFileAnnotSolvent)
         dp.imp(inpPath)
         dp.op("annot-reposition-solvent-add-derived")
         dp.expLog("annot-reposition-solvent-plus-derived.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
Exemple #21
0
 def testPisaAnalysisPdb(self):
     """ """
     logger.info("\nStarting")
     try:
         dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                            siteId=self.__siteId,
                            verbose=True)
         pdbPath = os.path.join(self.__testFilePath, self.__testFilePdbPisa)
         dp.imp(pdbPath)
         dp.addInput(name="pisa_session_name", value="session_3re3_pdb")
         dp.op("pisa-analysis")
         dp.expLog("pisa-anal-pdb.log.gz")
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
 def cif2Pdb(self, inpPath, outPath):
     """CIF -> PDB conversion  (Using the smaller application in the annotation package)"""
     try:
         dp = RcsbDpUtility(tmpPath=self.__sessionPath, siteId=self.__siteId, verbose=self.__verbose, log=self.__lfh)
         dp.imp(inpPath)
         dp.op("annot-cif2pdb")
         logPath = os.path.join(self.__sessionPath, "annot-cif2pdb.log")
         dp.expLog(logPath)
         dp.exp(outPath)
         if not self.__debug:
             dp.cleanup()
     except:  # noqa: E722 pylint: disable=bare-except
         traceback.print_exc(file=self.__lfh)
         return False
     #
     return True
 def testAnnotRcsb2PdbxStrip(self):
     """  RCSB CIF -> PDBx conversion  (Using the smaller application in the annotation package)
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         of = "annot-rcsb2pdbx-strip-" + self.__testFileAnnotRcsb
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         inpPath = os.path.join(self.__testFilePath, self.__testFileAnnotRcsb)
         dp.imp(inpPath)
         dp.op("annot-rcsb2pdbx-strip")
         dp.expLog("annot-rcsb2pdbx-strip.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
 def testAnnotBasePair(self):
     """Calculate base pairing"""
     logger.info("\nStarting")
     try:
         of = "annot-base-pair-" + self.__testFileAnnotNA + ".gz"
         dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                            siteId=self.__siteId,
                            verbose=True)
         inpPath = os.path.join(self.__testFilePath, self.__testFileAnnotNA)
         dp.imp(inpPath)
         dp.op("annot-base-pair-info")
         dp.expLog("annot-base-pair.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
    def testAnnotUpdateDepositorAssembly(self):
        """  Update deposition provided assembly info into model (need better test example)
        """
        logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
        try:
            of = "annot-update-assembly-" + self.__testDepAssembly

            dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
            inpPath = os.path.join(self.__testFilePath, self.__testDepAssembly)
            dp.imp(inpPath)
            dp.op("annot-update-dep-assembly-info")
            dp.expLog("annot-update-dep-assembly.log")
            dp.exp(of)
            dp.cleanup()
        except Exception as e:
            logger.exception("Failing with %s" % str(e))
            self.fail()
 def testPisaAssemblyReportXmlPdb(self):
     """
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         fPath = os.path.join(self.__testFilePath, self.__testFilePdbPisa)
         dp.imp(fPath)
         dp.addInput(name="pisa_session_name", value="session_3re3_cif")
         dp.op("pisa-analysis")
         dp.expLog("pisa-anal-assembly-pdb.log.gz")
         dp.op("pisa-assembly-report-xml")
         dp.exp("pisa-assembly-report-pdb.xml")
         dp.expLog("pisa-report-xml-pdb.log.gz")
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
 def testAnnotRepositionSolvent(self):
     """Calculate distant solvent"""
     logger.info("\nStarting")
     try:
         of = "annot-reposition-" + self.__testFileAnnotSolvent
         dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                            siteId=self.__siteId,
                            verbose=True)
         inpPath = os.path.join(self.__testFilePath,
                                self.__testFileAnnotSolvent)
         dp.imp(inpPath)
         dp.op("annot-reposition-solvent")
         dp.expLog("annot-reposition-solvent.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
 def testAnnotCisPeptide(self):
     """Calculate cis-peptide linkages -"""
     logger.info("\nStarting")
     try:
         of = "annot-link-" + self.__testFileAnnotCisPeptide + ".gz"
         dp = RcsbDpUtility(tmpPath=self.__tmpPath,
                            siteId=self.__siteId,
                            verbose=True)
         inpPath = os.path.join(self.__testFilePath,
                                self.__testFileAnnotCisPeptide)
         dp.imp(inpPath)
         dp.op("annot-cis-peptide")
         dp.expLog("annot-cis-peptide.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()
 def testAnnotConsolidatedTasksWithTopology(self):
     """  Calculate annotation tasks in a single step including supporting topology data.
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         of = "annot-consolidated-top-" + self.__testFileAnnotSS + ".gz"
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         inpPath = os.path.join(self.__testFilePath, self.__testFileAnnotSS)
         dp.imp(inpPath)
         topPath = os.path.abspath(os.path.join(self.__testFilePath, self.__testFileAnnotSSTop))
         dp.addInput(name="ss_topology_file_path", value=topPath)
         dp.op("annot-consolidated-tasks")
         dp.expLog("annot-consolidated-w-top.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()
 def testAnnotSecondaryStructureWithTopology(self):
     """  Calculate secondary structure with a supporting topology file.
     """
     logger.info("\nStarting %s %s\n" % (self.__class__.__name__, sys._getframe().f_code.co_name))
     try:
         of = "annot-ss-with-top-" + self.__testFileAnnotSS + ".gz"
         dp = RcsbDpUtility(tmpPath=self.__tmpPath, siteId=self.__siteId, verbose=True)
         inpPath = os.path.join(self.__testFilePath, self.__testFileAnnotSS)
         dp.imp(inpPath)
         topPath = os.path.abspath(os.path.join(self.__testFilePath, self.__testFileAnnotSSTop))
         dp.addInput(name="ss_topology_file_path", value=topPath)
         dp.op("annot-secondary-structure")
         dp.expLog("annot-secondary-structure-w-top.log")
         dp.exp(of)
         dp.cleanup()
     except Exception as e:
         logger.exception("Failing with %s" % str(e))
         self.fail()