Skip to content
Snippets Groups Projects
Verified Commit 086a8767 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

split plot from the analysis

parent 065bb98a
No related branches found
No related tags found
No related merge requests found
...@@ -8,15 +8,8 @@ data <- readr::read_tsv(args[2], show_col_types = FALSE) ...@@ -8,15 +8,8 @@ data <- readr::read_tsv(args[2], show_col_types = FALSE)
format(object.size(data), units = "Mb") format(object.size(data), units = "Mb")
annotation <- parse_annotation(args[1]) annotation <- parse_annotation(args[1])
count <- annotate_counts(annotation, data, args[3]) count <- annotate_counts(annotation, data, args[3])
save(count, file = paste0(args[3], ".Rdata"))
res <- compare_models(count %>% dplyr::ungroup(), nboot = 100, bootsize = 0.1, core = as.numeric(args[4])) res <- compare_models(count %>% dplyr::ungroup(), nboot = 100, bootsize = 0.1, core = as.numeric(args[4]))
save(count, file = paste0(args[3], ".Rdata"))
save(res, file = paste0(args[3], "_boot.Rdata")) save(res, file = paste0(args[3], "_boot.Rdata"))
res %>%
ggplot(aes(x = name, y = BIC)) +
geom_violin()
ggsave(paste0(args[3], "_BIC.pdf"))
res %>%
ggplot(aes(x = name, y = WSS_f / BSS)) +
geom_violin()
ggsave(paste0(args[3], "_WSS_BSS.pdf"))
...@@ -8,8 +8,9 @@ params.kmer_size = 12 ...@@ -8,8 +8,9 @@ params.kmer_size = 12
include { SPLIT } from "./modules/split" include { SPLIT } from "./modules/split"
include { FASTKMERS } from "./modules/fastkmers" include { FASTKMERS } from "./modules/fastkmers"
include { MERGEKMER } from "./modules/mergekmer" include { MERGEKMER } from "./modules/mergekmer"
include { COLLATEKMER} from "./modules/mergekmer" include { COLLATEKMER } from "./modules/mergekmer"
include { KMERCLUST} from "./modules/kmerclust" include { KMERCLUST } from "./modules/kmerclust"
include { KMERCLUST_PLOT } from "./modules/kmerclust"
Channel.fromPath( file(params.csv) ) Channel.fromPath( file(params.csv) )
...@@ -30,4 +31,5 @@ workflow { ...@@ -30,4 +31,5 @@ workflow {
MERGEKMER(FASTKMERS.out.csv.groupTuple()) MERGEKMER(FASTKMERS.out.csv.groupTuple())
COLLATEKMER(MERGEKMER.out.csv.map{it -> [it[0].specie, it[1]] }.groupTuple()) COLLATEKMER(MERGEKMER.out.csv.map{it -> [it[0].specie, it[1]] }.groupTuple())
KMERCLUST(COLLATEKMER.out.csv, params_csv.collect()) KMERCLUST(COLLATEKMER.out.csv, params_csv.collect())
KMERCLUST_PLOT(KMERCLUST.out.rdata)
} }
...@@ -10,7 +10,6 @@ process KMERCLUST { ...@@ -10,7 +10,6 @@ process KMERCLUST {
path params_csv path params_csv
output: output:
tuple val(specie), path("*.pdf"), emit: pdf
tuple val(specie), path("*.Rdata"), emit: rdata tuple val(specie), path("*.Rdata"), emit: rdata
path "versions.yml" , emit: versions path "versions.yml" , emit: versions
...@@ -25,3 +24,29 @@ process KMERCLUST { ...@@ -25,3 +24,29 @@ process KMERCLUST {
END_VERSIONS END_VERSIONS
""" """
} }
process KMERCLUST_PLOT {
tag "$specie"
label 'big_mem_mono_cpus'
container "lbmc/kmerclust:0.0.2"
publishDir "results/${params.kmer_size}/${specie}/", mode: 'copy'
input:
tuple val(specie), path(rdata)
output:
tuple val(specie), path("*.pdf"), emit: pdf
path "versions.yml" , emit: versions
script:
def args = task.ext.args ?: ''
"""
Rscript ${projectDir}/bin/kmerclust_plot.R ${specie}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Rkmerclust: 0.0.1
END_VERSIONS
"""
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment