CTD (indra.sources.ctd)

This module implements an API and processor to extract INDRA Statements from the Comparative Toxicogenomics Database (CTD), see http://ctdbase.org/. It currently extracts chemical-gene, gene-disease, and chemical-disease relationships. In particular, it extracts the curated (not inferred) and directional/causal relationships from these subsets.

CTD API (indra.sources.ctd.api)

indra.sources.ctd.api.process_dataframe(df, subset)[source]

Process a subset of CTD from a DataFrame into INDRA Statements.

Parameters
  • df (pandas.DataFrame) – A DataFrame of the given CTD subset.

  • subset (str) – A CTD subset, one of chemical_gene, chemical_disease, gene_disease.

Returns

A CTDProcessor which contains INDRA Statements extracted from the given CTD subset as its statements attribute.

Return type

CTDProcessor

indra.sources.ctd.api.process_from_web(subset, url=None)[source]

Process a subset of CTD from the web into INDRA Statements.

Parameters
  • subset (str) – A CTD subset, one of chemical_gene, chemical_disease, gene_disease.

  • url (Optional[str]) – If not provided, the default CTD URL is used (beware, it usually gives permission denied). If provided, the given URL is used to access a tsv or tsv.gz file.

Returns

A CTDProcessor which contains INDRA Statements extracted from the given CTD subset as its statements attribute.

Return type

CTDProcessor

indra.sources.ctd.api.process_tsv(fname, subset)[source]

Process a subset of CTD from a tsv or tsv.gz file into INDRA Statements.

Parameters
  • fname (str) – Path to a tsv or tsv.gz file of the given CTD subset.

  • subset (str) – A CTD subset, one of chemical_gene, chemical_disease, gene_disease.

Returns

A CTDProcessor which contains INDRA Statements extracted from the given CTD subset as its statements attribute.

Return type

CTDProcessor

CTD Processor (indra.sources.ctd.processor)

class indra.sources.ctd.processor.CTDChemicalDiseaseProcessor(df)[source]

Processes chemical-disease relationships from CTD.

class indra.sources.ctd.processor.CTDChemicalGeneProcessor(df)[source]

Processes chemical-gene relationships from CTD.

class indra.sources.ctd.processor.CTDGeneDiseaseProcessor(df)[source]

Processes gene-disease relationships from CTD.

class indra.sources.ctd.processor.CTDProcessor(df)[source]

Parent class for CTD relation-specific processors.