Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Azimuth override w/ my previous preprocessing results (percent.mt differs after running Azimuth) #246

Open
yi6kim opened this issue Nov 16, 2024 · 0 comments

Comments

@yi6kim
Copy link

yi6kim commented Nov 16, 2024

Hi,

First of all, thanks for creating this amazing package.
I have one question. It seems that running Azimuth overrides my previous preprocessing results (such as SCTransform) and alters my gene expression matrix, and I want to understand what's going on under the hood of the RunAzimuth() function. For instance, when I check the maximum value of percent mitochondrial RNA (max(df[['percent.mt']])) before and after running Azimuth, the value always seems to increase after. My understanding is that RunAzimuth() uses the original RNA counts (the 'RNA' layer in my Seurat object) and runs SCTransform internally, but does it attach a new 'SCT' layer on my Seurat object, which would potentially override my previous 'SCT' layer?

Here is my typical analysis workflow (simplified), with the intention to use Azimuth soley for the cell annotation purposes:

df <- Read10X_h5('my_sample.h5')
df <- CreateSeuratObject(counts = df,
min.cells = 3,
min.features = 200
)

df <- subset(df, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 & percent.mt < 7) # Here, I filter the cells and set the "maximum" allowed percent.mt as 7.

df <- SCTransform(df, verbose = FALSE) # alternative to NormalizeData, FindVariableFeatures, ScaleData
df <- RunPCA(df)
df <- FindNeighbors(df, dims=1:20)
df <- FindClusters(df, algorithm= 1, resolution = 0.4)
df <- RunUMAP(df, dims=1:20)

max(df[['percent.mt]]) # I check the maximum mito % value right before running Azimuth, making sure they are less than 7.

6.995033

df <- RunAzimuth(df, reference = 'bonemarrowref')
max(df[['percent.mt]]) # The maximum mito % becomes larger after RunAzimuth(), even larger than what the object 'df' has been filtered previously

8.015861

What's going on here? Thanks in advance.

@yi6kim yi6kim changed the title Does Azimuth overrides previous preprocessing (percent.mt differs after running Azimuth) Does Azimuth override previous preprocessing results (percent.mt differs after running Azimuth) Nov 16, 2024
@yi6kim yi6kim changed the title Does Azimuth override previous preprocessing results (percent.mt differs after running Azimuth) Does Azimuth override w/ my previous preprocessing results (percent.mt differs after running Azimuth) Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant