From 0f88badda6598dde51863fb0e28e54dac00a2d30 Mon Sep 17 00:00:00 2001 From: renewiegandt Date: Wed, 23 Jan 2019 13:15:22 +0100 Subject: [PATCH 1/5] Update parameter names in create_gtf.config --- config/create_gtf.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/create_gtf.config b/config/create_gtf.config index c38afaa..192b793 100644 --- a/config/create_gtf.config +++ b/config/create_gtf.config @@ -1,3 +1,3 @@ params{ - tissue="" + tissues="" } From 4bef5181662c4b5f9cf979127fabcebf382ee0b2 Mon Sep 17 00:00:00 2001 From: renewiegandt Date: Wed, 23 Jan 2019 13:15:41 +0100 Subject: [PATCH 2/5] Update parameter names in footprint_extraction.config --- config/footprint_extraction.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/footprint_extraction.config b/config/footprint_extraction.config index 0661e2a..bcf54cf 100644 --- a/config/footprint_extraction.config +++ b/config/footprint_extraction.config @@ -2,5 +2,5 @@ params{ window_length = 200 step = 100 percentage = 0 - max_bp_between = 6 + gap_penalty = 6 } From 0f0aa589037d577a6d8ef6fdc5d50b5c768771a9 Mon Sep 17 00:00:00 2001 From: renewiegandt Date: Wed, 23 Jan 2019 13:16:15 +0100 Subject: [PATCH 3/5] Update parameter names in moitif_estimation.config --- config/motif_estimation.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/motif_estimation.config b/config/motif_estimation.config index 2445d12..c829265 100644 --- a/config/motif_estimation.config +++ b/config/motif_estimation.config @@ -3,9 +3,9 @@ params { min_seq = 10 //glam2 - motif_min_len = 8 - motif_max_len = 20 - interation = 10000 + motif_min_key = 8 + motif_max_key = 20 + iteration = 10000 //tomtom tomtom_treshold = 0.01 From 7e90339659d092bfafb642dd5aed06c4d8ba3da9 Mon Sep 17 00:00:00 2001 From: renewiegandt Date: Wed, 23 Jan 2019 13:18:32 +0100 Subject: [PATCH 4/5] pipeline.nf: Added check for unknown parameters; update parameter names; if compareBed.sh is not executable chmod +x is called --- pipeline.nf | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/pipeline.nf b/pipeline.nf index 2e60f35..17fae79 100644 --- a/pipeline.nf +++ b/pipeline.nf @@ -35,7 +35,7 @@ params.identity=0.8 params.sequence_coverage=8 params.memory=800 - params.throw_away_seq=9 + params.throw_away_seq=9 params.strand=0 //motif_estimation @@ -60,7 +60,7 @@ //creating_gtf params.organism="" - params.tissue="" + params.tissues="" if (params.bigwig == "" || params.bed == "" || params.organism == "" || params.genome_fasta == "" || params.motif_db == "" || params.config == "" || "${params.help}" != "0" ){ log.info """ @@ -144,20 +144,27 @@ int_params = ["window_length", "step", "min_size_fp", "max_size_fp", "kmer", "aprox_motif_len", "motif_occurence", "min_seq_length", "global", "sequence_coverage", "memory", "throw_away_seq", "strand", "min_seq", "motif_min_key", "motif_max_key", "iteration", - "edge_weight", "best_motif", "min_gap", "gap_penalty", "edge_weight"] + "edge_weight", "best_motif", "min_gap", "gap_penalty", "edge_weight", + "threads", ] req_params = ["bigwig", "bed", "genome_fasta", "motif_db", "config"] +all_params = int_params + req_params + ["organism" , "identity", "tfbsscan_method", + "percentage", "tomtom_treshold", "motif_similarity_thresh", "out", + "tissues", "gtf_path", "cluster_motif", "tfbs_path", "help"] valid_organism = ["hg38", "hg19", "mm9", "mm10"] valid_tfbsscan_methods = ["moods","fimo"] params.each { key, value -> + if (!(all_params.contains(key))){ + println("Warning: Parameter $key is unknown. Please check for typos or the parameter list!") + } if(int_params.contains(key)) { if (!("${value}" ==~ /\d+/ )){ println("ERROR: $key needs to be an Integer") System.exit(2) } } - if(req_params.contains(key)) { + if(req_params.contains(key) || (key == "gtf_path" && value != "") ) { if(!file(value).exists()) { println("ERROR: $key not found. Please check the given path.") System.exit(2) @@ -243,12 +250,20 @@ process overlap_with_known_TFBS { script: if(params.tfbs_path == ""){ """ + if [[ ! -x "${path_bin}/1.2_filter_motifs/compareBed.sh" ]] + then + chmod +x ${path_bin}/1.2_filter_motifs/compareBed.sh + fi python ${path_bin}/1.2_filter_motifs/tfbsscan.py --use ${params.tfbsscan_method} --core ${params.threads} -m ${db} -g ${fasta} -o ./known_tfbs -b ${bed_peaks} ${path_bin}/1.2_filter_motifs/compareBed.sh --data ${bed_footprints} --motifs ./known_tfbs --fasta ${fasta} -o ${name}_unknown.bed -min ${params.min_size_fp} -max ${params.max_size_fp} cp -r ./known_tfbs/ ${params.out}/1.2_filter_motifs/ """ } else { """ + if [[ ! -x "${path_bin}/1.2_filter_motifs/compareBed.sh" ]] + then + chmod +x ${path_bin}/1.2_filter_motifs/compareBed.sh + fi ${path_bin}/1.2_filter_motifs/compareBed.sh --data ${bed_footprints} --motifs ${known_tfbs} --fasta ${fasta} -o ${name}_unknown.bed -min ${params.min_size_fp} -max ${params.max_size_fp} """ } @@ -274,6 +289,9 @@ process reduce_sequence { set name, file ('*.bed') into bed_for_clustering file ('*.log') + when: + params.lalal == "1" + script: """ Rscript ${path_bin}/2.1_clustering/reduce_sequence.R -i ${bed} -k ${params.kmer} -m ${params.aprox_motif_len} -o ${name}_reduced.bed -t ${params.threads} -f ${params.motif_occurence} -s ${params.min_seq_length} --summary reduce_sequence.log From e2494a0d75571826d8a12983bbf69982a763b5b6 Mon Sep 17 00:00:00 2001 From: renewiegandt Date: Wed, 23 Jan 2019 13:23:30 +0100 Subject: [PATCH 5/5] Removed debugging code --- pipeline.nf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pipeline.nf b/pipeline.nf index 17fae79..4e3b4fc 100644 --- a/pipeline.nf +++ b/pipeline.nf @@ -35,7 +35,7 @@ params.identity=0.8 params.sequence_coverage=8 params.memory=800 - params.throw_away_seq=9 + params.throw_away_seq=9 params.strand=0 //motif_estimation @@ -289,9 +289,6 @@ process reduce_sequence { set name, file ('*.bed') into bed_for_clustering file ('*.log') - when: - params.lalal == "1" - script: """ Rscript ${path_bin}/2.1_clustering/reduce_sequence.R -i ${bed} -k ${params.kmer} -m ${params.aprox_motif_len} -o ${name}_reduced.bed -t ${params.threads} -f ${params.motif_occurence} -s ${params.min_seq_length} --summary reduce_sequence.log