pv icon indicating copy to clipboard operation
pv copied to clipboard

Inquiry support drawing a path from one residue to another residue

Open juexinwang opened this issue 3 years ago • 9 comments
trafficstars

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!

juexinwang avatar Nov 15 '22 19:11 juexinwang

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

awaterho avatar Nov 16 '22 09:11 awaterho

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?

juexinwang avatar Nov 16 '22 12:11 juexinwang

`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();
    });`

awaterho avatar Nov 16 '22 13:11 awaterho

image

awaterho avatar Nov 16 '22 13:11 awaterho

Thanks so much! I will try it

juexinwang avatar Nov 16 '22 15:11 juexinwang

image

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

heyigacu avatar Nov 30 '22 18:11 heyigacu

This does not relate to "drawing a path from one residue to another residue"

mizuchi3 avatar Nov 30 '22 20:11 mizuchi3

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?

heyigacu avatar Dec 11 '22 12:12 heyigacu

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);

awaterho avatar Dec 12 '22 08:12 awaterho