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

Alternative Conformation #25

Open
jeleclaire opened this issue Oct 27, 2022 · 1 comment
Open

Alternative Conformation #25

jeleclaire opened this issue Oct 27, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@jeleclaire
Copy link
Collaborator

PDB and Pubchem files often contain alternative location for atom coordinates (or entire conformation). Mechanisms to switch between these alternative conformations are needed e.g., to generate an alternative atoms data frame.
Particularly, interested with regard to the multiple variants present in the Fragment database.

@jeleclaire jeleclaire added the enhancement New feature or request label Oct 27, 2022
@jeleclaire
Copy link
Collaborator Author

for j in eachindex(conformers)
# Note: the atom will be assigned an id in add_atom!
atom = (number=compound.atoms.aid[i],
name="",
element = isnothing(compound.atoms.element)
? Elements.Unknown
: Element(Int(compound.atoms.element[i])),
atomtype = isnothing(compound.atoms.label)
? ""
: compound.atoms.label[i].value, # does the label contain the atom type?
r = T.(conformers[j][i]),
v = Vector3(T(0.), T(0.), T(0.)),
F = Vector3(T(0.), T(0.), T(0.)),
has_velocity = false,
has_force = false,
frame_id = j,
properties = Properties()
)

Pubchem files can consists of several compounds which in turn can comprise several alternative conformations. Alternative conformations are stored in thee coordinates section of the file. Currently, our implementation stores different conformation in a molecule by writing all atom coordinates in the dataframe - conformations are distinguished by setting the field frame_id of the atom tuple to the index of the conformation.

However, in PDB files the frame_id is set to the model number:

atoms.frame_id = orig_df.modelnumber

The model number (or ID) is only available, if all atoms of a structure have an alternative location according to: PDB web site:
In some cases selected residues or parts of residues may have alternate locations as determined by the experiment. Each alternate location of a particular atom is differentiated with a unique Alt ID. For example, the residue number Ser 9 in Chain D in PDB entry 1trz has two atoms, each with alternate IDs A and B. When all the atoms of a structure have multiple locations, they are presented as multiple models and assigned unique Model IDs, often seen in NMR structures (e.g., PDB ID 2kpq).

What exactly should frame_id describe?

const Atom{T} = @NamedTuple begin
number::Int
name::String
element::Element
atomtype::String
r::Vector3{T}
v::Vector3{T}
F::Vector3{T}
has_velocity::Bool
has_force::Bool
frame_id::Int
properties::Properties
end

The different frames of a MD simulation? In this case, I would suggest to add a field conformation_id to the tuple Atom:

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

No branches or pull requests

1 participant