pv
pv copied to clipboard
Inquiry support drawing a path from one residue to another residue
Hi, I am interested in drawing a path from one residue to another residue in the protein structure (as this figure: https://www.nature.com/articles/s41467-022-29331-3/figures/3), can we do that using PV? Thanks very much!
Hello, yes PV can draw and colour tubes / spheres from any points you determine. Most likely you want to select the CA atom of the two residues you need?
There's more information here, https://pv.readthedocs.io/en/v1.8.1/sample-custom-mesh.html
Hi, Thanks for your reply. Can we get a little bit specific, may I know the specific command plotting a line between two residues and highlight?
`const viewer = pv.Viewer(document.getElementById('pv'), { width: window.innerWidth, height: window.innerHeight });
pv.io.fetchPdb('3tdb.pdb',
function (structure) {
// This identifies secondary structure,
// for cartoon representation
mol.assignHelixSheet(structure);
viewer.cartoon('structure', structure);
let s67_atom, p133_atom;
structure.select({cname: 'A', rnum:67, aname: 'CA'})
.eachAtom(function(a)
{ s67_atom = a; });
structure.select({cname: 'A', rnum:133, aname: 'CA'})
.eachAtom(function(a)
{ p133_atom = a; });
let cm = viewer.customMesh('joinTheDots');
cm.addSphere(p133_atom.pos(), 2, { color : 'green' });
cm.addSphere( s67_atom.pos(), 2, { color : 'black' });
cm.addTube(p133_atom.pos(), s67_atom.pos(), .5,
{ cap : true, color : 'grey' });
viewer.fitParent();
viewer.autoZoom();
});`

Thanks so much! I will try it
I want to use React's useEffect to automatically load local pdb format files instead of importing manually, I don't know where the interface is, if it's convenient for you to provide rough code for React
This does not relate to "drawing a path from one residue to another residue"
Hello, yes PV can draw and colour tubes / spheres from any points you determine. Most likely you want to select the CA atom of the two residues you need?
There's more information here, https://pv.readthedocs.io/en/v1.8.1/sample-custom-mesh.html
hello, I have tried it, it's very good! but I can't show a pdb file only including CA atom by PV, actually it can be visit in PyMOL and VMD, so how to resolve it?
Unfortunately the only render mode that will work for CA trace is "spheres". All you can do is replace cartoon, to be viewer.cartoon('structure', structure);