GithubHelp home page GithubHelp logo

PeakSeuratFromTransfer about sierra HOT 7 CLOSED

vccri avatar vccri commented on May 28, 2024
PeakSeuratFromTransfer

from sierra.

Comments (7)

rj-patrick avatar rj-patrick commented on May 28, 2024

From the output, it looks like the cell barcodes from the Sierra workflow don't match the cell barcodes in the Seurat object. This is probably due to a discrepancy in the sample labels appended to the cell barcode - e.g. CCAAAGAC-1 from one pipeline and CCAAAGAC-conditionA from another. If you've aggregated multiple experiments together just check that the exp.labels variable in AggregatePeakCounts matches what is in the Seurat object.

I've added an extra check to print a more meaningful error message in this situation.

from sierra.

JBreunig avatar JBreunig commented on May 28, 2024

That fixed it! Congrats on a very cool piece of work.

Just a warning other users, the change was the addition of a "-1" at the end of the cellname/barcode so "[barcode]-1". And it was on the Sierra processing side. So I just added the same "-1" to the end of the barcodes on the Seurat side.

from sierra.

nbahlis avatar nbahlis commented on May 28, 2024

Hi JBreunig

Did you have an aggregate seurat object? Can you kindly share the script you used to correct the "-1" addition. thank you

from sierra.

rj-patrick avatar rj-patrick commented on May 28, 2024

Hi @nbahlis,

I might be able to make a change to the code if this is an ongoing issue. Would you be able to provide some more detail on your data and problem? Are you comparing runs merged with the CellRanger aggr program to the Sierra AggregatePeakCounts function?

from sierra.

JBreunig avatar JBreunig commented on May 28, 2024

No, it wasn't an aggregate object. The Seurat object didn't have the "-1" but I added it to match the Sierra elements

This was all I did:

genes.seuratJB_data <- Read10X(data.dir = "/[my local dir]/neuron_9k_filtered_gene_bc_matrices/filtered_gene_bc_matrices/mm10")

genes.seuratJB_data #to check input

colnames(genes.seuratJB_data) #to check column names

colnames(genes.seuratJB_data) <- paste0(colnames(genes.seuratJB_data),"-1") #add "-1" to match

genes.seuratJB <- CreateSeuratObject(counts = genes.seuratJB_data)

.

from sierra.

nbahlis avatar nbahlis commented on May 28, 2024

thank you for the quick reply. I merged 2 cellranger objects with Seurat after importing their h5 matrices as such and created a Seurat object as such:

h5.matrices <- sapply(input.h5, Read10X_h5)
seurat.matrices <- sapply(h5.matrices, CreateSeuratObject, min.cells = 3, min.features = 200)
for(i in 1:length(seurat.matrices)){ seurat.matrices[[i]]@meta.data$orig.ident <- sample.names[[i]]}
MM.merge <- merge(seurat.matrices[[1]], seurat.matrices[2:length(seurat.matrices)])

followed the seurat pipeline and filtered unwanted cells (different lineage, contaminants), after SCTransform saved object as rds.

In SIERRA, I corrected the "-1" issue in the barcodes and the barcodes now match.
I do import my seurat object to sierra as readRDS:

P1675_P1608_seurat <- readRDS('/MM.merge.rds')

followed by

peaks.seurat <- PeakSeuratFromTransfer(peak.data = peak.counts,
genes.seurat = P1675_P1608_seurat,
annot.info = peak.annotations,
min.cells = 0, min.peaks = 0)

In my peaks.seurat object I do not see any on the metadata and id I had in my seurat object are imported into the peaks.seurat object. Only the UMAP dims are imported. Is there a way to keep or import all the metadata I had stored in my seurat rds object?

For example my peaks,seurat @metadata looks like this:

[email protected]
orig.ident nCount_RNA nFeature_RNA geneLvlID
AAACCCAGTGGCTTGC-1_2 PolyA 24666 5348 2
AAACGAAGTGGCGTAA-1_2 PolyA 41474 8216 0

Note that the orig.ident is also changed from my seurat object.

from sierra.

rj-patrick avatar rj-patrick commented on May 28, 2024

Hi @nbahlis,

Ah okay, we have been following the CellRanger aggr format for adding experiment identifiers to the barcodes, I believe the Seurat merge function is a little different.

Regarding the meta data, you can add additional info to the peaks object using the Seurat AddMetaData function. The following commands will add all meta data from your original Seurat object.

md <- [email protected][colnames(peaks.seurat), ]
peaks.seurat <- AddMetaData(peaks.seurat, md)

Thanks for the feedback, I will make some adjustments to increase flexibility around the barcode identifiers and including additional data from the original Seurat object.

Cheers,

Ralph

from sierra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.