fast_forward.cgsmiles module

fast_forward.cgsmiles.cgsmiles_to_mapping(univ, cgsmiles_strs, mol_names, mol_matching=True)[source]

Given a list of mappings described by cgsmiles strings, maps atom indices to CG beads using graph isomorphism.

Parameters:
Return type:

list, list, dict

fast_forward.cgsmiles.find_one_graph_match(graph1, graph2)[source]

Returns one ISMAGS match when graphs are isomorphic, otherwise []. Matches are done based on element and bond order, which is sufficient to also account for charges implicitly via the orders.

Parameters:
Return type:

abc.Iterator

fast_forward.cgsmiles.get_mappings(cg, univ, _match, mappings)[source]

Assigns each coarse CG node a resname and resid based on the all-atom universe. If a bead is split between residues, the resname and resid of the majority of atoms is used.

Parameters:
  • cg (networkx.Graph) – The coarse molecule graph.

  • univ (fast_forward.universe_handler.UniverseHandler) – The universe storing the fine-grained molecule information.

  • _match (dict) – A dict mapping the coarse atoms to fine-grained atoms.

  • mappings (dict[fast_forward.map_file_parser.Mapping]) – A dict of mapping objects.

Returns:

Updated mappings.

Return type:

dict[fast_forward.map_file_parser.Mapping]

fast_forward.cgsmiles.load_cgsmiles_library(filepath)[source]

Given a file that lists cgsmiles strings, read and return them as a list.

Parameters:

filepath (str)

Return type:

list[str]

fast_forward.cgsmiles.remove_explicit_hydrogens(graph)[source]

Returns a subgraph of a molecule sans hydrogen atoms and annotates the number of hydrogen atoms on each remaining node.