Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inquiry support drawing a path from one residue to another residue #194

Open
juexinwang opened this issue Nov 15, 2022 · 9 comments
Open

Comments

@juexinwang
Copy link

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!

@awaterho
Copy link

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

@juexinwang
Copy link
Author

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?

@awaterho
Copy link

`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
Copy link

image

@juexinwang
Copy link
Author

Thanks so much! I will try it

@heyigacu
Copy link

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

@mizuchi3
Copy link

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

@heyigacu
Copy link

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?

@awaterho
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants