Commit 19976f85 authored by khalid's avatar khalid
Browse files

Add hisat2 and significant fasta file output

parent f29ee086
......@@ -10,23 +10,23 @@ chemin= paste0(parameters$results_dir,"/",parameters$<step_name>__radsex_distrib
fichiers = paste0(chemin, "/distribution.tsv")
output_file = paste(parameters$results_dir,parameters$<step_name>__radsex_distrib_output_dir,"Marker_depth_radsex_distrib_mqc.png",sep = "/")
ttt = read.table(fichiers, skip=1, header=T, nrows=1)
groups = colnames(ttt)[1:2]
tryCatch(
expr = {
# Default marker depths plot
radsex_distrib(fichiers, groups = c("F", "M"), output_file = output_file)
radsex_distrib(fichiers, groups = groups, output_file = output_file)
},
error = function(e){
message('Caught an error!')
p = ggplot() + ggtitle("Caught an error while callin radsex_distrib") + theme(panel.border = element_rect(colour = "black", fill=NA, size=2))
p = ggplot() + ggtitle("Caught an error while calling radsex_distrib") + theme(panel.border = element_rect(colour = "black", fill=NA, size=2))
png(output_file)
print(p)
dev.off()
},
warning = function(w){
message('Caught an error!')
p = ggplot() + ggtitle("Caught an error while callin radsex_distrib") + theme(panel.border = element_rect(colour = "black", fill=NA, size=2))
p = ggplot() + ggtitle("Caught an error while calling radsex_distrib") + theme(panel.border = element_rect(colour = "black", fill=NA, size=2))
png(output_file)
print(p)
dev.off()
......
......@@ -2,7 +2,8 @@ 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_mqc.tsv"
significant_markers = config["results_dir"] + "/" + config["<step_name>__radsex_signif_output_dir"] + "/significant_markers_mqc.tsv",
significant_sequences = config["results_dir"] + "/" + config["<step_name>__radsex_signif_output_dir"] + "/significant_markers_sequences.fa",
log:
config["results_dir"]+'/logs/' + config["<step_name>__radsex_signif_output_dir"] + '/radsex_log.txt'
# threads:
......@@ -15,7 +16,9 @@ rule <step_name>__radsex_signif:
"{params.command} "+
"--markers-table {input.markers_table} "+
"--popmap {input.popmap_file} "+
"-o {output} "+
"-o {output.significant_markers} "+
"-d {params.min_depth} " +
"--signif-threshold {params.signif_threshold} "
#"--groups F,M"
"--signif-threshold {params.signif_threshold}; " +
"awk -F\"\\t\" '{{ print \">\"$1\"\\n\"$2 ;}}' {output.significant_markers} > {output.significant_sequences};" +
"awk -F\"\\t\" '{{for(i=1; i<= NF;i++) if (i != 2) printf(\"%s\\t\", $i) ; print $2 ;}}' {output.significant_markers} > {output.significant_markers}.tmp ;" +
"mv {output}.tmp {output.significant_markers}; "
......@@ -21,7 +21,9 @@
],
outputs:
[
{ name: significant_markers, type: "tsv", file: "significant_markers_mqc.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" },
{ name: significant_sequences, type: "fasta", file: "significant_markers_sequences.fa", description: "The fasta sequences of significant markers" },
],
options:
[
......
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