-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
…/blob/56c67e7c0421e6dcf71fe2db6ef2c7b62ed15e58/code/05_harmony_BayesSpace/02-compute_QC_metrics.R#L68-L128 Co-authored-by: Leonardo Collado Torres <lcolladotor@gmail.com>
There was a problem hiding this 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
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) |
There was a problem hiding this comment.
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) |> |
There was a problem hiding this comment.
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.
There was a problem hiding this 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 =)
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 metricslog2(sum_umi)
,log2(sum_gene)
, andexpr_chrM_ratio*100
.Added functionality for handling spots
in_tissue=FALSE
.