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

add clustering analysis in addition to boostrap analaysis

parent a494a7fb
No related branches found
No related tags found
No related merge requests found
......@@ -2,5 +2,12 @@ library(kmerclust)
args <- commandArgs(trailingOnly = TRUE)
print(args)
load(file = paste0(args[1], ".Rdata"))
res <- compare_models(count, nboot = as.numeric(args[2]) * 2, bootsize = nrow(count), core = as.numeric(args[2]))
res <- count %>%
dplyr::select(count_m, count_f) %>%
as.matrix() %>%
compute_tpm() %>%
log() %>%
compare_models_constraint(count, nboot = as.numeric(args[2]) * 2, bootsize = nrow(count), core = as.numeric(args[2]))
save(res, file = paste0(args[1], "_boot_", args[3], ".Rdata"))
......@@ -12,16 +12,15 @@ res %>%
geom_violin() +
theme_bw()
ggsave(paste0(args[1], "_BIC.pdf"))
res %>%
ggplot(aes(x = name, y = WSS_f / BSS)) +
geom_violin() +
theme_bw()
ggsave(paste0(args[1], "_WSS_BSS.pdf"))
rm(res)
load(file = paste0(args[1], ".Rdata"))
count %>%
sample_frac(0.1) %>%
mutate(
count_m = log1p(count_m),
count_f = log1p(count_f),
)
ggplot(aes(x = count_m, y = count_f)) +
geom_point() +
theme_bw()
ggsave(paste0(args[1], "_scatter.pdf"))
......@@ -2,7 +2,7 @@ process KMERCLUST_LOAD {
tag "$specie"
label 'big_mem_mono_cpus'
container "lbmc/kmerclust:0.0.2"
container "lbmc/kmerclust:0.0.3"
input:
tuple val(specie), path(csv)
......@@ -19,7 +19,33 @@ process KMERCLUST_LOAD {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Rkmerclust: 0.0.1
Rkmerclust: 0.0.3
END_VERSIONS
"""
}
process KMERCLUST_BOOT {
tag "$specie"
label 'big_mem_multi_cpus'
container "lbmc/kmerclust:0.0.3"
publishDir "results/${params.kmer_size}/${specie}/", mode: 'copy'
input:
tuple val(id), val(specie), path(rdata)
output:
tuple val(specie), path("*.Rdata"), emit: rdata
path "versions.yml" , emit: versions
script:
def args = task.ext.args ?: ''
"""
Rscript ${projectDir}/bin/kmerclust_boot.R ${specie} ${task.cpus} ${id}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Rkmerclust: 0.0.3
END_VERSIONS
"""
}
......@@ -28,7 +54,7 @@ process KMERCLUST {
tag "$specie"
label 'big_mem_multi_cpus'
container "lbmc/kmerclust:0.0.2"
container "lbmc/kmerclust:0.0.3"
publishDir "results/${params.kmer_size}/${specie}/", mode: 'copy'
input:
......@@ -41,11 +67,11 @@ process KMERCLUST {
script:
def args = task.ext.args ?: ''
"""
Rscript ${projectDir}/bin/kmerclust.R ${specie} ${task.cpus} ${id}
Rscript ${projectDir}/bin/kmerclust.R ${specie} ${task.cpus}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Rkmerclust: 0.0.1
Rkmerclust: 0.0.3
END_VERSIONS
"""
}
......@@ -54,7 +80,7 @@ process KMERCLUST_MERGE {
tag "$specie"
label 'big_mem_mono_cpus'
container "lbmc/kmerclust:0.0.2"
container "lbmc/kmerclust:0.0.3"
publishDir "results/${params.kmer_size}/${specie}/", mode: 'copy'
input:
......@@ -71,7 +97,7 @@ process KMERCLUST_MERGE {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Rkmerclust: 0.0.1
Rkmerclust: 0.0.3
END_VERSIONS
"""
}
......@@ -80,7 +106,7 @@ process KMERCLUST_PLOT {
tag "$specie"
label 'big_mem_mono_cpus'
container "lbmc/kmerclust:0.0.2"
container "lbmc/kmerclust:0.0.3"
publishDir "results/${params.kmer_size}/${specie}/", mode: 'copy'
input:
......@@ -97,7 +123,7 @@ process KMERCLUST_PLOT {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Rkmerclust: 0.0.1
Rkmerclust: 0.0.3
END_VERSIONS
"""
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment