Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)
WOLFRAM LANGUAGE SERVICE CONNECTION

PubChem

Connect to the PubChem API using the Wolfram Language to retrieve information about chemical molecules and their properties.

Connecting & AuthenticatingConnecting & Authenticating

    ServiceConnect["PubChem"] creates a connection to the PubChem API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.

RequestsRequests

    ServiceExecute["PubChem","request",params] sends a request to the connection identified by conn, using parameters params. The following give possible requests.

    Compound Names

    Request:

    "CompoundDescription" get the standard name for one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    MethodNonesearch method
    "InterpretEntities"Falseinterpret each result as a chemical Entity
  • Request:

    "CompoundSynonyms" get other names for one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    MethodNonesearch method
  • List of Compound-Related IDs

    Request:

    "CompoundSID" get a list of all SubstanceIDs associated with one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    "SIDType"None"SubstanceID" type to return
    MethodNonesearch method
  • Request:

    "CompoundAID" get a list of all AssayIDs associated with one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    "AIDType"None"AssayID" type to return
    MethodNonesearch method
  • Request:

    "CompoundCID" get a list of all CompoundIDs associated with one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    "CIDType"None"CompoundID" type to return
    MethodNonesearch method
  • List of Compound Properties

    Request:

    "CompoundProperties" returns properties associated with one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    "Property"Noneone or more properties in a List
    MethodNonesearch method
  • List of Compound Cross-References

    Request:

    "CompoundCrossReferences" returns cross-references associated with one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    "CrossReference"Noneone or more cross-references in a List
    MethodNonesearch method
  • Compound Image

    Request:

    "CompoundImage" get a 2D or 3D image of a single compound

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "ImageType""2D""2D" or "3D"
    "ImageSize"LargeSmall or Large
  • Compound SDF

    Request:

    "CompoundSDF" get the SDF of a single compound

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
  • Only one type of identifier can be used as an input.

    All Compound Records

    Request:

    "CompoundFullRecords" get all the records of one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    "RecordType""2D""2D" or "3D"
    MethodNonesearch method
  • Compound Assay Summary

    Request:

    "CompoundAssaySummary" get the assay summary for one or more compounds

    Parameters:
  • "CompoundID"Noneinteger compound identifier(s)
    "SMILES"NoneSMILES string(s)
    "Name"Nonecompound name(s) or chemical entities
    "InChI"NoneInChI compound identifier(s)
    "InChIKey"NoneInChIKey compound identifier(s)
    "Formula"Nonemolecular formula (only valid with "FormulaSearch" Method)
    MethodNonesearch method
  • Substance Similar Names

    Request:

    "SubstanceSynonyms" get other names for one or more substances

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities
  • List of Substance-Related IDs

    Request:

    "SubstanceCID" get a list of all CompoundIDs associated with one or more substances

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities
    "CIDType"None"CompoundID" type to return
  • Request:

    "SubstanceAID" get a list of all AssayIDs associated with one or more substances

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities
    "AIDType"None"AssayID" type to return
  • Request:

    "SubstanceSID" get a list of all SubstanceIDs associated with one or more substances

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities
    "SIDType"None"SubstanceID" type to return
  • Substance Image

    Request:

    "SubstanceImage" get a 2D or 3D image of the substance

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities
    "ImageSize"Largeeither Small or Large
  • Only one type of identifier can be used as an input.

    Substance SDF

    Request:

    "SubstanceSDF" get the SDF of a single substance

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities
  • Only one type of identifier can be used as an input.

    All Substance Records

    Request:

    "SubstanceFullRecords" get all the records of one or more substances

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities
  • List of Substance Cross-References

    Request:

    "SubstanceCrossReferences" returns cross-references associated with one or more substances

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities
    "CrossReference"Noneone or more cross-references in a List
  • Substance Assay Summary

    Request:

    "SubstanceAssaySummary" get the assay summary for one or more substances

    Parameters:
  • "SubstanceID"Noneinteger substance identifier(s)
    "Name"Nonesubstance name(s) or chemical entities

Parameter detailsParameter details

    Possible values for Method include:
  • "Similarity2DSearch"search by 2D similarity
    "Similarity3DSearch"search by 3D similarity
    "SubstructureSearch"search by substructure
    "SuperstructureSearch"search by superstructure
    "FormulaSearch"search by formula
  • Possible search parameters when using "SubstructureSearch" or "SuperstructureSearch" as Method include:
  • "MatchIsotopes"whether atoms must be of the specified isotope
    "MatchCharges"whether atoms must match the specified charge
    "MatchTautomers"whether to allow match to tautomers of the given structure
    "RingsNotEmbedded"whether rings may not be embedded in a larger system
    "SingleDoubleBondsMatch"whether single or double bonds match aromatic bonds
    "ChainsMatchRings"whether chain bonds in the query may match rings in hits
    "StripHydrogen"whether to remove any explicit hydrogens before searching
    "Stereo"how to handle stereo; one of "Ignore", "Exact", "Relative", "Nonconflicting"
  • Possible search parameter when using "Similarity2DSearch" or "Similarity3DSearch" as Method:
  • "Threshold"minimum Tanimoto score for a hit
  • Possible search parameter when using "FormulaSearch" as Method:
  • "AllowOtherElements"whether to allow other elements to be present in addition to those specified
  • Possible values for "SIDType" in the request "CompoundSID" include:
  • Allall
    "Standardized"standardized
    "Component"component
  • Possible values for "AIDType" in the request "CompoundAID" include:
  • Allall
    "Active"active
    "Inactive"inactive
  • Possible values for "CIDType" in the request "CompoundCID" include:
  • "Original"original
    "Parent"parent
    "Component"component
    "Similar2D"2D similarity
    "Similar3D"3D similarity
    "SameStereo"same stereo
    "SameIsotopes"same isotopes
    "SameConnectivity"same connectivity
    "SameTautomer"same tautomer
    "SameParent"same parent
    "SameParentStereo"same parent stereo
    "SameParentIsotopes"same parent isotopes
    "SameParentConnectivity"same parent connectivity
    "SameParentTautomer"same parent tautomer
  • Possible values for "Property" include:
  • "MolecularFormula"molecular formula
    "MolecularWeight"molecular weight
    "CanonicalSMILES"canonical SMILES
    "IsomericSMILES"includes stereo information
    "InChI"standard InChI
    "InChIKey"InChI key
    "IUPACName"IUPAC name
    "XLogP"XLogP
    "ExactMass"exact mass
    "MonoisotopicMass"monoisotopic mass
    "TPSA"topological polar surface area
    "Complexity"complexity
    "Charge"charge
    "HBondDonorCount"hydrogen bond donor count
    "HBondAcceptorCount"hydrogen bond acceptor count
    "RotatableBondCount"rotatable bond count
    "HeavyAtomCount"number of non-hydrogen atoms
    "IsotopeAtomCount"number of atoms with enriched isotope(s)
    "AtomStereoCount"total number of atoms with tetrahedral (sp3) stereo
    "DefinedAtomStereoCount"defined atoms stereo count
    "UndefinedAtomStereoCount"undefined atoms stereo count
    "BondStereoCount"total number of bonds with planar (sp2) stereo
    "DefinedBondStereoCount"defined bond stereo count
    "UndefinedBondStereoCount"undefined bond stereo count
    "CovalentUnitCount"covalent unit count
    "Volume3D"volume 3D
    "XStericQuadrupole3D"X steric quadrupole in 3D
    "YStericQuadrupole3D"Y steric quadrupole in 3D
    "ZStericQuadrupole3D"Z steric quadrupole in 3D
    "FeatureCount3D"total number of 3D features
    "FeatureAcceptorCount3D"number of acceptor 3D features
    "FeatureDonorCount3D"number of donor 3D features
    "FeatureAnionCount3D"number of anion 3D features
    "FeatureCationCount3D"number of cation 3D features
    "FeatureRingCount3D"number of ring 3D features
    "FeatureHydrophobeCount3D"number of hydrophobe 3D features
    "ConformerModelRMSD3D"RMSD of all conformers in the 3D model
    "EffectiveRotorCount3D"number of effective rotors
    "ConformerCount3D"number of conformers in the 3D model
    "Fingerprint2D"2D fingerprint bits (base64 encoded)
  • Possible values for "CrossReference" include:
  • "RegistryID"external registry identifier
    "RN"registry number
    "PubMedID"NCBI PubMed identifier
    "MMDBID"NCBI MMDB identifier
    "DBURL"external database home page URL
    "SBURL"external database substance URL
    "ProteinGI"NCBI protein GI
    "NucleotideGI"NCBI nucleotide GI
    "TaxonomyID"NCBI taxonomy identifier
    "MIMID"NCBI MIM identifier
    "GeneID"NCBI gene identifier
    "ProbeID"NCBI probe identifier
    "PatentID"patent identifier
    "SourceName"external depositor name
    "SourceCategory"depositor category or categories
  • Possible values for "CIDType" in the request "SubstanceCID" include:
  • Allall
    "Standardized"standardized
    "Component"component
  • Possible values for "AIDType" in the request "SubstanceAID" include:
  • Allall
    "Active"active
    "Inactive"inactive
  • Possible values for "SIDType" in the request "SubstanceSID" include:
  • "Original"original
    "SameExact"exact
    "SameStereo"same stereo
    "SameIsotopes"same isotopes
    "SameConnectivity"same connectivity
    "SameTautomer"same tautomer
    "SameParent"same parent
    "SameParentStereo"same parent stereo
    "SameParentIsotopes"same parent isotopes
    "SameParentConnectivity"same parent connectivity
    "SameParentTautomer"same parent tautomer

ExamplesExamplesopen allclose all

Basic Examples  (5)Basic Examples  (5)

Create a new connection:

In[1]:=
Click for copyable input
Out[1]=

Get PubChem's standard name for a given compound:

In[2]:=
Click for copyable input
Out[2]=

Identify a list of compounds:

In[3]:=
Click for copyable input
Out[3]=

Find compounds by name:

In[4]:=
Click for copyable input
Out[4]=

Search compounds by substructure:

In[1]:=
Click for copyable input
Out[1]=

Search by superstructure:

In[2]:=
Click for copyable input
Out[2]=

Get detailed properties of compounds:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Get a 3D model of a given compound:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Find synonyms for compounds:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Retrieve substance IDs associated with a given compound:

In[1]:=
Click for copyable input
Out[1]=

Get an image of a given substance:

In[2]:=
Click for copyable input
Out[2]=

Get a complete record for a given substance:

In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=