Skip to content

Commit

Permalink
Included @scwatts's suggestions for using existing functions to extra…
Browse files Browse the repository at this point in the history
…ct cancer_type information from info column in samplesheet
  • Loading branch information
rhassaine committed Jan 28, 2025
1 parent b505f6b commit 15288f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
15 changes: 5 additions & 10 deletions lib/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ class Utils {
info_data[info_field_enum] = v
}

}
// Added cancer type to metamap
if (info_data.containsKey(Constants.InfoField.CANCER_TYPE)) {
meta[Constants.InfoField.CANCER_TYPE] = info_data[Constants.InfoField.CANCER_TYPE]
log.info "Added cancer type to meta: ${meta[Constants.InfoField.CANCER_TYPE]}"
}

// Process
if (info_data.containsKey(Constants.InfoField.CANCER_TYPE)) {
meta[Constants.InfoField.CANCER_TYPE] = info_data[Constants.InfoField.CANCER_TYPE]
}

// Handle inputs appropriately
Expand Down Expand Up @@ -405,12 +406,6 @@ class Utils {
return meta.getOrDefault([Constants.SampleType.NORMAL, Constants.SequenceType.DNA], [:])
}

// New method to return the doid of the cancer_type provided by user
static public getCancerType(meta) {
return meta.getOrDefault(Constants.InfoField.CANCER_TYPE, null)
}


// Sample names
static public getTumorDnaSampleName(meta) {
return getTumorDnaSample(meta)['sample_id']
Expand Down
5 changes: 1 addition & 4 deletions modules/local/orange/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ process ORANGE {
def isofox_gene_distribution_arg = isofox_gene_distribution ? "-isofox_gene_distribution ${isofox_gene_distribution}" : ''
def isofox_alt_sj_arg = isofox_alt_sj ? "-isofox_alt_sj_cohort ${isofox_alt_sj}" : ''

// def doid_arg = meta.cancer_type ? "-primary_tumor_doids \"${meta.cancer_type}\"" : "-primary_tumor_doids 162"
// log.info "${meta}"
def doid_arg = meta.containsKey("cancer_type") ? meta.cancer_type : "162"
// log.info "Primary tumor DOID: ${doid_arg}"
def doid_arg = meta.cancer_type ?: "162"

"""
echo "${pipeline_version_str}" > pipeline_version.txt
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/orange_reporting/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ workflow ORANGE_REPORTING {
key: meta.group_id,
id: meta.group_id,
tumor_id: Utils.getTumorDnaSampleName(meta),
cancer_type: Utils.getCancerType(meta),
// cancer_type: Utils.getCancerType(meta),
cancer_type: meta[Constants.InfoField.CANCER_TYPE],
]

def inputs_selected = inputs.clone()
Expand Down

0 comments on commit 15288f9

Please sign in to comment.