-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Mye-InfoBank/solo-batchwise
Improve doublet removal
- Loading branch information
Showing
9 changed files
with
109 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
process DEDOUBLET_ADATA { | ||
tag "${meta.id}" | ||
container "bigdatainbiomedicine/sc-rpy:1.0" | ||
|
||
label "process_medium" | ||
|
||
input: | ||
tuple val(meta), path(adata) | ||
tuple val(meta2), path(solo) | ||
|
||
output: | ||
tuple val(meta), path("${meta.id}.dedup.h5ad") | ||
|
||
script: | ||
""" | ||
#!/opt/conda/bin/python | ||
import pandas as pd | ||
import anndata as ad | ||
adata = ad.read_h5ad("${adata}") | ||
solo = pd.read_pickle("${solo}") | ||
# Keep only cells with "singlet" in the "doublet_label" column | ||
adata = adata[solo["doublet_label"] == "singlet", :] | ||
# Save the AnnData object | ||
adata.write_h5ad("${meta.id}.dedup.h5ad") | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
include { SOLO } from "../modules/solo.nf" | ||
include { DEDOUBLET_ADATA as DEDOUBLET_INTEGRATIONS } from "../modules/dedoublet_adata.nf" | ||
include { DEDOUBLET_ADATA as DEDOUBLET_RAW } from "../modules/dedoublet_adata.nf" | ||
include { EXTRACT_EMBEDDING } from "../modules/extract_embedding.nf" | ||
|
||
|
||
workflow DOUBLETS { | ||
take: | ||
ch_hvgs | ||
ch_scanvi_model | ||
ch_integrations | ||
ch_raw | ||
ch_batches | ||
|
||
main: | ||
SOLO( | ||
ch_hvgs, | ||
ch_scanvi_model, | ||
ch_batches | ||
) | ||
|
||
DEDOUBLET_INTEGRATIONS( | ||
ch_integrations, | ||
SOLO.out | ||
) | ||
|
||
EXTRACT_EMBEDDING(DEDOUBLET_INTEGRATIONS.out) | ||
|
||
DEDOUBLET_RAW( | ||
ch_raw, | ||
SOLO.out | ||
) | ||
|
||
emit: | ||
solo = SOLO.out | ||
integrations = DEDOUBLET_INTEGRATIONS.out | ||
raw = DEDOUBLET_RAW.out | ||
obsm = EXTRACT_EMBEDDING.out | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.