This project aims to generate molecular structures based on a given list of atoms, using constraint programming. It adheres to essential chemical constraints, such as atomic valencies and distances between atoms, to create viable molecules. The project is developed in Java and utilizes the Choco solver.
Follow these steps to set up the project:
-
Clone the Repository:
git clone https://github.com/Paulpey13/chemical_molecule_generation.git
-
Install Dependencies: à remplir à la fin (install requirements.txt)
Mettre comment utiliser le programme (à la fin)
- Constraint-Based Generation: Harnesses constraint programming to ensure the generation of chemically valid structures.
- JMol Integration: Utilizes JMol for sophisticated 3D visualization of the molecular structures.
- Automated Instance & Experience Creation: Features classes like
InstanceMaker
andExperienceMaker
for automated generation and analysis of molecular structures. - CML Output: Structures are output in Chemical Markup Language (CML), ensuring compatibility with a wide range of molecular visualization tools.
This section provides a detailed overview of each class in the project, explaining their purpose and functionality within the molecular structure generation system.
Purpose: Represents an individual atom in a molecule.
- Key Attributes:
type
: Specifies the type of the atom (e.g., Carbon, Hydrogen).bonds
: A collection of bonds that this atom forms with other atoms.
- Key Methods:
addBond()
: Adds a bond to another atom.validateValency()
: Ensures that the atom's valency rules are not violated.
Purpose: Manages the indexing and retrieval of atoms in a molecule.
- Key Methods:
getIndex(Atom atom)
: Retrieves the index of a given atom.getAtom(int index)
: Retrieves an atom based on its index.
Purpose: Stores and manages permissible distances between different types of atoms.
- Key Methods:
getMinDistance(AtomType a, AtomType b)
: Retrieves the minimum permissible distance between two atom types.getMaxDistance(AtomType a, AtomType b)
: Retrieves the maximum permissible distance between two atom types.
Purpose: Converts the internal molecular structure representation into Chemical Markup Language (CML) format.
- Key Methods:
generateCML()
: Generates a CML representation of the current molecular structure.
Purpose: Represents the molecular structure as a graph.
- Key Methods:
addAtom(Atom atom)
: Adds an atom to the graph.addBond(Atom a, Atom b)
: Adds a bond between two atoms in the graph.
Purpose: Serves as the entry point of the application.
- Key Methods:
main()
: Initializes the application and starts the molecular structure generation process.
Purpose: Provides visualization capabilities for the generated molecular structures.
- Key Methods:
visualizeStructure()
: Generates a visual representation of the molecular structure.
Purpose: Handles the logic for modeling the molecular structure based on given constraints.
- Key Methods:
modelMolecule()
: Models a molecule based on specified constraints and atom types.
Purpose: Provides utility functions for operations on molecules.
- Key Methods:
calculateMolecularWeight()
: Calculates the molecular weight of the given molecule.
Purpose: Automates the creation of molecular structure instances for testing and analysis.
- Key Methods:
generateInstance()
: Generates a new instance of a molecular structure based on specified parameters.
Purpose: Facilitates the execution of multiple instances of molecular structure generation for performance analysis and testing.
- Key Methods:
runExperiences()
: Runs multiple instances of molecular structure generation and aggregates the results.
Each class is designed to encapsulate specific functionality and to interact with other classes in a cohesive manner, ensuring a modular and maintainable codebase.
The project requires the following dependencies:
- Java Development Kit (JDK) for running Java applications.
- JMol for molecular structure visualization.
- Choco Solver for constraint programming.
Ensure these are properly installed and configured before running the project.
Refer to the examples
folder for sample input files and their corresponding output structures. This can provide a good starting point for understanding how to structure your input files.
- Manon Girard
- Romain Durand
- Paul Peyssard
- Supervised by Nicolas Prcovic
This project is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License