Skip to content
Snippets Groups Projects
Commit b71f8725 authored by Gael  MILLOT's avatar Gael MILLOT
Browse files

release v8.12: Check added for the metadata file of the meta_path parameter....

release v8.12: Check added for the metadata file of the meta_path parameter. But check the content of the first column of this file remains to be added
parent b3ac8ab1
No related branches found
Tags v8.12
No related merge requests found
...@@ -287,6 +287,11 @@ Special acknowledgement to [Kenneth Hoehn](https://medicine.yale.edu/profile/ken ...@@ -287,6 +287,11 @@ Special acknowledgement to [Kenneth Hoehn](https://medicine.yale.edu/profile/ken
<br /><br /> <br /><br />
## WHAT'S NEW IN ## WHAT'S NEW IN
#### v8.12
Check added for the metadata file of the meta_path parameter. But check the content of the first column of this file remains to be added
#### v8.11 #### v8.11
bugs fixed bugs fixed
......
...@@ -49,7 +49,7 @@ env { ...@@ -49,7 +49,7 @@ env {
*/ */
env { env {
meta_path = "/mnt/c/Users/Gael/Documents/Git_projects/repertoire_profiler/dataset/ig_clustering_test_1/metadata.tsv" // single character string of a valid path of a metadata file for adding additional info to the trees. Write "NULL" if no metadata to add. WARNING: the metadata .tsv table must include a first column named "label" containing sequence names, i.e., the header of some of the fasta files from sample_path, without the ">" of the header. Additionnal columns (quanti or quali) can then be added after the fisrt column to modify the leafs of the tree. For instance: "KD", or Antibody name. Example: tree_meta_path = "/mnt/c/Users/Gael/Documents/Git_projects/repertoire_profiler/dataset/metadata.tsv". Example: tree_meta_path = "NULL" meta_path = "/mnt/c/Users/Gael/Documents/Git_projects/repertoire_profiler/dataset/ig_clustering_test_1/metadata.tsv" // single character string of a valid path of a metadata file for adding additional info to the trees. Write "NULL" if no metadata to add. WARNING: the metadata .tsv table must include a first column named "Label" containing sequence names, i.e., the header of some of the fasta files from sample_path, without the ">" of the header. Additionnal columns (quanti or quali) can then be added after the fisrt column to modify the leafs of the tree. For instance: "KD", or Antibody name. Example: tree_meta_path = "/mnt/c/Users/Gael/Documents/Git_projects/repertoire_profiler/dataset/metadata.tsv". Example: tree_meta_path = "NULL"
meta_name_replacement = "Name" // single character string of the name of the columns of the table indicated in the tree_meta_path parameter. This column will be used to replace the sequence names (header of the fasta files) by more appropriate names. Write "NULL" if not required and if tree_meta_path is not "NULL". Ignored if tree_meta_path = "NULL". Ignored if tree_meta_path = "NULL". Example: tree_meta_name_replacement = "KD". Of note, tree_leaf_size parameter is ignored if tree_meta_name_replacement is a numeric column ,and tree_leaf_shape is ignored if the column is another mode meta_name_replacement = "Name" // single character string of the name of the columns of the table indicated in the tree_meta_path parameter. This column will be used to replace the sequence names (header of the fasta files) by more appropriate names. Write "NULL" if not required and if tree_meta_path is not "NULL". Ignored if tree_meta_path = "NULL". Ignored if tree_meta_path = "NULL". Example: tree_meta_name_replacement = "KD". Of note, tree_leaf_size parameter is ignored if tree_meta_name_replacement is a numeric column ,and tree_leaf_shape is ignored if the column is another mode
meta_legend = "KD" // single character string of the name of the columns of the table indicated in the tree_meta_path parameter. This column will be used to add a legend in trees, in order to visualize an additionnal parameter like KD, names, etc. Ignored if tree_meta_path = "NULL". Example: tree_meta_legend = "KD". Of note, tree_leaf_size parameter is ignored if tree_meta_legend is a numeric column ,and tree_leaf_shape is ignored if the column is another mode meta_legend = "KD" // single character string of the name of the columns of the table indicated in the tree_meta_path parameter. This column will be used to add a legend in trees, in order to visualize an additionnal parameter like KD, names, etc. Ignored if tree_meta_path = "NULL". Example: tree_meta_legend = "KD". Of note, tree_leaf_size parameter is ignored if tree_meta_legend is a numeric column ,and tree_leaf_shape is ignored if the column is another mode
tree_kind = "rectangular" // single character string of the kind of tree. Can be "rectangular", "roundrect", "slanted", "ellipse", "circular", "fan", "equal_angle", "daylight". See https://yulab-smu.top/treedata-book/chapter4.html#tree-layouts tree_kind = "rectangular" // single character string of the kind of tree. Can be "rectangular", "roundrect", "slanted", "ellipse", "circular", "fan", "equal_angle", "daylight". See https://yulab-smu.top/treedata-book/chapter4.html#tree-layouts
......
...@@ -50,8 +50,10 @@ process workflowParam { // create a file with the workflow parameters in out_pat ...@@ -50,8 +50,10 @@ process workflowParam { // create a file with the workflow parameters in out_pat
//Note that variables like ${out_path} are interpreted in the script block //Note that variables like ${out_path} are interpreted in the script block
// next process is for repertoire // next process is for repertoire
process repertoire_names { // cannot be repertoire_names outside of process because the files are present in the docker process igblast_data_check { // cannot be igblast_data_check outside of process because the files are present in the docker
label 'immcantation' label 'immcantation'
//publishDir path: "${out_path}", mode: 'copy', pattern: "{*.tsv}", overwrite: false //publishDir path: "${out_path}", mode: 'copy', pattern: "{*.tsv}", overwrite: false
cache 'true' cache 'true'
...@@ -61,7 +63,7 @@ process repertoire_names { // cannot be repertoire_names outside of process beca ...@@ -61,7 +63,7 @@ process repertoire_names { // cannot be repertoire_names outside of process beca
val igblast_files val igblast_files
output: output:
path "*.tsv", emit: repertoire_names_ch path "*.tsv", emit: igblast_data_check_ch
script: script:
""" """
...@@ -543,6 +545,13 @@ process seq_name_remplacement { ...@@ -543,6 +545,13 @@ process seq_name_remplacement {
stop(paste0("\\n\\n============\\n\\nERROR IN THE seq_name_remplacement PROCESS OF NEXTFLOW\\nIF THE meta_path PARAMETER IS \\"NULL\\", THEN THE SECOND COLUMN OF THE DATA IN THE sample_path PARAMETER CANNOT HAVE THE NAME OF THE SECOND COLUNM STARTING BY \\"initial_\\"\\n\\n============\\n\\n"), call. = FALSE) stop(paste0("\\n\\n============\\n\\nERROR IN THE seq_name_remplacement PROCESS OF NEXTFLOW\\nIF THE meta_path PARAMETER IS \\"NULL\\", THEN THE SECOND COLUMN OF THE DATA IN THE sample_path PARAMETER CANNOT HAVE THE NAME OF THE SECOND COLUNM STARTING BY \\"initial_\\"\\n\\n============\\n\\n"), call. = FALSE)
} }
' |& tee -a seq_name_remplacement.log ' |& tee -a seq_name_remplacement.log
else
Rscript -e '
meta <- read.table("./${meta_file}", sep = "\\t", header = TRUE)
if(names(meta)[1] != "Label"){
stop(paste0("\\n\\n============\\n\\nERROR IN THE seq_name_remplacement PROCESS OF NEXTFLOW\\nIF THE meta_path PARAMETER IS NOT \\"NULL\\", THEN THE FIRST COLUMN OF THE METADATA FILE MUST BE NAMED \\"Label\\" AND BE MADE OF THE NAMES OF THE FASTA SEQUENCES\\n\\n============\\n\\n"), call. = FALSE)
}
' |& tee -a seq_name_remplacement.log
fi fi
if [[ "${meta_file}" != "NULL" && "${meta_name_replacement}" != "NULL" ]] ; then # or [[ "${meta_file}" -ne "NULL" && "${meta_name_replacement}" -ne "NULL" ]], but not != if [[ "${meta_file}" != "NULL" && "${meta_name_replacement}" != "NULL" ]] ; then # or [[ "${meta_file}" -ne "NULL" && "${meta_name_replacement}" -ne "NULL" ]], but not !=
Rscript -e ' Rscript -e '
...@@ -676,7 +685,7 @@ process repertoire { ...@@ -676,7 +685,7 @@ process repertoire {
input: input:
val igblast_database_path val igblast_database_path
path file_assembly_ch path file_assembly_ch
path repertoire_names_ch path igblast_data_check_ch
path cute_file path cute_file
output: output:
...@@ -692,7 +701,7 @@ process repertoire { ...@@ -692,7 +701,7 @@ process repertoire {
repertoire.R \ repertoire.R \
"${igblast_database_path}" \ "${igblast_database_path}" \
"${file_assembly_ch}" \ "${file_assembly_ch}" \
"${repertoire_names_ch}" \ "${igblast_data_check_ch}" \
"${cute_file}" \ "${cute_file}" \
"repertoire.log" "repertoire.log"
""" """
...@@ -1005,6 +1014,7 @@ workflow { ...@@ -1005,6 +1014,7 @@ workflow {
if( ! (file(meta_path).exists()) ){ if( ! (file(meta_path).exists()) ){
error "\n\n========\n\nERROR IN NEXTFLOW EXECUTION\n\nINVALID meta_path PARAMETER IN repertoire_profiler.config FILE (DOES NOT EXIST): ${meta_path}\nIF POINTING TO A DISTANT SERVER, CHECK THAT IT IS MOUNTED\n\n========\n\n" error "\n\n========\n\nERROR IN NEXTFLOW EXECUTION\n\nINVALID meta_path PARAMETER IN repertoire_profiler.config FILE (DOES NOT EXIST): ${meta_path}\nIF POINTING TO A DISTANT SERVER, CHECK THAT IT IS MOUNTED\n\n========\n\n"
} }
print("\n\nWARNING: THE 1st COLUMN OF THE METADATA FILE MUST BE NAMED \"Label\" AND MUST CONTAIN NAMES OF THE FILES IN THE FOLDER OF THE sample_path PARAMETER")
} }
if( ! (meta_name_replacement in String) ){ if( ! (meta_name_replacement in String) ){
error "\n\n========\n\nERROR IN NEXTFLOW EXECUTION\n\nINVALID meta_name_replacement PARAMETER IN repertoire_profiler.config FILE:\n${meta_name_replacement}\nMUST BE A SINGLE CHARACTER STRING\n\n========\n\n" error "\n\n========\n\nERROR IN NEXTFLOW EXECUTION\n\nINVALID meta_name_replacement PARAMETER IN repertoire_profiler.config FILE:\n${meta_name_replacement}\nMUST BE A SINGLE CHARACTER STRING\n\n========\n\n"
...@@ -1149,9 +1159,9 @@ workflow { ...@@ -1149,9 +1159,9 @@ workflow {
// below : those variable are already used in the config file. Thus, to late to check them. And not possible to check inside the config file // below : those variable are already used in the config file. Thus, to late to check them. And not possible to check inside the config file
// out_ini // out_ini
print("\n\nRESULT DIRECTORY: ${out_path}") print("\n\nRESULT DIRECTORY: ${out_path}")
print("\n\nWARNING: PARAMETERS ALREADY INTERPRETED IN THE .config FILE:") //print("\n\nWARNING: PARAMETERS ALREADY INTERPRETED IN THE .config FILE:")
print(" system_exec: ${system_exec}") //print(" system_exec: ${system_exec}")
print(" out_path: ${out_path_ini}") //print(" out_path: ${out_path_ini}")
if("${system_exec}" != "local"){ if("${system_exec}" != "local"){
print(" queue: ${queue}") print(" queue: ${queue}")
print(" qos: ${qos}") print(" qos: ${qos}")
...@@ -1193,14 +1203,11 @@ workflow { ...@@ -1193,14 +1203,11 @@ workflow {
) )
igblast_data_check(
repertoire_names(
igblast_database_path, igblast_database_path,
igblast_files igblast_files
) )
igblast( igblast(
fs_ch, fs_ch,
igblast_database_path, igblast_database_path,
...@@ -1319,7 +1326,7 @@ workflow { ...@@ -1319,7 +1326,7 @@ workflow {
repertoire( repertoire(
igblast_database_path, igblast_database_path,
file_assembly.out.file_assembly_ch, file_assembly.out.file_assembly_ch,
repertoire_names.out.repertoire_names_ch, igblast_data_check.out.igblast_data_check_ch,
cute_file cute_file
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment