Skip to content

lamalab-org/PolyMetriX

Repository files navigation

PolyMetriX

PyPI PyPI - License Documentation Contributor Covenant

PolyMetriX Overview

PolyMetriX is a comprehensive Python library that powers the entire machine learning workflow for polymer informatics. From data preparation to feature engineering, it provides a unified framework for developing structure-property relationships in polymer science.

For more detailed information, see the documentation.

✨ Installing PolyMetriX

Prerequisites

  • Python 3.10 or newer:
pip install polymetrix

For more detailed installation instructions, see the documentation.

Loading Curated Glass Transition Temperature Dataset

# Import necessary modules
from polymetrix.datasets import CuratedGlassTempDataset

# Load the dataset
dataset = CuratedGlassTempDataset()

Getting Features for Polymers

from polymetrix.featurizers.polymer import Polymer
from polymetrix.featurizers.chemical_featurizer import MolecularWeight
from polymetrix.featurizers.sidechain_backbone_featurizer import FullPolymerFeaturizer

# initialize the FullPolymerFeaturizer class with required featurizers
featurizer = FullPolymerFeaturizer(MolecularWeight())

polymer = Polymer.from_psmiles('*CCCCCCNC(=O)c1ccc(C(=O)N*)c(Sc2ccccc2)c1')
result = featurizer.featurize(polymer)

For more detailed usage instructions, see the documentation.

Comparator method for Polymer-Organic Mixtures

from polymetrix.featurizers.polymer import Polymer
from polymetrix.featurizers.molecule import Molecule, FullMolecularFeaturizer
from polymetrix.featurizers.chemical_featurizer import MolecularWeight, NumHBondDonors, NumHBondAcceptors, NumRotatableBonds
from polymetrix.featurizers.sidechain_backbone_featurizer import FullPolymerFeaturizer
from polymetrix.comparator import PolymerMoleculeComparator

# initialize with required featurizers
polymer_featurizer = FullPolymerFeaturizer(MolecularWeight())
molecule_featurizer = FullMolecularFeaturizer(MolecularWeight())

polymer = Polymer.from_psmiles('*CCCCCCNC(=O)c1ccc(C(=O)N*)c(Sc2ccccc2)c1')
molecule = Molecule.from_smiles('CC(=O)OC1=CC=CC=C1C(=O)O')

comparator = PolymerMoleculeComparator(polymer_featurizer, molecule_featurizer)
difference = comparator.compare(polymer, molecule)

For more detailed usage instructions, see the documentation.

How to contribute

We welcome contributions to PolyMetriX! Please refer to the contribution guidelines for more information.