From d6350fa70e635582583ff9673eda7e2a8da10e53 Mon Sep 17 00:00:00 2001 From: FernandoDuarteF Date: Tue, 3 Dec 2024 15:16:46 +0000 Subject: [PATCH 1/5] Added genome ideogram local module --- bin/plot_markers1.R | 44 ++++++++++++++++++++++++++++++++ bin/plot_markers2.R | 38 +++++++++++++++++++++++++++ modules/local/genome_ideogram.nf | 38 +++++++++++++++++++++++++++ subworkflows/local/genome.nf | 17 +++++++++--- 4 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 bin/plot_markers1.R create mode 100644 bin/plot_markers2.R create mode 100644 modules/local/genome_ideogram.nf diff --git a/bin/plot_markers1.R b/bin/plot_markers1.R new file mode 100644 index 0000000..ffcc1b9 --- /dev/null +++ b/bin/plot_markers1.R @@ -0,0 +1,44 @@ +# load libraries +require(RIdeogram) + +args <- commandArgs(trailingOnly = TRUE) +file_name_for_karyotype <- args[1] +out_name <- args[2] # how to name the karyotype + +##### karyotype------- +karyotype1 <- read.csv(file=file_name_for_karyotype, sep="\t", header = FALSE, stringsAsFactors = F) +karyotype1$start <- 1 +karyotype1$genome <- out_name +karyotype1$size <- 12 +karyotype1$color <- "25252" + +# fix columns names +colnames(karyotype1) <- c("Chr", "End", "Start", "species", "size", "color") +# reorder columns +karyotype <- karyotype1[, c(1,3,2,4,5,6)] + +write.table(karyotype, file = paste0("data/karyotype/", out_name, "_karyotype.txt"), quote = FALSE, row.names = FALSE, col.names = TRUE, sep = "\t") + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/plot_markers2.R b/bin/plot_markers2.R new file mode 100644 index 0000000..6609025 --- /dev/null +++ b/bin/plot_markers2.R @@ -0,0 +1,38 @@ + +# load libraries +require(RIdeogram) + +# From the Rstudio console set working directory "plot_markers/" folder: +# setwd("/path/to/support_protocol2/plot_markers/") + + +karyotype_file <- "./data/karyotype/Dmel_karyotype.txt" # provide path to karyotype file +coordinates <- "./plot_results/Dmel_busco_coordinates.txt" # provide path to markers' coordinates +out_name <- "Dmel" # sample name + +# load karyotype +karyotype <- read.csv(karyotype_file, sep="\t", header = TRUE, stringsAsFactors = F) + +# load mapping busco_coordinates.txt +busco_mappings <- read.csv(coordinates, sep="\t", header = FALSE, stringsAsFactors = F) + +colnames(busco_mappings)[1] <- "Status" +colnames(busco_mappings)[2] <- "Chr" +colnames(busco_mappings)[3] <- "Start" +colnames(busco_mappings)[4] <- "End" + +busco_mappings$Type <- "BUSCO_marker" +busco_mappings$Shape <- "circle" + +# change status in color +busco_mappings$Status <- gsub("Complete", '2dacd6', busco_mappings$Status) +busco_mappings$Status <- gsub("Duplicated", '0a0e1a', busco_mappings$Status) +busco_mappings$Status <- gsub("Fragmented", 'eded13', busco_mappings$Status) +colnames(busco_mappings)[1] <- "color" + +busco_mappings <- busco_mappings[, c(5,6,2,3,4,1)] + +ideogram(karyotype = karyotype, label = busco_mappings, label_type = "marker", output = paste0(out_name, ".svg")) +# convert to png +convertSVG(paste0(out_name, ".svg"), device = "png") + diff --git a/modules/local/genome_ideogram.nf b/modules/local/genome_ideogram.nf new file mode 100644 index 0000000..5d60cad --- /dev/null +++ b/modules/local/genome_ideogram.nf @@ -0,0 +1,38 @@ +process GENOME_BUSCO_IDEOGRAM { + tag "$meta.id" + label 'process_single' + + conda "bioconda::r-rideogram=0.2.2 bioconda::r-svglite=2.1.1" + container "community.wave.seqera.io/library/seqkit_r-dplyr_r-optparse_r-readr_pruned:92b750716d244919" + + input: + tuple val(meta), path(genome), path(busco_full_table) + + output: + tuple val(meta), path("*.svg"), emit: svg + tuple val(meta), path("*.png"), emit: png + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + grep -v "#" ${busco_full_table} | cut -f 2,3,4,5 | grep -v "Missing" > ${prefix}_busco_coordinates.txt + + + # Get chromosome lengths: + seqkit fx2tab -i -n -l ${genome} > ${prefix}_for_karyotype.txt + + # Call script for table wrangling + Rscript plot_markers1.R ${prefix}_for_karyotype.txt ${prefix} + + # Call script for plotting + Rscript plot_markers2.R ${prefix}_karyotype.txt ${prefix}_busco_coordinates.txt ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + r-base: \$(Rscript -e "cat(as.character(getRversion()))") + r-rideogram: \$(Rscript -e "cat(as.character(packageVersion('RIdeogram')))") + END_VERSIONS + """ +} diff --git a/subworkflows/local/genome.nf b/subworkflows/local/genome.nf index c8f7d9c..dfb57fe 100644 --- a/subworkflows/local/genome.nf +++ b/subworkflows/local/genome.nf @@ -1,6 +1,7 @@ include { QUAST } from '../../modules/nf-core/quast/main' include { BUSCO_BUSCO } from '../../modules/nf-core/busco/busco/main' +include { GENOME_BUSCO_IDEOGRAM } from '../../modules/local/genome_ideogram' workflow GENOME { @@ -9,14 +10,14 @@ workflow GENOME { main: - ch_versions = Channel.empty() + ch_versions = Channel.empty() QUAST ( ch_fasta, [[],[]], [[],[]] ) - ch_versions = ch_versions.mix(QUAST.out.versions.first()) + ch_versions = ch_versions.mix(QUAST.out.versions.first()) BUSCO_BUSCO ( ch_fasta, @@ -25,7 +26,17 @@ workflow GENOME { params.busco_lineages_path ?: [], params.busco_config ?: [] ) - ch_versions = ch_versions.mix(BUSCO_BUSCO.out.versions.first()) + ch_versions = ch_versions.mix(BUSCO_BUSCO.out.versions.first()) + ch_full_table = BUSCO_BUSCO.out.full_table + + // Combined ch_fasta and BUSCO output channel into a single channel for ideogram + ch_input_ideo = ch_fasta + | combine(ch_full_table, by:0) + + + GENOME_BUSCO_IDEOGRAM ( + ch_input_ideo + ) emit: quast_results = QUAST.out.results // channel: [ val(meta), [tsv] ] From a43634ab657d683f1d2dbeb081ef4e13b8f3fa47 Mon Sep 17 00:00:00 2001 From: FernandoDuarteF Date: Thu, 5 Dec 2024 15:39:01 +0000 Subject: [PATCH 2/5] Update plot_markers scripts --- bin/plot_markers1.R | 2 ++ bin/plot_markers2.R | 1 + modules/local/genome_ideogram.nf | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 bin/plot_markers1.R mode change 100644 => 100755 bin/plot_markers2.R diff --git a/bin/plot_markers1.R b/bin/plot_markers1.R old mode 100644 new mode 100755 index ffcc1b9..159ae4f --- a/bin/plot_markers1.R +++ b/bin/plot_markers1.R @@ -1,3 +1,5 @@ +#!/usr/bin/env Rscript + # load libraries require(RIdeogram) diff --git a/bin/plot_markers2.R b/bin/plot_markers2.R old mode 100644 new mode 100755 index 6609025..28c52dd --- a/bin/plot_markers2.R +++ b/bin/plot_markers2.R @@ -1,3 +1,4 @@ +#!/usr/bin/env Rscript # load libraries require(RIdeogram) diff --git a/modules/local/genome_ideogram.nf b/modules/local/genome_ideogram.nf index 5d60cad..ad73ff5 100644 --- a/modules/local/genome_ideogram.nf +++ b/modules/local/genome_ideogram.nf @@ -24,10 +24,10 @@ process GENOME_BUSCO_IDEOGRAM { seqkit fx2tab -i -n -l ${genome} > ${prefix}_for_karyotype.txt # Call script for table wrangling - Rscript plot_markers1.R ${prefix}_for_karyotype.txt ${prefix} + Rscript /home/ucbtfrd/pipelines/genomeqc/bin/plot_markers1.R ${prefix}_for_karyotype.txt ${prefix} # Call script for plotting - Rscript plot_markers2.R ${prefix}_karyotype.txt ${prefix}_busco_coordinates.txt ${prefix} + Rscript /home/ucbtfrd/pipelines/genomeqc/bin/plot_markers2.R ${prefix}_karyotype.txt ${prefix}_busco_coordinates.txt ${prefix} cat <<-END_VERSIONS > versions.yml "${task.process}": From b84b7628464bd27b721b1714718fd20331436cbc Mon Sep 17 00:00:00 2001 From: FernandoDuarteF Date: Fri, 6 Dec 2024 09:49:08 +0000 Subject: [PATCH 3/5] Fixed ideogram not working for genome mode --- bin/plot_markers1.R | 6 ++++- bin/plot_markers2.R | 39 ----------------------------- conf/modules.config | 8 ++++++ modules/local/genome_ideogram.nf | 11 ++++++-- modules/nf-core/busco/busco/main.nf | 4 +-- 5 files changed, 24 insertions(+), 44 deletions(-) delete mode 100755 bin/plot_markers2.R diff --git a/bin/plot_markers1.R b/bin/plot_markers1.R index 159ae4f..3cf0faa 100755 --- a/bin/plot_markers1.R +++ b/bin/plot_markers1.R @@ -19,7 +19,11 @@ colnames(karyotype1) <- c("Chr", "End", "Start", "species", "size", "color") # reorder columns karyotype <- karyotype1[, c(1,3,2,4,5,6)] -write.table(karyotype, file = paste0("data/karyotype/", out_name, "_karyotype.txt"), quote = FALSE, row.names = FALSE, col.names = TRUE, sep = "\t") +# debugging code +print("Karyotype table\n") +head(karyotype) + +write.table(karyotype, file = paste0(out_name, "_karyotype.txt"), quote = FALSE, row.names = FALSE, col.names = TRUE, sep = "\t") diff --git a/bin/plot_markers2.R b/bin/plot_markers2.R deleted file mode 100755 index 28c52dd..0000000 --- a/bin/plot_markers2.R +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env Rscript - -# load libraries -require(RIdeogram) - -# From the Rstudio console set working directory "plot_markers/" folder: -# setwd("/path/to/support_protocol2/plot_markers/") - - -karyotype_file <- "./data/karyotype/Dmel_karyotype.txt" # provide path to karyotype file -coordinates <- "./plot_results/Dmel_busco_coordinates.txt" # provide path to markers' coordinates -out_name <- "Dmel" # sample name - -# load karyotype -karyotype <- read.csv(karyotype_file, sep="\t", header = TRUE, stringsAsFactors = F) - -# load mapping busco_coordinates.txt -busco_mappings <- read.csv(coordinates, sep="\t", header = FALSE, stringsAsFactors = F) - -colnames(busco_mappings)[1] <- "Status" -colnames(busco_mappings)[2] <- "Chr" -colnames(busco_mappings)[3] <- "Start" -colnames(busco_mappings)[4] <- "End" - -busco_mappings$Type <- "BUSCO_marker" -busco_mappings$Shape <- "circle" - -# change status in color -busco_mappings$Status <- gsub("Complete", '2dacd6', busco_mappings$Status) -busco_mappings$Status <- gsub("Duplicated", '0a0e1a', busco_mappings$Status) -busco_mappings$Status <- gsub("Fragmented", 'eded13', busco_mappings$Status) -colnames(busco_mappings)[1] <- "color" - -busco_mappings <- busco_mappings[, c(5,6,2,3,4,1)] - -ideogram(karyotype = karyotype, label = busco_mappings, label_type = "marker", output = paste0(out_name, ".svg")) -# convert to png -convertSVG(paste0(out_name, ".svg"), device = "png") - diff --git a/conf/modules.config b/conf/modules.config index a768dc5..3781d81 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -159,6 +159,14 @@ process { ] } + withName: 'GENOME_BUSCO_IDEOGRAM' { + publishDir = [ + path: { "${params.outdir}/genome_busco_ideogram" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + ] + } + withName: 'GENE_OVERLAPS' { publishDir = [ path: { "${params.outdir}/gene_overlaps" }, diff --git a/modules/local/genome_ideogram.nf b/modules/local/genome_ideogram.nf index ad73ff5..5a3dde8 100644 --- a/modules/local/genome_ideogram.nf +++ b/modules/local/genome_ideogram.nf @@ -19,15 +19,22 @@ process GENOME_BUSCO_IDEOGRAM { """ grep -v "#" ${busco_full_table} | cut -f 2,3,4,5 | grep -v "Missing" > ${prefix}_busco_coordinates.txt + #echo "Current directory: \$(pwd)" + #echo "Contents of current directory:" + #ls -l + #echo "Contents of projectDir:" + #ls -l $projectDir/bin + #echo "Contents of plot_markers1.R script" + #cat $projectDir/bin/plot_markers1.R # Get chromosome lengths: seqkit fx2tab -i -n -l ${genome} > ${prefix}_for_karyotype.txt # Call script for table wrangling - Rscript /home/ucbtfrd/pipelines/genomeqc/bin/plot_markers1.R ${prefix}_for_karyotype.txt ${prefix} + $projectDir/bin/plot_markers1.R ${prefix}_for_karyotype.txt ${prefix} # Call script for plotting - Rscript /home/ucbtfrd/pipelines/genomeqc/bin/plot_markers2.R ${prefix}_karyotype.txt ${prefix}_busco_coordinates.txt ${prefix} + $projectDir/bin/plot_busco_ideogram.R --busco_output ${prefix}_busco_coordinates.txt --karyotype ${prefix}_karyotype.txt --prefix ${prefix} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/busco/busco/main.nf b/modules/nf-core/busco/busco/main.nf index f7c1a66..658aa39 100644 --- a/modules/nf-core/busco/busco/main.nf +++ b/modules/nf-core/busco/busco/main.nf @@ -4,8 +4,8 @@ process BUSCO_BUSCO { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/busco:5.7.1--pyhdfd78af_0': - 'biocontainers/busco:5.7.1--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/busco:5.8.0--pyhdfd78af_0': + 'biocontainers/busco:5.8.0--pyhdfd78af_0' }" input: tuple val(meta), path(fasta, stageAs:'tmp_input/*') From c69d84683562a6e51eb959f87bdec59027c27de6 Mon Sep 17 00:00:00 2001 From: FernandoDuarteF Date: Fri, 6 Dec 2024 11:57:23 +0000 Subject: [PATCH 4/5] More descriptive names for modules and subworkflows --- bin/plot_markers1.R | 2 ++ ...am.nf => genome_annotation_busco_ideogram.nf} | 2 +- ...ideogram.nf => genome_only_busco_ideogram.nf} | 16 ++++++---------- subworkflows/local/genome_and_annotation.nf | 4 ++-- subworkflows/local/{genome.nf => genome_only.nf} | 6 +++--- workflows/genomeqc.nf | 10 +++++----- 6 files changed, 19 insertions(+), 21 deletions(-) rename modules/local/{plot_busco_ideogram.nf => genome_annotation_busco_ideogram.nf} (97%) rename modules/local/{genome_ideogram.nf => genome_only_busco_ideogram.nf} (73%) rename subworkflows/local/{genome.nf => genome_only.nf} (89%) diff --git a/bin/plot_markers1.R b/bin/plot_markers1.R index 3cf0faa..70fea91 100755 --- a/bin/plot_markers1.R +++ b/bin/plot_markers1.R @@ -1,5 +1,7 @@ #!/usr/bin/env Rscript +# Modified from https://gitlab.com/ezlab/busco_protocol/-/blob/main/support_protocol2/plot_markers/scripts/plot_markers1.R?ref_type=heads + # load libraries require(RIdeogram) diff --git a/modules/local/plot_busco_ideogram.nf b/modules/local/genome_annotation_busco_ideogram.nf similarity index 97% rename from modules/local/plot_busco_ideogram.nf rename to modules/local/genome_annotation_busco_ideogram.nf index 58cfc2b..629df08 100644 --- a/modules/local/plot_busco_ideogram.nf +++ b/modules/local/genome_annotation_busco_ideogram.nf @@ -1,4 +1,4 @@ -process PLOT_BUSCO_IDEOGRAM { +process GENOME_ANNOTATION_BUSCO_IDEOGRAM { tag "${genusspeci}_${lineage}" label 'process_single' diff --git a/modules/local/genome_ideogram.nf b/modules/local/genome_only_busco_ideogram.nf similarity index 73% rename from modules/local/genome_ideogram.nf rename to modules/local/genome_only_busco_ideogram.nf index 5a3dde8..3adc525 100644 --- a/modules/local/genome_ideogram.nf +++ b/modules/local/genome_only_busco_ideogram.nf @@ -1,4 +1,4 @@ -process GENOME_BUSCO_IDEOGRAM { +process GENOME_ONLY_BUSCO_IDEOGRAM { tag "$meta.id" label 'process_single' @@ -19,14 +19,6 @@ process GENOME_BUSCO_IDEOGRAM { """ grep -v "#" ${busco_full_table} | cut -f 2,3,4,5 | grep -v "Missing" > ${prefix}_busco_coordinates.txt - #echo "Current directory: \$(pwd)" - #echo "Contents of current directory:" - #ls -l - #echo "Contents of projectDir:" - #ls -l $projectDir/bin - #echo "Contents of plot_markers1.R script" - #cat $projectDir/bin/plot_markers1.R - # Get chromosome lengths: seqkit fx2tab -i -n -l ${genome} > ${prefix}_for_karyotype.txt @@ -34,7 +26,11 @@ process GENOME_BUSCO_IDEOGRAM { $projectDir/bin/plot_markers1.R ${prefix}_for_karyotype.txt ${prefix} # Call script for plotting - $projectDir/bin/plot_busco_ideogram.R --busco_output ${prefix}_busco_coordinates.txt --karyotype ${prefix}_karyotype.txt --prefix ${prefix} + $projectDir/bin/plot_busco_ideogram.R \\ + --busco_output ${prefix}_busco_coordinates.txt \\ + --karyotype ${prefix}_karyotype.txt \\ + --prefix ${prefix} \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/subworkflows/local/genome_and_annotation.nf b/subworkflows/local/genome_and_annotation.nf index 0c07398..369548b 100644 --- a/subworkflows/local/genome_and_annotation.nf +++ b/subworkflows/local/genome_and_annotation.nf @@ -4,7 +4,7 @@ include { LONGEST } from '../../modules/local/longes include { BUSCO_BUSCO } from '../../modules/nf-core/busco/busco/main' include { QUAST } from '../../modules/nf-core/quast/main' include { AGAT_SPSTATISTICS } from '../../modules/nf-core/agat/spstatistics/main' -include { PLOT_BUSCO_IDEOGRAM } from '../../modules/local/plot_busco_ideogram' +include { GENOME_ANNOTATION_BUSCO_IDEOGRAM } from '../../modules/local/genome_annotation_busco_ideogram' include { GFFREAD } from '../../modules/nf-core/gffread/main' include { ORTHOFINDER } from '../../modules/nf-core/orthofinder/main' include { FASTAVALIDATOR } from '../../modules/nf-core/fastavalidator/main' @@ -182,7 +182,7 @@ workflow GENOME_AND_ANNOTATION { } } - PLOT_BUSCO_IDEOGRAM ( ch_plot_input )//removed this temporarily:, ch_karyotype + GENOME_ANNOTATION_BUSCO_IDEOGRAM ( ch_plot_input )//removed this temporarily:, ch_karyotype ch_tree_data = ch_tree_data.mix(BUSCO_BUSCO.out.batch_summary.collect { meta, file -> file }) diff --git a/subworkflows/local/genome.nf b/subworkflows/local/genome_only.nf similarity index 89% rename from subworkflows/local/genome.nf rename to subworkflows/local/genome_only.nf index dfb57fe..413e60a 100644 --- a/subworkflows/local/genome.nf +++ b/subworkflows/local/genome_only.nf @@ -1,9 +1,9 @@ include { QUAST } from '../../modules/nf-core/quast/main' include { BUSCO_BUSCO } from '../../modules/nf-core/busco/busco/main' -include { GENOME_BUSCO_IDEOGRAM } from '../../modules/local/genome_ideogram' +include { GENOME_ONLY_BUSCO_IDEOGRAM } from '../../modules/local/genome_only_busco_ideogram' -workflow GENOME { +workflow GENOME_ONLY { take: ch_fasta // channel: [ val(meta), [ fasta ] ] @@ -34,7 +34,7 @@ workflow GENOME { | combine(ch_full_table, by:0) - GENOME_BUSCO_IDEOGRAM ( + GENOME_ONLY_BUSCO_IDEOGRAM ( ch_input_ideo ) diff --git a/workflows/genomeqc.nf b/workflows/genomeqc.nf index f37ea4d..46ca60f 100644 --- a/workflows/genomeqc.nf +++ b/workflows/genomeqc.nf @@ -10,7 +10,7 @@ include { CREATE_PATH } from '../modules/local/create_pa include { NCBIGENOMEDOWNLOAD } from '../modules/nf-core/ncbigenomedownload/main' include { PIGZ_UNCOMPRESS as UNCOMPRESS_FASTA } from '../modules/nf-core/pigz/uncompress/main' include { PIGZ_UNCOMPRESS as UNCOMPRESS_GFF } from '../modules/nf-core/pigz/uncompress/main' -include { GENOME } from '../subworkflows/local/genome' +include { GENOME_ONLY } from '../subworkflows/local/genome_only' include { GENOME_AND_ANNOTATION } from '../subworkflows/local/genome_and_annotation' include { MULTIQC } from '../modules/nf-core/multiqc/main' include { TREE_SUMMARY } from '../modules/local/tree_summary' @@ -201,13 +201,13 @@ workflow GENOMEQC { // Run genome only or genome + gff if (params.genome_only) { - GENOME ( + GENOME_ONLY ( ch_input.fasta ) ch_multiqc_files = ch_multiqc_files - | mix(GENOME.out.quast_results.map { meta, results -> results }) - | mix(GENOME.out.busco_short_summaries.map { meta, txt -> txt }) - ch_versions = ch_versions.mix(GENOME.out.versions.first()) + | mix(GENOME_ONLY.out.quast_results.map { meta, results -> results }) + | mix(GENOME_ONLY.out.busco_short_summaries.map { meta, txt -> txt }) + ch_versions = ch_versions.mix(GENOME_ONLY.out.versions.first()) } else { GENOME_AND_ANNOTATION ( ch_input.fasta, From fe07df82a3b00c0d08648f715b7022ea6a652953 Mon Sep 17 00:00:00 2001 From: Fernando Duarte Date: Mon, 9 Dec 2024 18:01:36 +0000 Subject: [PATCH 5/5] Removed redundant lines and updated modules.config --- conf/modules.config | 6 +++--- modules/local/genome_only_busco_ideogram.nf | 6 +++--- subworkflows/local/genome_and_annotation.nf | 6 ++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 3781d81..3079ef8 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -151,15 +151,15 @@ process { ] } - withName: 'PLOT_BUSCO_IDEOGRAM' { + withName: 'GENOME_ANNOTATION_BUSCO_IDEOGRAM' { publishDir = [ - path: { "${params.outdir}/busco_ideogram" }, + path: { "${params.outdir}/genome_annotation_busco_ideogram" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] } - withName: 'GENOME_BUSCO_IDEOGRAM' { + withName: 'GENOME_ONLY_BUSCO_IDEOGRAM' { publishDir = [ path: { "${params.outdir}/genome_busco_ideogram" }, mode: params.publish_dir_mode, diff --git a/modules/local/genome_only_busco_ideogram.nf b/modules/local/genome_only_busco_ideogram.nf index 3adc525..c1361fa 100644 --- a/modules/local/genome_only_busco_ideogram.nf +++ b/modules/local/genome_only_busco_ideogram.nf @@ -21,12 +21,12 @@ process GENOME_ONLY_BUSCO_IDEOGRAM { # Get chromosome lengths: seqkit fx2tab -i -n -l ${genome} > ${prefix}_for_karyotype.txt - + # Call script for table wrangling - $projectDir/bin/plot_markers1.R ${prefix}_for_karyotype.txt ${prefix} + plot_markers1.R ${prefix}_for_karyotype.txt ${prefix} # Call script for plotting - $projectDir/bin/plot_busco_ideogram.R \\ + plot_busco_ideogram.R \\ --busco_output ${prefix}_busco_coordinates.txt \\ --karyotype ${prefix}_karyotype.txt \\ --prefix ${prefix} \\ diff --git a/subworkflows/local/genome_and_annotation.nf b/subworkflows/local/genome_and_annotation.nf index 369548b..08b3a7c 100644 --- a/subworkflows/local/genome_and_annotation.nf +++ b/subworkflows/local/genome_and_annotation.nf @@ -52,7 +52,7 @@ workflow GENOME_AND_ANNOTATION { | combine(ch_gff_agat, by:0) // by:0 | Only combine when both channels share the same id | combine(ch_gff_long, by:0) | multiMap { - meta, fasta, gff_unfilt, gff_filt -> + meta, fasta, gff_unfilt, gff_filt -> // null is is probably not necessary fasta : fasta ? tuple( meta, file(fasta) ) : null // channel: [ val(meta), [ fasta ] ] gff_unfilt : gff_unfilt ? tuple( meta, file(gff_unfilt) ) : null // channel: [ val(meta), [ gff ] ], unfiltered gff_filt : gff_filt ? tuple( meta, file(gff_filt) ) : null // channel: [ val(meta), [ gff ] ], filtered for longest isoform @@ -134,8 +134,6 @@ workflow GENOME_AND_ANNOTATION { // MODULE: Run BUSCO // - //GFFREAD.out.gffread_fasta.collect().view() - BUSCO_BUSCO ( GFFREAD.out.gffread_fasta, "proteins", // hardcoded @@ -182,7 +180,7 @@ workflow GENOME_AND_ANNOTATION { } } - GENOME_ANNOTATION_BUSCO_IDEOGRAM ( ch_plot_input )//removed this temporarily:, ch_karyotype + GENOME_ANNOTATION_BUSCO_IDEOGRAM ( ch_plot_input ) ch_tree_data = ch_tree_data.mix(BUSCO_BUSCO.out.batch_summary.collect { meta, file -> file })