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

Structure creation by hand #184

Open
theasjblog opened this issue Feb 15, 2019 · 1 comment
Open

Structure creation by hand #184

theasjblog opened this issue Feb 15, 2019 · 1 comment

Comments

@theasjblog
Copy link

Hi,
I am trying to create some structures by hand, and I started from the sample code provided in the documentation:

var structure = new pv.mol.Mol();
var chain = structure.addChain('A');
for (var i = 0; i < 10; ++i) {
var residue = chain.addResidue('ABC', i);
residue.addAtom('X', [i, 0, 0], 'C');
}

This should give a molecule with 10 atoms, but it rather seems to create 10 individual atoms. Is there any way to 'link' atoms?

@Artoria2e5
Copy link

There is a connect in mol.mol, but you need the two atom objects/views to do the connection. There is also a magical deriveConnectivity function in mol.mol that does some bond-guessing by distance, which could work without the objects because it does the guessing for the entire chain.

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

2 participants