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

Add metric QC function #78

Merged
merged 21 commits into from
Jul 10, 2024
Merged

Add metric QC function #78

merged 21 commits into from
Jul 10, 2024

Conversation

lahuuki
Copy link
Member

@lahuuki lahuuki commented May 6, 2024

Adding a function to aid/standardize the QC process of new spe objects based off of work in Habenula_Visium, spatial_NAc, and Visium_SPG_AD.

Utilizes scater::isOutlier on three metrics log2(sum_umi), log2(sum_gene), and expr_chrM_ratio*100.
Added functionality for handling spots in_tissue=FALSE .

Copy link
Member

@lcolladotor lcolladotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial PR comments

R/metrics_qc.R Outdated Show resolved Hide resolved
R/metrics_qc.R Outdated
low_n_features = scater::isOutlier(qc_df$log2detected, type = "lower", log = TRUE, batch = qc_df$sample_id),
high_subsets_Mito_percent = scater::isOutlier(qc_df$subsets_Mito_percent, type = "higher", batch = qc_df$sample_id)
) |>
dplyr::mutate(discard = (low_lib_size | low_n_features) | high_subsets_Mito_percent)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not add dplyr as a dependency just for this mutate() function call.

R/metrics_qc.R Outdated
spot_coords <- colData(spe_in) |>
as.data.frame() |>
select(in_tissue, sample_id, array_row, array_col) |>
group_by(sample_id, array_row) |>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see more dplyr function calls here. So maybe we can end up adding it then.

If that's the case, it has to be added to the DESCRIPTION file too.

R/metrics_qc.R Outdated Show resolved Hide resolved
R/metrics_qc.R Outdated Show resolved Hide resolved
Copy link
Member

@lcolladotor lcolladotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge it =)

@lcolladotor lcolladotor merged commit ecf983d into devel Jul 10, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants