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/*')