def plot_dih(self, sel="protein", data=None): """Creates a plot of the standard deviation of the dihedral angles of the protein by macrostate """ from htmd.projections.metricdihedral import MetricDihedral dih_metric = MetricDihedral(protsel=sel) aux_plot(self.model, self.mol, plot_dihedral, metric=dih_metric, data=data, skip=self.skip, method=np.std, save=self.out_folder + "/{}.png".format(self.plot_dihedral), chain_id="P1", start_index=self.start_index)
def sasa_variation(self): from htmd.projections.metricsasa import MetricSasa labels = generate_labels(self.mol) mol_contact_map_metric = MetricSasa(sel='protein', probeRadius=1.4, numSpherePoints=500, mode='residue') mapping = mol_contact_map_metric.getMapping(self.mol) aux_plot(self.model, self.mol, plot_contacts, metric=mol_contact_map_metric, normalize=False, skip=self.skip, method=np.mean, mod=self.model, title="Contacts by residue", vmax=None, plot=False, save=f'{self.out_folder}/no_sasa_test.png')
def plot_contact_map(self, name, selection="noh and protein", data=None, threshold=4): """Generate a residue-residue contact plot by macrostate given a VMD selection Parameters ---------- name : str Output name for the generated plot selection : str, optional VMD selection to create a matrix contact plot threshold : int, optional Threshold distance in angstrom to discrinate contact vs no-contact """ from htmd.projections.metricdistance import MetricDistance contact_metric = MetricDistance(sel1=selection, sel2=selection, groupsel1="residue", groupsel2="residue", threshold=threshold, metric="contacts") mapping = contact_metric.getMapping(self.mol) aux_plot(self.model, self.mol, contact_plot, metric=contact_metric, skip=self.skip, method=np.mean, mapping=mapping, cols=2, rows=int(self.model.macronum/2)+self.model.macronum%2, data=data, plot=False, save=f"{self.out_folder}/{name}.png")
def plot_mol_contact(self, data=None, sel1="noh and protein", sel2="noh and resname MOL", threshold=4): """Plot a molecule-residue contact map. Parameters ---------- sel1 : str, optional VMD selection. Grouped by residue. sel2 : str, optional VMD selection threshold : int, optional Threshold distance in angstrom to discrinate contact vs no-contact """ from htmd.projections.metricdistance import MetricDistance # labels = generate_labels(self.mol) mol_contact_map_metric = MetricDistance(sel1=sel1, sel2=sel2, groupsel1="residue", groupsel2="all", threshold=5, metric="contacts") # mapping = mol_contact_map_metric.getMapping(self.mol) aux_plot(self.model, self.mol, plot_contacts, metric=mol_contact_map_metric, skip=self.skip, method=np.mean, title="Contacts by residue", data=data, plot=False, save=f'{self.out_folder}/{self.plot_mol_contacts}.png')
def plot_atom_mol_contact(self, data=None, sel1="noh and protein", sel2="noh and resname MOL", threshold=5): """Plot a molecule-residue contact map. Parameters ---------- sel1 : str, optional VMD selection. Grouped by residue. sel2 : str, optional VMD selection threshold : int, optional Threshold distance in angstrom to discrinate contact vs no-contact """ from htmd.projections.metricdistance import MetricDistance label = ['M{}-{}%'.format(i, np.round(percent*100, 2)) for i, percent in enumerate(self.model.eqDistribution(plot=False))] mol_contact_map_metric = MetricDistance(sel1=sel1, sel2=sel2, groupsel1="residue", threshold=threshold, metric="contacts") mapping = mol_contact_map_metric.getMapping(self.mol) aux_plot(self.model, self.mol, contact_plot_by_atom, metric=mol_contact_map_metric, skip=self.skip, method=np.mean, data=data, mapping=mapping, label=label, save=f'{self.out_folder}/{self.plot_mol_contacts}_by_atom.png')