Comments (6)
Hi @ccruizm !
You can create a combined cisTopicObject by merging the count matrices of your samples; for example, you can create the independent cisTopicObjects and then extract the matrices to combine from [email protected]; if needed, you can also extract the metadata from [email protected]. Then you can use the combined matrix as input for createcisTopicObject().
Hope this is useful!
C
from cistopic.
Hello @cbravo93
Thanks for the suggestion. I have merged the matrices, as you suggested. It seems to work, but now I have a problem when I want to plot the tsne and heatmap:
Error in scales::hue_pal(l = 60:100): length(l) == 1 is not TRUE
Traceback:
1. plotFeatures(cisTopicObject, method = "tSNE", target = "cell",
. topic_contr = NULL, colorBy = c("nCounts", "nAcc", "densityClust",
. "orig.ident"), cex.legend = 0.8, factor.max = 0.75, dim = 2,
. legend = TRUE, intervals = 10)
2. .plotFactor(coordinates, variable, feature.names, main = columnName,
. dim = dim, colVars = colVars, plot_ly = plot_ly, legend = legend,
. cex.legend = cex.legend, factor.min = factor.min, factor.max = factor.max,
. cex.dot = cex.dot)
3. setNames(.distinctColorPalette(k = length(levels)), levels)
4. .distinctColorPalette(k = length(levels))
5. t(unique(col2rgb((scales::hue_pal(l = 60:100))(2000))))
6. unique(col2rgb((scales::hue_pal(l = 60:100))(2000)))
7. col2rgb((scales::hue_pal(l = 60:100))(2000))
8. as.character(col) %in% "0"
9. scales::hue_pal(l = 60:100)
10. stopifnot(length(l) == 1)
Error in scales::hue_pal(l = 60:100): length(l) == 1 is not TRUE
Traceback:
1. cellTopicHeatmap(cisTopicObject, method = "Probability", colorBy = c("densityClust"))
2. setNames(.distinctColorPalette(length(unique([email protected][,
. variable]))), as.vector(sort(unique([email protected][, variable]))))
3. .distinctColorPalette(length(unique([email protected][, variable])))
4. t(unique(col2rgb((scales::hue_pal(l = 60:100))(2000))))
5. unique(col2rgb((scales::hue_pal(l = 60:100))(2000)))
6. col2rgb((scales::hue_pal(l = 60:100))(2000))
7. as.character(col) %in% "0"
8. scales::hue_pal(l = 60:100)
9. stopifnot(length(l) == 1)
It seems an issue with the predetermined scale on hue_pal
. Do you know how I could solve this issue? Besides, I would like to use UMAP instead of tsne. Have you implemented it in your tool?
Thanks!
from cistopic.
Would you mind sharing your code for merging the 2 - [email protected] and 2 [email protected] objects? I can try on my end to do the UMAP as well.
from cistopic.
Sure @JBreunig
After creating an independent object for each sample, I extracted the count matrix:
matrix_ctr7d <- [email protected]
matrix_ctr28d <- [email protected]
Then using Seuratv3, I create a SeuratObject
and merge the data, this to append the sampleID to each cell and later, one extract the raw count matrix:
seurat_ctr7d <- CreateSeuratObject(counts = matrix_ctr7d, )
seurat_ctr28d <- CreateSeuratObject(counts = matrix_ctr28d)
control.combined <- merge(seurat_ctr7d, y = seurat_ctr28d, add.cell.ids = c("ctr7d", "ctr28d"))
control.raw.data <- GetAssayData(control.combined, slot = "counts")
With this combined matrix I create a new cisTopicObject
:
cisTopicObject <- createcisTopicObject(control.raw.data, project.name = 'control')
So far, I have not merged the cell.data
generated by cellranger into the object.
My concern its how the peaks are handled by cisTopic since the calling is performed separately on different objects, therefore the peaks do not overlap perfectly, and they might be treated as completely different features. I am having issues plotting tSNE to visually asses what is the contribution of each sample per cluster. I am not expecting a big shift or new clusters after the treatment.
I hope this might help you. I expect to solve the issue with the plotting as well so I can have a look at the handling of the merged matrix by cisTopic.
from cistopic.
Hi @ccruizm !
- The hue_pal error should be solved now, it was related to an update in the scales package.
- There is a wrap function called runUmap to run Umap from a cisTopicObject (on the topic-cell, or the region-topic matrix, you will have to specify).
- For merging the matrices, it would be better if you used the same region set for all data sets before merging (e.g. do peak calling on the aggregate of all samples, or merge/intersect the peaks). If they are the same peak (with different start/end coordinates) they shouldn't be treated as a different feature.
Let me know if you have more questions!
C
from cistopic.
Thank you very much for your help!
from cistopic.
Related Issues (20)
- 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
- sha256sum download failed HOT 1
- Error in metadataFeather(path) : Invalid: Not a feather file HOT 3
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.