Atom selection questions
See original GitHub issueHi all, I have a question. We want to apply representations to specific water atoms. We currently select the atoms like this
atoms: (atomIds) => {
return query.struct.generator.atomGroups({
'atom-test': query.core.set.has([
query.core.type.set(atomIds),
query.ammp('id')
])
});
},
However this ends up slowing down our browser a lot (freezes the tab on my computer).
We compared it to this which ends up being much much faster even if we select the exact same atoms.
water: () => molstar.SelectionQueries.water.expression,
Is there any reason why index atom selections are so much slower than expressions? I would have assumed they would be faster since molstar would not have to search for what is water.
Also one more question. Is molstar 1-indexing atoms? I initially selected atoms with 0-based index but it always missed the last atom, then I switched to 1-based indexing, but then we found some sdf file where the 1-based index doesn’t work either.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Atomic Structure Examples of Multiple Choice Questions 1.
Which of the following has a positive charge? (a) proton: (b) neutron: (c) anion: (d) electron: (e) atom. 2. Rutherford carried out experiments...
Read more >Sample Test Problems
The atom decays to a lower state by emitting a photon. Find the possible photon energies that may be observed. Give your answers...
Read more >Atom Selection — CHARMM v35b1 documentation
Selection based on atom properties The token LONE selects all lone pairs (based on a mass selection). The token HYDRogen selects all hydrogens...
Read more >1355 questions with answers in ATOMS | Science topic
Explore the latest questions and answers in Atoms, and find Atoms experts. ... Same situation happens with selection tool and "atom selection option...
Read more >Atom selection language - MDAnalysis User Guide
AtomGroups can be created by selecting atoms using the MDAnalysis atom selection language: In [1]: import MDAnalysis as mda In [2]: from ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The performance issue is fixed in 2.2.2.
Using
sourceIndex()
vsammp('id')
:ammp('id')
(which is shorthand forstruct.atomProperty.macromolecular.id()
) is the value of the_atom_site.id
column in mmCIF (the 2nd column in the PDB file). This is usually 1-based index of the atom in the file)struct.atomProperty.core.sourceIndex()
is zero-based index of the ATOM/HETATM record as it appears in the input file.Indexing works like a charm! Will need to test now 2.2.2. Thanks a lot!