Load CMap data (if not found, file will be automatically downloaded)

loadCMapData(
  file,
  type = c("metadata", "geneInfo", "zscores", "compoundInfo"),
  zscoresID = NULL
)

Arguments

file

Character: path to file

type

Character: type of data to load (metadata, geneInfo, zscores or compoundInfo)

zscoresID

Character: identifiers to partially load z-scores file (for performance reasons; if NULL, all identifiers will be loaded)

Value

Metadata as a data table

Note

If type = "compoundInfo", two files from The Drug Repurposing Hub will be downloaded containing information about drugs and perturbations. The files will be named file with _drugs and _samples before their extension, respectively.

Examples

# Load CMap metadata (data is automatically downloaded if not available)
cmapMetadata <- loadCMapData("cmapMetadata.txt", "metadata")
#> Loading CMap metadata from cmapMetadata.txt...

# Load CMap gene info
loadCMapData("cmapGeneInfo.txt", "geneInfo")
#> cmapGeneInfo.txt not found: downloading data...
#> Extracting cmapGeneInfo.txt.gz...
#> Loading CMap gene information from cmapGeneInfo.txt...
#>        pr_gene_id pr_gene_symbol
#>             <int>         <char>
#>     1:        780           DDR1
#>     2:       7849           PAX8
#>     3:       2978         GUCA1A
#>     4:       2049          EPHB3
#>     5:       2101          ESRRA
#>    ---                          
#> 12324:       4034          LRCH4
#> 12325:     399664          MEX3D
#> 12326:      54869         EPS8L1
#> 12327:      90379         DCAF15
#> 12328:         60           ACTB
#>                                                              pr_gene_title
#>                                                                     <char>
#>     1:                         discoidin domain receptor tyrosine kinase 1
#>     2:                                                        paired box 8
#>     3:                                      guanylate cyclase activator 1A
#>     4:                                                     EPH receptor B3
#>     5:                                     estrogen related receptor alpha
#>    ---                                                                    
#> 12324: leucine-rich repeats and calponin homology (CH) domain containing 4
#> 12325:                                   mex-3 RNA binding family member D
#> 12326:                                                         EPS8 like 1
#> 12327:                                  DDB1 and CUL4 associated factor 15
#> 12328:                                                         actin, beta
#>        pr_is_lm pr_is_bing
#>           <int>      <int>
#>     1:        1          1
#>     2:        1          1
#>     3:        0          0
#>     4:        0          1
#>     5:        0          1
#>    ---                    
#> 12324:        0          1
#> 12325:        0          1
#> 12326:        0          1
#> 12327:        0          1
#> 12328:        0          1
if (FALSE) {
# Load CMap zscores based on filtered metadata
cmapMetadataKnockdown <- filterCMapMetadata(
  cmapMetadata, cellLine="HepG2",
  perturbationType="Consensus signature from shRNAs targeting the same gene")
loadCMapData("cmapZscores.gctx.gz", "zscores", cmapMetadataKnockdown$sig_id)
}