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

Human friendly find methods #78

Closed
douweschulte opened this issue Jan 10, 2022 · 2 comments
Closed

Human friendly find methods #78

douweschulte opened this issue Jan 10, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@douweschulte
Copy link
Owner

It would be really nice if a 'human friendly' find method could be built in. This should allow for the selection of all matching hierarchies based on the given information. Every level in the hierarchy should have the option to present no information, the index, or any of the info of that level. An additional variant which gives mutable hierarchies is also useful.

//PDB
pub fn find(&'a self, model: ModelFind, chain: ChainFind, residue: ResidueFind, conformer: ConformerFind, atom: AtomFind) ->
 Vec<AtomConformerResidueChainModel<'a>> {
    //find all matching models and dispatch the find code to those models using their comparable find methods
   //integrate the model info in the resulting hierarchies
}

//eg ModelFind
pub enum ModelFind {
    NoInfo,
    Index(usize),
    SerialNumber(usize),
}
@douweschulte douweschulte added the enhancement New feature or request label Jan 10, 2022
@douweschulte douweschulte self-assigned this Jan 10, 2022
douweschulte added a commit that referenced this issue Jan 15, 2022
@douweschulte
Copy link
Owner Author

With the new implementation the interface is way nicer, many more things are possible, but the definition of terms and searches could be better. I am thinking about a macro like to following, but this should be thought out more.

search!(resname "VAL");
search!(atomser 123 ^ (element "C" & resnum 123));

@douweschulte
Copy link
Owner Author

Also allow for short circuiting to happen at the second term as well as the first. And write tests testing the short circuiting and simplifying behaviour of the code.

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