Commit 94051bcf authored by khalid's avatar khalid
Browse files

Add a raw popmap to ease radsex inputs

parent 61971d4e
......@@ -79,7 +79,7 @@ def generate(name, path_yaml = "", path_input = DEFAULT_PATH_INPUT, path_output
result += "config.update("+raw_input+")\n"
# !!! possibilité de définir samples plusieurs fois si il y a raw_reads et raw_vcf ... !!!
# il faut vérifier que les samples sont les mêmes ?
if not raw_input.endswith("_index"):
if not raw_input.endswith("_index") and not raw_input.endswith("_popmap"):
result += "SAMPLES = "+raw_input+"['samples']\n"
result += "\n"
......
......@@ -48,6 +48,7 @@ data: [
{name: "fasta", category: "sequences"},
{name: "contigs", category: "sequences"},
{name: "scafSeq", category: "sequences"},
{name: "read_dir", category: "sequences"},
{name: "bowtie_index", category: "index"},
{name: "bowtie2_index", category: "index"},
......@@ -83,6 +84,7 @@ data: [
{name: "csv", category: "text"},
{name: "json", category: "text"},
{name: "tsv.gz", category: "text"},
{name: "popmap", category: "text"},
{name: "png", category: "image"},
......@@ -92,6 +94,6 @@ data: [
{name: "intervals", category: "other"},
{name: "jf", category: "other"},
{name: "hist", category: "other"},
{name: "read_dir", category: "other"},
]
}
......@@ -10,14 +10,11 @@ rule <step_name>__radsex_distrib:
params:
command = config["<step_name>__radsex_distrib_command"],
min_depth = config["<step_name>__radsex_min_depth"],
popmap = config["<step_name>__population_tsv"]
run:
readline = ""
shell(
shell:
"{params.command} "+
"--markers-table {input.markers_table} "+
"--popmap {params.popmap} "+
"--popmap {input.popmap_file} "+
"-o {output} "+
"-d {params.min_depth} "+
"--groups F,M"
)
\ No newline at end of file
\ No newline at end of file
......@@ -17,6 +17,7 @@
output_dir: radsex_distrib,
inputs: [
{ name: markers_table, type: "tsv", file: "", description: "Table containing the depth of each marker in each individual (tabulated file)" },
{ name: "popmap_file", type: "popmap", description: "Path to population tsv file" }
],
outputs:
[
......@@ -24,13 +25,6 @@
],
options:
[
{
name: population_tsv,
# prefix: "--popmap",
type: input_file,
value: "",
label: "Path to population tsv file",
},
{
name: "radsex_min_depth",
prefix: "--min-depth",
......
......@@ -7,8 +7,13 @@ args = commandArgs(trailingOnly=TRUE)
parameters = read_yaml(args[1])$params
chemin= paste0(parameters$results_dir,"/",parameters$<step_name>__radsex_map_output_dir)
chromosome_file = parameters$<step_name>__chromosome_file
fichiers = paste0(chemin, "/map_results.tsv")
output_file = paste(parameters$results_dir,parameters$<step_name>__radsex_map_output_dir,"Mapping_genome_radsex_map_mqc.png",sep = "/")
# Default marker depths plot
radsex_map_circos(fichiers, output_file = output_file)
\ No newline at end of file
if ( chromosome_file == ""){
radsex_map_circos(fichiers, output_file = output_file)
} else{
radsex_map_circos(fichiers, output_file = output_file, chromosomes_file= chromosome_file)
}
......@@ -13,19 +13,14 @@ rule <step_name>__radsex_map:
min_frequency = config["<step_name>__radsex_min_frequency"],
min_depth = config["<step_name>__radsex_min_depth"],
signif_threshold = config["<step_name>__radsex_signif_threshold"],
popmap = config["<step_name>__population_tsv"],
genome = config["<step_name>__genome_file"]
run:
readline = ""
shell(
shell:
"{params.command} "+
"--markers-file {input} "+
"--popmap {params.popmap} "+
"--genome-file {params.genome} "+
"--markers-file {input.markers_table} "+
"--popmap {input.popmap_file} "+
"--genome-file {input.genome_fasta} "+
"--output-file {output} "+
"--min-depth {params.min_depth} " +
"--min-quality {params.min_quality} "+
"--min-frequency {params.min_frequency} "+
"--signif-threshold {params.signif_threshold} "+
"--groups F,M "
)
\ No newline at end of file
......@@ -16,8 +16,9 @@
category: "radsex",
output_dir: radsex_map,
inputs: [
{ name: markers_table, type: "tsv", file: "", description: "Table containing the depth of each marker in each individual (tabulated file)" },
# { name: genome_fasta, type: "contigs", description: "Fasta reference", from: "parameter" }
{ name: "markers_table", type: "tsv", file: "", description: "Table containing the depth of each marker in each individual (tabulated file)" },
{ name: "popmap_file", type: "popmap", description: "Path to population tsv file" },
{ name: "genome_fasta", type: "contigs", description: "Fasta reference", from: "parameter"},
],
outputs:
[
......@@ -25,20 +26,20 @@
],
options:
[
{
name: population_tsv,
prefix: "--popmap",
{
name: radsex_map_genome_fasta,
prefix: "--genome-file",
type: input_file,
value: "",
label: "Path to population tsv file",
label: "Path to the genome file",
},
{
name: genome_file,
prefix: "--genome-file",
name: chromosome_file,
prefix: "",
type: input_file,
value: "",
label: "Path to the genome file",
},
label: "Path to the chromosome file",
},
{
name: "radsex_min_quality",
prefix: "--min-quality",
......
......@@ -10,15 +10,9 @@ rule <step_name>__radsex_process:
params:
command = config["<step_name>__radsex_process_command"],
min_depth = config["<step_name>__radsex_min_depth"]
run:
readline = ""
# for r1 in input.read:
# readline += "-r "+r1+" "
shell(
shell:
"{params.command} "+ # Attention, radsex demande un dossier de reads et pas une liste de reads
# readline+
"-i {input.read_dir} "+
"-T {threads} "+
"-o {output} "+
"-d {params.min_depth}"
)
\ No newline at end of file
......@@ -7,9 +7,10 @@ args = commandArgs(trailingOnly=TRUE)
parameters = read_yaml(args[1])$params
chemin= paste0(parameters$results_dir,"/",parameters$<step_name>__radsex_signif_output_dir)
fichiers = paste0(chemin, "/significant_markers.tsv")
fichier = paste0(chemin, "/significant_markers_mqc.tsv")
output_file = paste(parameters$results_dir,parameters$<step_name>__radsex_signif_output_dir,"Marker_depth_radsex_signif_mqc.png",sep = "/")
# Default marker depths plot
radsex_marker_depths(fichiers,
radsex_marker_depths(fichier,
output_file = output_file, clustering_method = 'ward.D')
\ No newline at end of file
......@@ -2,7 +2,7 @@ rule <step_name>__radsex_signif:
input:
**<step_name>__radsex_signif_inputs()
output:
significant_markers = config["results_dir"] + "/" + config["<step_name>__radsex_signif_output_dir"] + "/significant_markers.tsv"
significant_markers = config["results_dir"] + "/" + config["<step_name>__radsex_signif_output_dir"] + "/significant_markers_mqc.tsv"
log:
config["results_dir"]+'/logs/' + config["<step_name>__radsex_signif_output_dir"] + '/radsex_log.txt'
# threads:
......@@ -10,14 +10,10 @@ rule <step_name>__radsex_signif:
params:
command = config["<step_name>__radsex_signif_command"],
min_depth = config["<step_name>__radsex_min_depth"],
popmap = config["<step_name>__population_tsv"]
run:
readline = ""
shell(
shell:
"{params.command} "+
"--markers-table {input.markers_table} "+
"--popmap {params.popmap} "+
"--popmap {input.popmap_file} "+
"-o {output} "+
"-d {params.min_depth} "+
"--groups F,M"
)
\ No newline at end of file
......@@ -17,20 +17,14 @@
output_dir: radsex_signif,
inputs: [
{ name: markers_table, type: "tsv", file: "", description: "Table containing the depth of each marker in each individual (tabulated file)" },
{ name: "popmap_file", type: "popmap", description: "Path to population tsv file"}
],
outputs:
[
{ name: significant_markers, type: "tsv", file: "significant_markers.tsv", description: "Table containing the markers significantly different between males and females" }
{ name: significant_markers, type: "tsv", file: "significant_markers_mqc.tsv", description: "Table containing the markers significantly different between males and females" }
],
options:
[
{
name: population_tsv,
# prefix: "--popmap",
type: input_file,
value: "",
label: "Path to population tsv file",
},
{
name: "radsex_min_depth",
prefix: "--min-depth",
......@@ -44,10 +38,10 @@
],
},
],
# prepare_report_script: radsex_signif.prepare.report.R,
# prepare_report_outputs: [
# Marker_depth_radsex_signif_mqc.png,
# ],
prepare_report_script: radsex_signif.prepare.report.R,
prepare_report_outputs: [
Marker_depth_radsex_signif_mqc.png,
],
install:
{
radsex_apt_dependencies: [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment