File: substance.rst

package info (click to toggle)
python-pubchempy 1.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 388 kB
  • sloc: python: 1,377; makefile: 147
file content (34 lines) | stat: -rw-r--r-- 1,722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.. _substance:

Substance
=========

The PubChem Substance database contains all chemical records deposited in PubChem in their most raw form, before any
significant processing is applied. As a result, it contains duplicates, mixtures, and some records that don't make
chemical sense. This means that Substance records contain fewer calculated properties, however they do have additional
information about the original source that deposited the record.

The PubChem Compound database is constructed from the Substance database using a standardization and deduplication
process. Hence each Compound may be derived from a number of different Substances.

Retrieving substances
---------------------

Retrieve Substances using the :func:`~pubchempy.get_substances` function::

    >>> results = pcp.get_substances('Coumarin 343', 'name')
    >>> print results
    [Substance(24864499), Substance(85084977), Substance(126686397), Substance(143491255), Substance(152243230), Substance(162092514), Substance(162189467), Substance(186021999), Substance(206257050)]


You can also instantiate a Substance directly from its SID::

    >>> substance = pcp.Substance.from_sid(223766453)
    >>> print substance.synonyms
    ['2-(Acetyloxy)-benzoic acid', '2-(acetyloxy)benzoic acid', '2-acetoxy benzoic acid', '2-acetoxy-benzoic acid', '2-acetoxybenzoic acid', '2-acetyloxybenzoic acid', 'BSYNRYMUTXBXSQ-UHFFFAOYSA-N', 'acetoxybenzoic acid', 'acetyl salicylic acid', 'acetyl-salicylic acid', 'acetylsalicylic acid', 'aspirin', 'o-acetoxybenzoic acid']
    >>> print substance.source_id
    BSYNRYMUTXBXSQ-UHFFFAOYSA-N
    >>> print substance.standardized_cid
    2244
    >>> print substance.standardized_compound
    Compound(2244)