makeEnrichmentGraphForPC: Make a graph showing enrichment of a motif within a PC

Description Usage Arguments Value Examples

Description

Applies the minimum hypergeometric test to the current data, and makes a plot where the

Usage

1
makeEnrichmentGraphForPC(PC, binaryData, n_max = 3000, decreasing = F)

Arguments

PC

A named numeric vector representing the k-mer loadings of a PC

binaryData

A named logical vector representing k-mer cognate (T) or non-cognate (F) status for a motif.

n_max

The maximum number of k-mers to consider for each minimum hypergeometric test. Defaults to 3000. Should be no more than about 10% of the number of k-mers.

Value

Returns a list containing the plot (plot), the data.frame used to make the plot (rawData), and the minHG test (minHGTest).

Examples

1
2
3
4
5
6
7
kmerMat = inputKMerFreqs(sprintf("kMerFiles/%s.freq.gz",sampleDesc$id), IDs = sampleDesc$id)
myPCA = doKMerPCA(kmerMat, nPCs = "jackstraw")
treatmentPCs = findDistinguishingPCs(myPCA$rotation[,1:myPCA$nPCs], sampleDesc[c("id","treated")])
tfEnrichmentsPBM = getKMerTFEnrichment(myPCA$rotation[,1:myPCA$nPCs], cisbp$binaryPBMZScores);
tfEnrichmentsPBM = tfEnrichmentsPBM[order(tfEnrichmentsPBM$p),]
tfEnrichmentsPBM = merge(tfEnrichmentsPBM2, cisbp$TFTable[c("Motif_ID","TF_Name")], by="Motif_ID") # add TF names
p = makeEnrichmentGraphForPC(pcs$rotation[,treatmentPCs$PC[1]],cisbp$binaryPBMZScores[,head(tfEnrichmentsPBM$Motif_ID[tfEnrichmentsPBM$PC==treatmentPCs$PC[1] & tfEnrichmentsPBM$direction=="low"],n=1)]) #top motif for top treatment-distinguishing PC for lowly-weighted k-mers

Carldeboer/BrockmanR documentation built on May 31, 2019, 2:19 p.m.