CTDFile is a BiocFile subclass representing a
Comparative Toxicogenomics Database (CTD) chemical-gene interactions file
(CTD_chem_gene_ixns.csv or its gzip-compressed .csv.gz form).
Pair it with import to read the file into R following
the Bioconductor BiocIO import/export convention, as an alternative to
the side-effecting import_CTD caching workflow.
In ctdR, CTD always denotes the Comparative
Toxicogenomics Database (https://ctdbase.org). The class is named
CTDFile (not CTD) to avoid confusion with unrelated software
that shares the acronym (the CRAN package CTD is a graph algorithm; the
ctd object in EWCE is a cell-type dataset).
Usage
CTDFile(resource)
# S4 method for class 'CTDFile,ANY,ANY'
import(con, format, text, ...)Arguments
- resource
Character scalar: a local path or a URL to the CTD chemical-gene interactions file.
- con
A
CTDFileobject to import.- format
Ignored; present for compatibility with the BiocIO
importgeneric.- text
Ignored; present for compatibility with the BiocIO
importgeneric.- ...
Additional arguments (currently unused).
Value
CTDFile() returns a CTDFile object. import() on a
CTDFile returns a DataFrame of validated
human (OrganismID 9606) CTD chemical-gene interactions.
Data Licensing Disclaimer
This package does not bundle or redistribute any CTD data. The Comparative Toxicogenomics Database is maintained by NC State University and its data are subject to specific licensing terms. Users are responsible for downloading the data directly from https://ctdbase.org and for complying with the CTD Terms of Service (https://ctdbase.org/about/legal.jsp).
See also
import_CTD for the caching workflow required before
enrichment_CTD; BiocFile for the parent
class.
Examples
sample_file <- system.file(
"extdata", "CTD_chem_gene_ixns_sample.csv",
package = "ctdR"
)
ctd_file <- CTDFile(sample_file)
ctd_file
#> CTDFile object
#> resource: /home/runner/work/_temp/Library/ctdR/extdata/CTD_chem_gene_ixns_sample.csv
interactions <- BiocIO::import(ctd_file)
#> Reading CTD chemical-gene interactions from: /home/runner/work/_temp/Library/ctdR/extdata/CTD_chem_gene_ixns_sample.csv
#> Filtered to 86 human interactions
head(interactions)
#> DataFrame with 6 rows and 11 columns
#> ChemicalName ChemicalID CasRN GeneSymbol GeneID GeneForms
#> <character> <character> <character> <character> <character> <character>
#> 1 Acetaminophen D000082 103-90-2 TNF 7124 gene
#> 2 Acetaminophen D000082 103-90-2 IL6 3569 gene
#> 3 Acetaminophen D000082 103-90-2 TP53 7157 gene
#> 4 Acetaminophen D000082 103-90-2 BRCA1 672 gene
#> 5 Acetaminophen D000082 103-90-2 EGFR 1956 gene
#> 6 Acetaminophen D000082 103-90-2 MYC 4609 gene
#> Organism OrganismID Interaction InteractionActions
#> <character> <character> <character> <character>
#> 1 Homo sapiens 9606 Acetaminophen affect.. increases^expression
#> 2 Homo sapiens 9606 Acetaminophen affect.. increases^expression
#> 3 Homo sapiens 9606 Acetaminophen affect.. decreases^expression
#> 4 Homo sapiens 9606 Acetaminophen affect.. decreases^expression
#> 5 Homo sapiens 9606 Acetaminophen affect.. increases^expression
#> 6 Homo sapiens 9606 Acetaminophen affect.. increases^expression
#> PubMedIDs
#> <character>
#> 1 12345678
#> 2 12345679
#> 3 12345680
#> 4 12345681
#> 5 12345682
#> 6 12345683