create_score_matrix {Onassis}R Documentation

createScoreMatrix

Description

This functions allows the creation of a score matrix for genomic regions overlapping the genomic regions provided as reference (e.g. promoter regions). Each entry of the matrix corresponds to 1 if the sample represented on the column overlaps the genomic interval represented on the row.

Usage

create_score_matrix(ref_granges, granges_list)

Arguments

ref_granges

An object of type GRanges to be considered as the reference GRanges

granges_list

A list of GRanges, one for each sample, to be mapped on the reference granges

Value

A logical score matrix where the number of rows corresponds to the number of different genomic intervals in the ref_granges object and each column is associated to a Grange in the granges_list. Score(i, j) is set to 1 if the j-th sample has a interval overlapping the one in the i-th row of the reference GRanges.

Examples


granges <- readRDS(system.file('extdata', 'sample_granges.rds', package='Onassis'))
ref_granges <- granges[[1]]

for(i in 2:length(granges)) {
 ref_granges <- GenomicRanges::union(ref_granges, granges[[i]])
}
score_mat <- create_score_matrix(ref_granges, granges)

[Package Onassis version 1.4.5 Index]