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

Chemical identity comparison for Molecules and Species #1329

Merged
merged 20 commits into from
May 22, 2019

Commits on May 17, 2019

  1. Refactor some class properties using @Property decorator

    More pythonic and prevents extra getter/setter functions from
    cluttering the namespace.
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    3da3c0e View commit details
    Browse the repository at this point in the history
  2. Refactor Molecule SMILES and InChI attributes

    Allow instantiation using either SMILES or InChI
    Change SMILES and InChI to all lowercase for easier typing
    Make smiles and inchi read only properties that generate and
    save the respective identifiers to private attributes
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    db1e492 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    aeaf3b5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3594fc5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    010513e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1b9884b View commit details
    Browse the repository at this point in the history
  7. Add strict argument for isomorphism comparison

    For strict=False, ignores electrons (i.e. bond order, radicals, lone pairs, etc.)
    Only implemented for Molecule isomorphism, exceptions raised in other cases
    For atoms, strict argument is added to the `equivalent` method
    For bonds, strict argument is handled within vf2
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    3d3473f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    da870ca View commit details
    Browse the repository at this point in the history
  9. Remove generate_res argument from Species.isIsomorphic

    Because its functionality is replaced by the strict argument
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    e36c78e View commit details
    Browse the repository at this point in the history
  10. Rename isomorphic_species_lists to same_species_lists

    Also add strict argument which is passed to isIsomorphic
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    4422e9c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f2a2296 View commit details
    Browse the repository at this point in the history
  12. Refactor CERM.checkForExistingSpecies using strict=False isomorphism

    Since this option allows us to compare resonance structures directly,
    we don't need to worry about nonreactive resonance structures or
    aromatic resonance structures.
    
    Also, the return value of checkForExistingSpecies is reduced to
    a single value, since returning whether or not the species
    was found is redundant with returning the species itself.
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    75da1f3 View commit details
    Browse the repository at this point in the history
  13. Refactor product checking in __generateReactions

    No need to ensure species - the reactions will always contain
    Molecules at this point, so either Molecule or Species objects
    are acceptable for the product list to compare with
    
    Aromatic resonance structure generation can be omitted by using
    the strict=False option, which neglects electrons during the
    isomorphism comparison
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    de012ad View commit details
    Browse the repository at this point in the history
  14. Revise test for prod_resonance option for generating reactions

    Remove checks that the product list is converted in place to
    Species objects, since that step was removed
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    9e8a491 View commit details
    Browse the repository at this point in the history
  15. Add strict option to Graph.isMappingValid

    Similar to strict option for isomorphism, setting strict=False
    ignores electrons and bond orders for the comparison, which
    is useful for comparing different resonance structures
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    7b4604e View commit details
    Browse the repository at this point in the history
  16. Add strict argument to isIdentical methods

    Of Molecule, Species, and Reaction, which is passed to Graph.isMappingValid
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    9052975 View commit details
    Browse the repository at this point in the history
  17. Do not generate resonance structures for degeneracy determination

    Instead, use the strict=False option to ignore resonance issues
    
    Change ensure_species to not generate resonance structures by default
    
    Add call to ensure_independent_atom_ids in addReverseAttribute
    because the changes to resonance structure generation means that
    products may not necessarily have proper atom IDs
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    78f8a2d View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    4084b1e View commit details
    Browse the repository at this point in the history
  19. Enable Species instantiation by SMILES or InChI argument

    Add SMILES property and unit tests
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    27baa4e View commit details
    Browse the repository at this point in the history
  20. Fix reaction degeneracy bug with keep_isomorphic argument

    In certain situations, we would call ensure_species with
    keep_isomorphic=False, which would ultimately result in wrong
    degeneracy values.
    
    This fixes that oversight and makes sure that keep_isomorphic=True
    when generating reactions.
    
    A unit test is also added.
    mliu49 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    b3ff5c5 View commit details
    Browse the repository at this point in the history