Last active
April 20, 2022 04:38
-
-
Save adelenelai/67ab42663ff6a80b69df0d2f3de9599c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"id": "f214cd96", | |
"metadata": {}, | |
"source": [ | |
"# Explore COCONUT MongoDB Locally - Part 2\n", | |
"\n", | |
"https://adelenel.ai/sugarfreecoconut\n", | |
"\n", | |
"## Gist 1 of 3 - What Metadata and Properties are available?\n", | |
"\n", | |
"20/04/2022" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"id": "45895cf6", | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from pymongo import MongoClient" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"id": "e82a3ecc", | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"client = MongoClient('localhost',27017)\n", | |
"db = client.COCONUT_2021_11" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"id": "3751bd63", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"['sourceNaturalProduct',\n", | |
" 'pubFingerprintsCounts',\n", | |
" 'uniqueNaturalProduct',\n", | |
" 'fragment',\n", | |
" 'nPDatabase',\n", | |
" 'quarantined']" | |
] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"db.list_collection_names()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"id": "fba9b6de", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"dict_keys(['_id', 'coconut_id', 'contains_sugar', 'heavy_atom_number', 'inchi', 'inchikey', 'smiles', 'unique_smiles', 'clean_smiles', 'sugar_free_smiles', 'deep_smiles', 'name', 'nameTrustLevel', 'annotationLevel', 'synonyms', 'cas', 'iupac_name', 'contains_ring_sugars', 'contains_linear_sugars', 'collection', 'molecular_formula', 'molecular_weight', 'geoLocation', 'npl_noh_score', 'npl_score', 'npl_sugar_score', 'number_of_carbons', 'number_of_nitrogens', 'number_of_oxygens', 'max_number_of_rings', 'min_number_of_rings', 'sugar_free_heavy_atom_number', 'sugar_free_total_atom_number', 'total_atom_number', 'bond_count', 'found_in_databases', 'xrefs', 'fragments', 'fragmentsWithSugar', 'murko_framework', 'ertlFunctionalFragments', 'ertlFunctionalFragmentsPseudoSmiles', 'pubchemFingerprint', 'pfCounts', 'circularFingerprint', 'extendedFingerprint', 'pubchemBits', 'pubchemBitsString', 'citationDOI', 'taxid', 'textTaxa', 'chemicalSuperClass', 'chemicalClass', 'chemicalSubClass', 'directParentClassification', 'allChemClassifications', 'taxonomyReferenceObjects', 'allTaxa', 'absolute_smiles_sources', 'absolute_smiles', 'allWikidataIds', 'alogp', 'alogp2', 'amralogp', 'apol', 'bcutDescriptor', 'bpol', 'eccentricConnectivityIndexDescriptor', 'fmfDescriptor', 'fsp3', 'fragmentComplexityDescriptor', 'gravitationalIndexHeavyAtoms', 'hBondAcceptorCount', 'hBondDonorCount', 'hybridizationRatioDescriptor', 'kappaShapeIndex1', 'kappaShapeIndex2', 'kappaShapeIndex3', 'manholdlogp', 'petitjeanNumber', 'petitjeanShapeTopo', 'petitjeanShapeGeom', 'lipinskiRuleOf5Failures', 'numberSpiroAtoms', 'vabcDescriptor', 'vertexAdjMagnitude', 'weinerPathNumber', 'weinerPolarityNumber', 'xlogp', 'zagrebIndex', 'topoPSA', 'tpsaEfficiency', '_class'])\n" | |
] | |
} | |
], | |
"source": [ | |
"print(db.uniqueNaturalProduct.find({})[0].keys()) #of a single document in the collection" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3 (ipykernel)", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.9.12" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment