calculate_transcript_mc: Motif Enrichment calculation

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

C++ implementation of Motif Enrichment calculation

Usage

1
2
3
4
5
6
7
8
9
calculate_transcript_mc(
  absoluteHits,
  totalSites,
  relHitsForeground,
  n,
  maxPermutations,
  minPermutations,
  e
)

Arguments

absoluteHits

number of putative binding sites per sequence (returned by score_transcripts)

totalSites

number of potential binding sites per sequence (returned by score_transcripts)

relHitsForeground

relative number of hits in foreground set

n

number of sequences in the foreground set

maxPermutations

maximum number of foreground permutations performed in Monte Carlo test for enrichment score

minPermutations

minimum number of foreground permutations performed in Monte Carlo test for enrichment score

e

stop criterion for enrichment score Monte Carlo test: aborting permutation process after observing e random enrichment values with more extreme values than the actual enrichment value

Value

list with p-value and number of iterations of Monte Carlo sampling for foreground enrichment

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
foreground_seqs <- c("CAGUCAAGACUCC", "AAUUGGUUGUGGGGCUUCCCUGUACAU",
                     "AGAU", "CCAGUAA", "UGUGGGG")
background_seqs <- c(foreground_seqs, "CAACAGCCUUAAUU", "CUUUGGGGAAU",
                     "UCAUUUUAUUAAA", "AUCAAAUUA", "GACACUUAAAGAUCCU",
                     "UAGCAUUAACUUAAUG", "AUGGA", "GAAGAGUGCUCA",
                     "AUAGAC", "AGUUC")
motif_db <- get_motif_by_id("M178_0.6")
fg <- score_transcripts(foreground_seqs, cache = FALSE,
  motifs = motif_db)
bg <- score_transcripts(background_seqs, cache = FALSE,
  motifs = motif_db)

mc_result <- calculate_transcript_mc(unlist(bg$absolute_hits),
 unlist(bg$total_sites),
 fg$df$absolute_hits / fg$df$total_sites,
 length(foreground_seqs), 1000, 500, 5)

transite documentation built on Nov. 8, 2020, 5:27 p.m.