Beispiel #1
0
    def rvapi_shutdown(self, amopt):
        """Return any results to jscofe
        
        Parameters
        ----------
        amopt : dict
            AMPLE results dictionary with all information
        """
        rvdoc = amopt['rvapi_document']
        if not rvdoc: return
        work_dir = amopt['work_dir']

        # Create dictionary we're going to return
        meta = {'first_tab_id': self.summary_tab_id, 'results': []}

        nresults = 0
        if 'mrbump_results' in amopt and amopt['mrbump_results']:
            mrb_results = amopt['mrbump_results']
            nresults = min(3, len(mrb_results))
        if nresults > 0:
            root = os.path.join(work_dir, "..")
            for fdata in mrbump_util.ResultsSummary(
                    mrb_results[:nresults]).topFiles(nresults):
                # Mangle paths
                fdata['pdb'] = os.path.relpath(root, fdata['pdb'])
                fdata['mtz'] = os.path.relpath(root, fdata['mtz'])
                meta['results'].append(fdata)
        # Commit to file
        logger.debug("Exporting pyrvapi metadata:\n{0}".format(meta))
        pyrvapi.rvapi_put_meta(json.dumps(meta))
        pyrvapi.rvapi_store_document2(rvdoc)
        return
Beispiel #2
0
 def storeReportDocument(self, meta_str):
     if not self.rvapi_doc_path:
         self.rvapi_doc_path = "rvapi_document"
     if meta_str:
         pyrvapi.rvapi_put_meta(meta_str)
     pyrvapi.rvapi_store_document2(self.rvapi_doc_path)
     return
Beispiel #3
0
    def rvapi_shutdown(self, amopt):
        """Return any results to jscofe

        Parameters
        ----------
        amopt : dict
            AMPLE results dictionary with all information
        """
        rvdoc = amopt['rvapi_document']
        if not rvdoc:
            return

        # Create dictionary we're going to return
        meta = {'results': []}
        nresults = 0
        if bool(amopt.get('mrbump_results')):
            mrb_results = amopt['mrbump_results']
            nresults = min(3, len(mrb_results))
        if nresults > 0:
            for fdata in mrbump_util.ResultsSummary(
                    mrb_results[:nresults]).topFiles(nresults):
                # Mangle paths. relpath assumes args are directories so need to add ..
                fdata['pdb'] = self.fix_path(fdata['pdb'])
                fdata['mtz'] = self.fix_path(fdata['mtz'])
                meta['results'].append(fdata)

        # Commit to file
        logger.debug("Exporting pyrvapi metadata:\n{0}".format(meta))
        pyrvapi.rvapi_put_meta(json.dumps(meta))
        pyrvapi.rvapi_store_document2(rvdoc)
        return
Beispiel #4
0
    def rvapi_shutdown(self, amopt):
        """Return any results to jscofe

        Parameters
        ----------
        amopt : dict
            AMPLE results dictionary with all information
        """
        rvdoc = amopt['rvapi_document']
        if not rvdoc:
            return

        # Create dictionary we're going to return
        meta = {'results' : []}
        nresults = 0
        if bool(amopt.get('mrbump_results')):
            mrb_results = amopt['mrbump_results']
            nresults = min(3, len(mrb_results))
        if nresults > 0:
            for fdata in mrbump_util.ResultsSummary(mrb_results[:nresults]).topFiles(nresults):
                # Mangle paths. relpath assumes args are directories so need to add ..
                fdata['pdb'] = self.fix_path(fdata['pdb'])
                fdata['mtz'] = self.fix_path(fdata['mtz'])
                meta['results'].append(fdata)

        # Commit to file
        logger.debug("Exporting pyrvapi metadata:\n{0}".format(meta))
        pyrvapi.rvapi_put_meta(json.dumps(meta))
        pyrvapi.rvapi_store_document2(rvdoc)
        return
Beispiel #5
0
 def write_meta(self):
     self.output_meta["report_row"] = self.page_cursor[1]
     meta = json.dumps(self.output_meta, indent=2)
     with open(os.path.join(self.workdir, "ccp4go.meta.json"), "w") as f:
         f.write(meta)
     if self.rvapi_doc_path:
         pyrvapi.rvapi_put_meta(meta)
         pyrvapi.rvapi_store_document2(self.rvapi_doc_path)
     return
Beispiel #6
0
 def store(self):
     pyrvapi.rvapi_put_meta(self.meta)
     pyrvapi.rvapi_store_document2(self._html_fname)
Beispiel #7
0
 def save_document(self):
     pyrvapi.rvapi_put_meta(self.rvapi_meta.to_json())
     pyrvapi.rvapi_store_document2(self.rvapi_document)
     pyrvapi.rvapi_keep_polling(True)
Beispiel #8
0
 def save_document(self):
     pyrvapi.rvapi_put_meta(self.rvapi_meta.to_json())
     pyrvapi.rvapi_store_document2(self.rvapi_document)
     pyrvapi.rvapi_keep_polling(True)