NMRoss
Gives an approximate 1H NMR when given a smiles or a IUPAC name of a molecule with maximum one aromatic ring and no double bonds.
🧑🔧: Installation
Here are the steps to directly install the nmross package using pip install.
1. Create a Virtual Environment
We advise you to create an environment where you want to work on the project. Then activate the environment:
conda create -n nmross python=3.10
conda activate nmross
2. Install Package
pip install nmross
3. Install JupyterLab
pip install jupyter lab
jupyter lab
👷♂️: Local installation
1. Fork the Repository
First, fork the repository to your own GitHub account. This creates a copy of the repository under your GitHub account.
2. Clone the Repository
Clone the forked repository to your local machine: replace 'your-username' with your username.
git clone https://github.com/your-username/nmross.git
cd nmross
3. Create a Virtual Environment
Create a new virtual environment to keep your dependencies isolated: and activate the environment.
conda create -n nmross python=3.10
conda activate nmross
4. Install dependencies via conda
To avoid any build issues when installing some of the necessary packages for installation, it is easier to install them using conda.
conda install -c conda-forge numpy matplotlib rdkit
5. Install the Package Locally
With the virtual environment activated, install the package locally using 'pip install .': this installs the package that are in the current folder so make sure you are in the environment nmross.
pip install .
6. Install JupyterLab
Install jupyter lab in the nmross environment. You can launch jupyter lab by copying the second line.
pip install jupyter lab
jupyter lab
🧠: Usage
The two main functions of this module are NMR(name : str) and Show(name : str, index : int).
The function NMR takes as an input either the IUPAC name of the compound or the smiles representation of it. This function outputs a plot of the NMR of the molecule and the Mol object of the molecule. The plot appears automatically when using NMR(name), but if needed there is a Mol object that allows to see which atom on the molecule has which index.
The function Show takes as inputs either the IUPAC name of the compound or the smiles representation of it and an index in the molecule. The function outputs a plot of the 1H NMR of the molecule with the peak of the atom chosen hihlighted and a Mol object with all equivalent hydrogens highlighted. The function only ever plots a NMR spectrum if the atom with the index chosen has at least one hydrogen. The plot appears automatically when using the Show() method but the Mol object needs to be stocked in a variable to be shown.
One who only ever wants to know the 1H NMR of ethanol would use the package like this:
from nmross.NMRoss import NMR
plt, mol = NMR('CCO')
mol
One who would like to know which peak is the one of the terminal carbon would use the package like this. First:
from nmross.NMRoss import NMR, Show
plt, mol = NMR('CCO')
mol
The 'mol' code line serves to identify how the program gives the indices to the atoms in the molecule. One of these indices can then be used during the following step. In this case, the terminal carbon is the one that is meant to be identified. Thus, the next steps are:
plt, mol = Show('CCO', 0)
mol
This shows that the primary carbon has hydrogens which are non equivalent to other hydrogens in the molecule.
📖:Tests
To run the tests, one would need to clone the repository as shown above and then simply write the line code below in the terminal. Be aware that you need to change direction in order to be in the correct file.
pip install pytest
pytest
Metadata
Release files for nmross 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nmross-0.0.1.tar.gz | 26.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nmross-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.1 kB
Release files / nmross-0.0.1.tar.gz
| Download URL | nmross-0.0.1.tar.gz |
|---|---|
| Size | 26.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b3374f5f116e53137fe4429a2e052d773928d599e597deade8a41cd1e86f3f9
|
|
BLAKE2b-256 checksum How to use checksums |
0060ae777c8e2691f029d6eef2747b9a25fadcfe6b33dc398d89ba42293ed5ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.14
|
Release files / nmross-0.0.1-py3-none-any.whl
| Download URL | nmross-0.0.1-py3-none-any.whl |
|---|---|
| Size | 20.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
770275e170ed835e848ef0fa46507750028d886c1804c8ece0a66243c64569bf
|
|
BLAKE2b-256 checksum How to use checksums |
26f5197ddf3638df9e113672f6d3dc397d10affb42a6536d64ec7aac0dee0d71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.14
|