Example #1
0
def main():
    """Calcualting an ACV from the command line

    Notes
    -----
    Run with:
    >>> fretraj -i <input pdb> -p <label parameter file (.json)> -s <label position identifier>
    """
    in_filePDB, param_fileJSON, site, out_fileACV = parseCmd()
    labels = cloud.labeling_params(param_fileJSON)
    struct = md.load_pdb(in_filePDB)
    print("Calculating accessible-contact volume...")
    av = cloud.Volume(struct, site, labels)
    if not out_fileACV:
        out_fileACV = "ACV.pdb"
    _, out_fileextACV = os.path.splitext(out_fileACV)
    out_path = os.path.dirname(os.path.abspath(out_fileACV))
    av.save_acv(out_fileACV, format=out_fileextACV[1:])
    print(f"{out_fileACV} saved to {out_path}")
Example #2
0
    def computeACV(self):
        """
        Create a cloud.Volume object at the specified label position.
        If the GUI is run as a PyMOL plugin, the ACV will be rendered in the current window
        """
        self.update_labelDict()
        msg = "Busy..."
        self.statusBar().showMessage(msg, 3000)
        param_filename = "{}/{}_parameters.json".format(
            self.settings["root_path"], self.fileName_pdb[:-4])
        cloud.save_labels(param_filename, self.labels)
        self.av[self.labelName] = cloud.Volume(self.struct, self.labelName,
                                               self.labels)
        if self.av[self.labelName].acv is None:
            msg = "ACV could not be calculated!"
            self.statusBar().showMessage(msg, 3000)
            print(msg)
        else:
            av_name = self.fileName_pdb[:-4] + "-" + self.labelName.replace(
                "'", "p")
            av_filename = "{}/{}.pdb".format(self.settings["root_path"],
                                             av_name)
            self.av[self.labelName].save_acv(av_filename, format="pdb")

            self.addLabelToList(self.av[self.labelName])
            msg = "ACV successfully calculated!"
            self.statusBar().showMessage(msg, 3000)
            if self._pymol_running:
                cmd.delete("{}*".format(av_name))
                cmd.load(av_filename)
                self.doubleSpinBox_contourValue.setEnabled(True)
                self.spinBox_bfactor.setEnabled(True)
                self.spinBox_gaussRes.setEnabled(True)
                self.doubleSpinBox_gridBuffer.setEnabled(True)
                self.checkBox_transparentAV.setEnabled(True)
                self.pymol_update_isosurface()
                cmd.zoom(self.fileName_pdb[:-4])
            self.define_DA()
Example #3
0
 def test_attachID_buried(self, create_labels, load_structure):
     create_labels['Position']['Cy3']['attach_id'] = 158
     vol = cloud.Volume(load_structure, 'Cy3', create_labels)
     assert vol.acv is None
Example #4
0
 def test_stateframe_outofrange(self, create_labels, load_structure):
     create_labels['Position']['Cy3']['state'] = 2
     create_labels['Position']['Cy3']['frame_mdtraj'] = 1
     vol = cloud.Volume(load_structure, 'Cy3', create_labels)
     assert vol.acv is None
Example #5
0
 def test_volume_pythononly(self, create_labels, load_structure):
     vol = cloud.Volume(load_structure, 'Cy3', create_labels)
     assert hasattr(vol.acv, 'mp')
Example #6
0
 def test_volume_LabelLib(self, create_labels, load_structure):
     create_labels['Position']['Cy3']['use_LabelLib'] = True
     vol = cloud.Volume(load_structure, 'Cy3', create_labels)
     assert hasattr(vol.acv, 'mp')
Example #7
0
def create_volumes(create_labels, load_structure):
    vol_Cy3 = cloud.Volume(load_structure, 'Cy3', create_labels)
    vol_Cy5 = cloud.Volume(load_structure, 'Cy5', create_labels)
    return vol_Cy3, vol_Cy5