Package 'slideimp.extra'

Title: slideimp Package Helpers
Description: Contains helper functions for the slideimp package. These functions handle the pathing, download the Illumina Methylation manifests, clean them, and store the cleaned objects locally.
Authors: Hung Pham [aut, cre]
Maintainer: Hung Pham <[email protected]>
License: MIT + file LICENSE
Version: 0.6.8
Built: 2026-06-03 06:45:17 UTC
Source: https://github.com/hhp94/slideimp.extra

Help Index


Clear Cached Manifests

Description

Removes cleaned manifest files from the slideimp data directory.

Usage

clear_cache(chip = NULL, verbose = TRUE, ask = TRUE)

Arguments

chip

Character string specifying which chip's cache to clear, or NULL to clear all cached manifests. Default is NULL.

verbose

Logical. Print messages. Default is TRUE.

ask

Ask for permission to download or delete the cache. Default is TRUE.

Value

Invisibly returns a character vector of deleted paths.

Examples

## Not run: 
clear_cache("EPICv2")
clear_cache()

## End(Not run)

De-duplicate Matrix

Description

The EPICv2 and MSA chips can return duplicated CpG names. This function de-duplicate the beta matrix.

Usage

dedup_matrix(obj, chip, method = c("mean", "median"), verbose = TRUE)

Arguments

obj

A numeric matrix with unique column and row names.

chip

Either "MSA", "EPICv2", or a data.frame with IlmnID and Name columns.

method

Aggregation method for duplicates: "mean" or "median".

verbose

Logical; if TRUE, print informative messages.

Value

A de-duplicated matrix.


Retrieve Cleaned Illumina Methylation Manifest

Description

Retrieves the cleaned manifest for the specified Illumina methylation array chip. If not already cleaned, it downloads the raw manifest, applies the appropriate cleaning function, and stores the result as an .fst file.

Usage

get_manifest(
  chip = NULL,
  rawdir = NULL,
  force = FALSE,
  clean_up = FALSE,
  ask = TRUE,
  verbose = TRUE
)

Arguments

chip

The name of the Illumina methylation chip. If NULL, then all available options are returned

rawdir

Directory where raw manifest files are downloaded and stored. Defaults to NULL (a temporary directory).

force

Forces re-download and re-cleaning of the manifest. Default to FALSE.

clean_up

deletes the raw manifest file after cleaning. Useful if rawdir is not a temporary folder. Default to FALSE.

ask

Ask for permission to download or delete the cache. Default is TRUE.

verbose

prints messages. Default is TRUE.

Value

The path to the cleaned manifest file as a character string, or invisible(NULL) if the chip is invalid.

Examples

## Not run: 
get_manifest("450K")

## End(Not run)

Get Path for slideimp Data

Description

Retrieves the path to the slideimp data directory.

Usage

get_slideimp_path(create = FALSE)

Arguments

create

Logical. If TRUE, creates the directory if it doesn't exist and checks writability. Default is FALSE.

Details

The path is determined by:

  1. Environment variable SLIDEIMP (if set)

  2. Base R default via tools::R_user_dir("slideimp", "data")

To override permanently, add to your ⁠~/.Renviron⁠ (i.e., file.edit("~/.Renviron")):

SLIDEIMP="/your/custom/path"

To override temporarily, use set_slideimp_path().

Value

A character string with the normalized path.

Examples

get_slideimp_path()

Load Illumina Methylation Manifest Data

Description

Loads the cleaned manifest data for a specified Illumina methylation array chip, returning a unique data.frame with feature identifiers and their corresponding chromosomal groups.

Usage

ilmn_manifest(
  chip = NULL,
  deduped = FALSE,
  rawdir = NULL,
  force = FALSE,
  clean_up = FALSE,
  ask = TRUE,
  verbose = TRUE,
  ...
)

Arguments

chip

The name of the Illumina methylation chip. If NULL, then all available options are returned

deduped

Use deduplicated probe names for EPICv2 and MSA chips (TRUE) or IlmnID (FALSE). Default is FALSE.

rawdir

Directory where raw manifest files are downloaded and stored. Defaults to NULL (a temporary directory).

force

Forces re-download and re-cleaning of the manifest. Default to FALSE.

clean_up

deletes the raw manifest file after cleaning. Useful if rawdir is not a temporary folder. Default to FALSE.

ask

Ask for permission to download or delete the cache. Default is TRUE.

verbose

prints messages. Default is TRUE.

...

Additional arguments passed to fst::read_fst() for reading the cleaned file.

Value

A data.frame() with columns "feature" (probe identifiers) and "group" (chromosomal locations), or invisible(NULL) if the chip is invalid.

Examples

ilmn_manifest()

## Not run: 
ilmn_manifest("EPICv2")

## End(Not run)

Set Path for slideimp Data

Description

Sets the slideimp data directory path for the current R session.

Usage

set_slideimp_path(path)

Arguments

path

Character string specifying the directory path, or NULL to reset to default.

Value

Invisibly returns NULL.

Examples

# default path
get_slideimp_path()

# set path for this session
set_slideimp_path("test")
get_slideimp_path()

# reset to default
set_slideimp_path(NULL)
get_slideimp_path()

Supported Illumina DNA methylation microarray platforms

Description

A character vector of Illumina Infinium BeadChip microarrays supported by the slideimp package. These are the microarrays used for genome-wide DNA methylation profiling.

Usage

slideimp_arrays

Format

slideimp_arrays

A character vector with 6 elements:

EPICv2

Infinium MethylationEPIC v2.0 BeadChip

MSA

Infinium Methylation Screening Array (MSA-48)

EPICv2_deduped

EPICv2 with duplicated CpG probes collapsed

MSA_deduped

MSA with duplicated CpG probes collapsed

EPICv1

Infinium MethylationEPIC v1.0 BeadChip

450K

Infinium HumanMethylation450 BeadChip

Details

The vector includes both the original microarrays and their "deduped" variants. For EPICv2_deduped and MSA_deduped, duplicated CpG probes (which appear multiple times in the official Illumina manifest for the same CpG site) have been collapsed into a single representative entry. This is a standard preprocessing step when working with EPICv2 and MSA data.

Manifest files and versions used to build/support these microarrays:

The ⁠_deduped⁠ microarrays are derived from the above manifests (no separate public download).

Source

Illumina official manifest files (see @details for exact links and versions used).