Comments (3)
Hi Tim,
The unnormalized cell assignments throughtout the sampling iterations are stored in [email protected]$document_expects; while the corresponding unnormalized region assignments are stored in [email protected]$topics. I have added this to the selectModel() and the cisTopic class documentation.
For normalising cell assignments you can do:
#Z-score
norm_assig <- scale([email protected]$document_expects, center=TRUE, scale=TRUE)
#Probability
alpha <- [email protected][['runModels']]$alpha/length([email protected]$topic_sums)
norm_assig <- apply([email protected]$document_sums, 2, function(x) {(x + alpha)/sum(x + alpha)})
For normalising the regions, you can take a look to getRegionsScores(). The normalised topic scores for each region will be stored in [email protected] then.
Hope this is helpful!
from cistopic.
The document expects and topics are null. Code and results are shown below. Data is from Buenrostro 2018 and downloaded from https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE96769
library(cisTopic)
countsMM = Matrix::readMM("scATACseq_counts2.txt")
cellNames = scan("cellNames2.txt", what = character())
head(cellNames)
categories = c("HSC", "MPP", "LMPP", "CMP", "CLP", "MEP", "GMP", "MCP", "mono", "UNK", "pDC")
matchCategory <- function(s, categories){
for(k in categories){
if(grepl(toString(k), s)){
return(k)
}
}
return("NA")
}
cellTypes = sapply(cellNames, function(s) matchCategory(toString(s), categories))
counts = as.matrix(countsMM)
dim(counts)
rows2keep = which(rowSums(counts) > 10)
counts = counts[rows2keep, ]
cells2keep = which(colSums(counts) > 50)
counts = counts[ ,cells2keep]
cellTypes = cellTypes[cells2keep]
dim(counts)
colnames(counts) = 1:dim(counts)[2]
peaks = read.table("GSE96769_PeakFile_20160207.bed")
peaks = peaks[rows2keep, ]
rownames(counts) = paste0(peaks[,1], ":", peaks[,2], "-", peaks[,3])
cisTopicObject = createcisTopicObject(count.matrix = counts, project.name='test')
counts.cisTopics = runModels(cisTopicObject, topic=17, nCores=1, burnin = 250, iterations = 500, addModels=FALSE)
summary([email protected]$topics)
Length Class Mode
0 NULL NULL
summary([email protected])
Length Class Mode
0 NULL NULL
[email protected]
NULL
[email protected]$document_expects
NULL
[email protected]$topics
NULL
from cistopic.
Hi Tim,
You need to run selectModel first to fill the selected.model slot.
counts.cisTopics <- selectModel(counts.cisTopics)
Otherwise, since you only have a model, you can find it in counts.cisTopics@models.
from cistopic.
Related Issues (20)
- cistopic object to archR HOT 1
- maximal median size of population peaks HOT 1
- Question about createcisTopicObject HOT 1
- installation issue with ubuntu 20.04 HOT 3
- possibility to use BAM files from bulk ChIP HOT 1
- annotateRegions with own dataset HOT 1
- createcisTopicObject and genomic coordinates incompatibility error HOT 3
- input from fragments.tsv.gz? HOT 1
- Installation issue HOT 2
- Tutorial Dataset files HOT 1
- tSNE Clustering Thresholds HOT 1
- LDA run with Python and LogLikelihhod HOT 1
- How can I run cisTopic in R 4.0 HOT 2
- Ununsed Arguement error in cisTopic/TcisTarget HOT 1
- cisTopicObject <- selectModel(cisTopicObject) Error in .Call("rs_createGD") : C symbol name "rs_createGD" not in load table HOT 1
- Unused argument error while running topicsRcisTarget
- add cisTopic output to Seurat object? HOT 1
- Running Cistopic HOT 1
- Installation error "Failed to install 'unknown package' from Github: ..." HOT 1
- Loading Multiome data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cistopic.