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

Filter to annotated cells #59

Closed
mfansler opened this issue Sep 7, 2022 · 0 comments · Fixed by #70
Closed

Filter to annotated cells #59

mfansler opened this issue Sep 7, 2022 · 0 comments · Fixed by #70
Labels
enhancement New feature or request
Milestone

Comments

@mfansler
Copy link
Collaborator

mfansler commented Sep 7, 2022

In cases of reanalyzing published data, it may be preferable to filter to only annotated cells. This could be especially helpful in large datasets that may already exclude cells for poor QC metrics.

There's a TODO note here:

## Load MTXs Function
load_mtx_to_sce <- function (mtxFile, bxFile, txFile, sample_id) {
## TODO: Add annotation-based filtering
## valid_cells <- filter(df_annots, sample_id == sample_id) %$% cell_id
readMM(mtxFile) %>%
as("CsparseMatrix") %>%
`dimnames<-`(list(
cell_id=str_c(sample_id, "_", read_lines(bxFile)),
transcript_id=read_lines(txFile))) %>%
t %>%
{ .[, colSums(.) >= as.integer(snakemake@params$min_umis)] } %>%
optional_hdf5_convert() %>%
{ SingleCellExperiment(assays=list(counts=.),
colData=DataFrame(cell_id=colnames(.),
sample_id=sample_id,
row.names=colnames(.))) }
}

@mfansler mfansler added the enhancement New feature or request label Aug 4, 2023
mfansler added a commit that referenced this issue Oct 25, 2023
@mfansler mfansler modified the milestones: 1.0.0, 0.4.0 Oct 25, 2023
@mfansler mfansler mentioned this issue Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant