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

Remove duplicated code in cell type module #685

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions modules/classify-celltypes.nf
Original file line number Diff line number Diff line change
Expand Up @@ -129,30 +129,6 @@ workflow annotate_celltypes {
take: sce_files_channel // channel of meta, unfiltered_sce, filtered_sce, processed_sce
main:

// read in sample metadata and make a list of cell line samples; these won't be cell typed
cell_line_samples = Channel.fromPath(params.sample_metafile)
.splitCsv(header: true, sep: '\t')
.map{
[
sample_id: it.scpca_sample_id,
is_cell_line: Utils.parseNA(it.is_cell_line).toBoolean() // FALSE -> false, NA -> false, TRUE -> true
]
}
.filter{it.is_cell_line}
.map{it.sample_id}
.toList()

// branch to cell type the non-cell line libraries only
sce_files_channel_branched = sce_files_channel
.branch{
cell_line: it[0]["sample_id"].split(",").collect{it in cell_line_samples.getVal()}.every()
// only run cell typing on tissue samples
tissue: true
}

// get just the meta and processed sce from the tissue (not cell line) samples
processed_sce_channel = sce_files_channel_branched.tissue.map{[it[0], it[3]]}

// read in sample metadata and make a list of cell line samples; these won't be cell typed
cell_line_samples = Channel.fromPath(params.sample_metafile)
.splitCsv(header: true, sep: '\t')
Expand Down
Loading