Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,17 @@ process {
]
]
}

withName: SIGPROFILERASSIGNMENTINDELS {
ext.context_type = "ID" // define context as ID only when running with this call of the module
publishDir = [
[
mode: params.publish_dir_mode,
path: { "${params.outdir}/signatures/sigprofilerassignment" },
pattern: "**{txt,pdf}",
]
]
}

withName: HDPREASSIGNMENT {
publishDir = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,26 @@ process SIGPROFILERASSIGNMENT_COSMIC_FIT {


script:
def name = "${meta.id}.${type}"
def assembly = task.ext.genome_assembly ?: "GRCh38"

def context_type = task.ext.context_type ?: "96" // "96", "288", "1536", "DINUC", and "ID"
def name = "${meta.id}.${type}.${context_type}"

// FIXME: the definition of subgroups to exclude seems not to work in the new CLI SigProfilerAssignment
// def exclude_signature_subgroups = params.exclude_subgroups ? "--exclude_signature_subgroups \"${params.exclude_subgroups}\"" : ""
// The default input format is "matrix".
"""
mkdir -p spa_volume
export SIGPROFILERMATRIXGENERATOR_VOLUME='./spa_volume'
export SIGPROFILERPLOTTING_VOLUME='./spa_volume'
export SIGPROFILERASSIGNMENT_VOLUME='./spa_volume'

SigProfilerAssignment cosmic_fit \\
${matrix} \\
${matrix} \\
output_${name} \\
--signature_database ${reference_signatures} \\
--genome_build ${assembly} \\
--cpu ${task.cpus} \\
--context_type ${context_type} \\
--volume spa_volume

cp output_${name}/Assignment_Solution/Activities/Decomposed_MutationType_Probabilities.txt output_${name}/Assignment_Solution/Activities/Decomposed_MutationType_Probabilities.${name}.txt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ process SIGPROFILER_MATRIXGENERATOR {

output:
path("**plots/*"), optional : true, emit: output_plots
path("**ID/*ID83*"), optional : true, emit: matrix_ID83
path("**ID/*") , optional : true, emit: matrices_ID
path("**DBS/*") , optional : true, emit: matrices_DBS
path("**SBS/*") , optional : true, emit: matrices_SBS
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ params {


cosmic_ref_signatures = "COSMIC_v3.4_SBS_GRCh38.txt"
indel_ref_signatures = "COSMIC_v3.4_ID_GRCh37.txt" // note that for IDs it has been defined in the GRCh37 genome version
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

wgs_trinuc_counts = "assets/trinucleotide_counts/trinuc_counts.homo_sapiens.tsv"
cadd_scores = "CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz"
cadd_scores_ind = "CADD/v1.7/hg38/whole_genome_SNVs.tsv.gz.tbi"
Expand Down
9 changes: 9 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,15 @@
"fa_icon": "far fa-file-code",
"default": "COSMIC_v3.4_SBS_GRCh38.txt"
},
"indel_ref_signatures": {
"type": "string",
"format": "file-path",
"mimetype": "text/plain",
"description": "Path to file containing the reference indel (ID) signatures to use in SigProfilerAssignment.",
"help_text": "You can obtain it from COSMIC website. Note that for ID signatures the GRCh37 genome version is used.",
"fa_icon": "far fa-file-code",
"default": "COSMIC_v3.4_ID_GRCh37.txt"
},
"wgs_trinuc_counts": {
"type": "string",
"format": "file-path",
Expand Down
20 changes: 17 additions & 3 deletions workflows/deepcsa.nf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ include { DNA_2_PROTEIN_MAPPING as DNA2PROTEINMAPPING } from '../m

include { MAF_2_VCF as MAF2VCF } from '../modules/local/maf2vcf/main'
include { SIGPROFILER_MATRIXGENERATOR as SIGPROMATRIXGENERATOR } from '../modules/local/signatures/sigprofiler/matrixgenerator/main'
include { SIGPROFILERASSIGNMENT_COSMIC_FIT as SIGPROFILERASSIGNMENTINDELS } from '../modules/local/signatures/sigprofiler/assignment/cosmic_fit/main'

include { MUTATIONS_2_SIGNATURES as MUTS2SIGS } from '../modules/local/mutations2sbs/main'

Expand All @@ -121,7 +122,7 @@ include { MUTATIONS_2_SIGNATURES as MUTS2SIGS } from '../m
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

workflow DEEPCSA{
workflow DEEPCSA {

// // Input channel definitions
features_table = channel.fromPath( params.features_table ?: params.input, checkIfExists: true)
Expand All @@ -132,6 +133,11 @@ workflow DEEPCSA{
cosmic_ref = params.cosmic_ref_signatures
? channel.fromPath( params.cosmic_ref_signatures, checkIfExists: true).first()
: channel.empty()
cosmic_indel_ref = params.indel_ref_signatures
? channel.fromPath( params.indel_ref_signatures, checkIfExists: true).first()
: channel.empty()


datasets3d = params.datasets3d
? channel.fromPath( params.datasets3d, checkIfExists: true).first()
: channel.empty()
Expand Down Expand Up @@ -547,8 +553,16 @@ workflow DEEPCSA{
vcf_files = MAF2VCF.out.vcf_files.flatten().collect()

SIGPROMATRIXGENERATOR(
vcf_files,
)
vcf_files)

// --> external arg
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented this since I'm not sure it's correct


SIGPROMATRIXGENERATOR.out.matrix_ID83
.map{ it -> [ [id:"all_samples"], "indels", it] }
.set{ indels_matrix }

SIGPROFILERASSIGNMENTINDELS(indels_matrix, cosmic_indel_ref)
}

// Signature Analysis
if (params.profileall){
Expand Down