Skip to content

Commit

Permalink
feat allow user to provide sample annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucia.pena.perez@scilifelab.se committed Aug 6, 2023
1 parent 780fd70 commit f6111c3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
9 changes: 9 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,15 @@ process {
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: '.*ANALYSE_TRANSCRIPTS:DROP_ANNOTATION' {
ext.when = {!params.drop_annot_file}
publishDir = [
path: { "${params.outdir}/analyse_transcripts" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: '.*ANALYSE_TRANSCRIPTS:DROP_CONFIG_RUN_AE' {
publishDir = [
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ params {
variant_caller = 'bcftools'
bcftools_caller_mode = 'multiallelic'
run_drop_ae = true
drop_annot_file = null

// MultiQC options
multiqc_config = null
Expand Down
8 changes: 8 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@
"description": "Should DROP Aberrant Expression module be run?",
"fa_icon": "fas fa-toggle-off"
},
"drop_annot_file": {
"type": "string",
"default": "None",
"description": "Path to a tsv file containing sample annotation for DROP. If it is not provided, it will be generated.",
"fa_icon": "fas fa-file",
"format": "file-path",
"mimetype": "tsv"
},
"reference_count_file": {
"type": "string",
"default": "None",
Expand Down
12 changes: 7 additions & 5 deletions subworkflows/local/analyse_transcripts.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ workflow ANALYSE_TRANSCRIPTS {
ch_fasta_fai_meta // channel (mandatory): [ val(meta), [ path(fasta), path(fai) ]
gene_counts // channel [val(meta), path(tsv)]
reference_count_file // channel [ path(tsv) ]
drop_annot_file // channel [ path(tsv) ]

main:
ch_versions = Channel.empty()
Expand All @@ -25,14 +26,15 @@ workflow ANALYSE_TRANSCRIPTS {
star_samp = gene_counts.map{ meta, cnt_file -> meta }.collect()
DROP_COUNTS(star_count, star_samp, ch_gtf, reference_count_file)

// Annotation file
// Generates sample annotation file is it hasn't been provided by user
DROP_ANNOTATION(DROP_COUNTS.out.processed_gene_counts, ch_gtf)

// Config file
ch_samp_annot = drop_annot_file.mix(DROP_ANNOTATION.out.sample_annotation_drop)

// Generates config file and runs Aberrant expression module
DROP_CONFIG_RUN_AE(
ch_fasta_fai_meta,
ch_gtf,
DROP_ANNOTATION.out.sample_annotation_drop,
ch_samp_annot,
DROP_COUNTS.out.processed_gene_counts
)

Expand Down Expand Up @@ -62,7 +64,7 @@ workflow ANALYSE_TRANSCRIPTS {
annotated_gtf = GFFCOMPARE.out.annotated_gtf // channel: [ val(meta), [ path(annotated_gtf) ] ]
stats_gtf = GFFCOMPARE.out.stats // channel: [ val(meta), [ path(stats) ] ]
processed_gene_counts = DROP_COUNTS.out.processed_gene_counts // channel: [ path(tsv) ]
annotation_drop = DROP_ANNOTATION.out.sample_annotation_drop // channel: [ path(tsv) ]
annotation_drop = ch_samp_annot // channel: [ path(tsv) ]
config_drop = DROP_CONFIG_RUN_AE.out.config_drop // channel: [ path(confg_file.yml) ]
drop_ae_out = DROP_CONFIG_RUN_AE.out.drop_ae_out
versions = ch_versions // channel: [ path(versions.yml) ]
Expand Down
6 changes: 5 additions & 1 deletion workflows/tomte.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def checkPathParamList = [
params.salmon_index,
params.transcript_fasta,
params.gtf,
params.drop_annot_file,
params.reference_count_file,
params.subsample_bed,
params.vep_filters,
Expand Down Expand Up @@ -117,6 +118,8 @@ workflow TOMTE {
: Channel.empty()
ch_reference_count_file = params.reference_count_file ? Channel.fromPath(params.reference_count_file).collect()
: Channel.empty()
ch_drop_annot_filee = params.drop_annot_file ? Channel.fromPath(params.drop_annot_file).collect()
: Channel.empty()

PREPARE_REFERENCES(
fasta,
Expand Down Expand Up @@ -179,7 +182,8 @@ workflow TOMTE {
ch_references.gtf,
ch_references.fasta_fai_meta,
ch_alignment.gene_counts,
ch_reference_count_file
ch_reference_count_file,
ch_drop_annot_filee
)
ch_versions = ch_versions.mix(ANALYSE_TRANSCRIPTS.out.versions)

Expand Down

0 comments on commit f6111c3

Please sign in to comment.