compartment_score: Compartment score

View source: R/compartment_score.R

compartment_scoreR Documentation

Compartment score

Description

compartment_score calculates a compartment score per chromosome arm.

Usage

compartment_score(explist, ev = 1, bed = NULL, bedgraph = NULL, ref = 1)

Arguments

explist

Either a single GENOVA contacts object or list of GENOVA contacts.

ev

An integer of length one, indicating which eigenvector to retrieve. Useful in case the first eigenvector does not resemble the compartmentalisation.

bed

A data.frame with 3 columns in BED format, containing peaks of active chromatin marks. Mutually exclusive with the 'bedgraph' argument.

bedgraph

A data.frame with 4 columns in bedGraph format, containing scores correlated with active chromatin. Mutually exclusive with the 'bed' argument.

ref

An integer of length 1 giving a sample index that can be used as a reference. Set to NULL to sign every sample individually.

Details

The produre is based on the algorithm of G. Fudenberg, which performs an eigenvector decomposition of the observed / expected matrix minus one. Centromeres will be skipped.

Value

A CS_discovery object with 1 element.

  • compart_scores, a data.frame with the following columns:

    chrom

    A character with chromosome names.

    start

    An integer with start positions in the chromosome.

    end

    An integer with end positions in the chromosome.

    bin

    An integer giving the index of the genomic position.

    samplename_1

    A numeric, the calculated compartment score for the first 'explist' entry. Column name is eponymous with entries in 'explist'.

    samplename_n (Optional)

    A numeric, the calculated compartment scores for subsequent 'explist' entries.

Resolution recommendation

100kb-150kb. Data with <20kb resolution will return an error due to sparsity.

Note

When the 'bed' or 'bedgraph' arguments are both NULL, the function returns an unsigned CS_discovery object with the attribute 'signed = FALSE'. Signing the compartment scores is necessary to have positive values correspond to more active A compartments and negative values to more inactive B compartments.

See Also

sign_compartmentscore for getting signed compartment scores and appropriate 'bed'. and 'bedgraph' arguments.

Examples

## Not run: 
# Proper compartment scores
cs <- compartment_score(list(WT_100kb, KO_100kb), bed = H3K4me1_peaks)

# Doing the eigenvector decomposition only yields unsigned scores
cs <- compartment_score(list(WT_100kb, KO_100kb))

# Signing the scores
cs <- sign_compartmentscore(cs, bed = H3K4me1_peaks)

## End(Not run)

robinweide/GENOVA documentation built on March 14, 2024, 11:16 p.m.