Skip to content

Commit

Permalink
pipeline.nf: adjusting to new parameters required by get_best_motif; …
Browse files Browse the repository at this point in the history
…get_motif_seq
  • Loading branch information
renewiegandt committed Jan 9, 2019
1 parent ea2e171 commit 8e5049e
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ bigwig_input.combine(bed_input).set{footprint_in}
This process uses the uncontinuous score from a bigWig file to estimate footpints within peaks of interest
*/
process footprint_extraction {
conda "${path_env}"
//conda "${path_env}"

tag{name}
publishDir "${params.out}/1.1_footprint_extraction/", mode: 'copy', pattern: '*.bed'
Expand All @@ -214,7 +214,7 @@ for_tfbs = fa_overlap.combine(db_for_motivscan).combine(bed_for_tfbsscan)
*/
process extract_known_TFBS {

conda "${path_env}"
//conda "${path_env}"

publishDir "${params.out}/1.2_filter_motifs/TFBSscan/", mode: 'copy', pattern: '*.bed'

Expand Down Expand Up @@ -250,7 +250,7 @@ if(params.tfbs_path == "") {
/*
*/
process overlap_with_known_TFBS {
conda "${path_env}"
//conda "${path_env}"
publishDir "${params.out}/1.2_filter_motifs/compareBed/", mode :'copy'

input:
Expand All @@ -272,8 +272,8 @@ process overlap_with_known_TFBS {
Reduce each sequence to its most conserved region.
*/
process reduce_sequence {
conda "${path_env}"
echo true
//conda "${path_env}"

publishDir "${params.out}/2.1_clustering/reduced_bed/", mode: 'copy'

input:
Expand All @@ -293,7 +293,7 @@ process reduce_sequence {
Cluster all sequences. Appends a column with cluster numbers to the bed-file.
*/
process clustering {
conda "${path_env}"
//conda "${path_env}"
echo true

publishDir "${params.out}/2.1_clustering/", mode: 'copy', pattern: '*.bed'
Expand All @@ -316,7 +316,7 @@ Converting BED-File to one FASTA-File per cluster
*/
process bed_to_clustered_fasta {

conda "${path_env}"
//conda "${path_env}"
publishDir "${params.out}/2.2_motif_estimation/fasta/", mode: 'copy'
tag{name}

Expand Down Expand Up @@ -347,7 +347,7 @@ process glam2 {

tag{name}
publishDir "${params.out}/2.2_motif_estimation/glam2/", mode: 'copy'
conda "${path_env}"
//conda "${path_env}"

input:
set name, file (fasta) from fasta_for_glam2
Expand All @@ -373,7 +373,7 @@ The paths are sorted numerically depending on the cluster ID.
process merge_meme {

publishDir "${params.out}/2.2_motif_estimation/cluster_motifs/merged_meme/", mode: 'copy'
conda "${path_env}"
//conda "${path_env}"

input:
val (memelist) from meme_to_merge.toList()
Expand Down Expand Up @@ -406,7 +406,7 @@ process find_similar_motifs {

tag{name}
publishDir "${params.out}/2.2_motif_estimation/cluster_motifs/cluster_similarity/", mode: 'copy'
conda "${path_env}"
//conda "${path_env}"

input:
set name, file (meme) ,file (merged_meme) from to_find_similar_motifs
Expand All @@ -429,7 +429,7 @@ Label first column of TSV-file with Cluster ID
process label_cluster {

tag{name}
conda "${path_env}"
//conda "${path_env}"

input:
set name, file (tsv) from motif_similarity
Expand Down Expand Up @@ -480,7 +480,7 @@ Merging FASTA-files of similar clusters
*/
process merge_fasta {

conda "${path_env}"
//conda "${path_env}"
publishDir "${params.out}/2.2_motif_estimation/cluster_motifs/merged_fasta/", mode: 'copy'

input:
Expand Down Expand Up @@ -511,7 +511,7 @@ process clustered_glam2 {

publishDir "${params.out}/2.2_motif_estimation/cluster_motifs/glam2/", mode: 'copy'
tag{name}
conda "${path_env}"
//conda "${path_env}"

input:
file (fasta) from motif_clustered_fasta_flat
Expand Down Expand Up @@ -555,7 +555,7 @@ process tomtom {

tag{name}
publishDir "${params.out}/2.2_motif_estimation/tomtom/", mode: 'copy'
conda "${path_env}"
//conda "${path_env}"

input:
set name, file (meme) from for_tomtom
Expand Down Expand Up @@ -601,7 +601,7 @@ process check_for_unknown_motifs {
//Get the best (first) X Motifs from each MEME-file
process get_best_motif {

conda "${path_env}"
//conda "${path_env}"
tag{name}
publishDir "${params.out}/2.2_motif_estimation/best_unknown_motifs/", mode: 'copy'

Expand All @@ -612,27 +612,29 @@ process get_best_motif {
set name, file('*_best.meme') into best_motif

script:
cluster_id = name.split('_')[-1]
"""
python ${path_bin}/2.2_motif_estimation/get_best_motif.py ${meme} ${name}_best.meme ${params.best_motif}
python ${path_bin}/2.2_motif_estimation/get_best_motif.py ${meme} ${name}_best.meme ${params.best_motif} ${cluster_id}
"""
}


process get_best_motif_seq {

conda "${path_env}"
//conda "${path_env}"
tag{name}
publishDir "${params.out}/2.2_motif_estimation/best_unknown_motifs/motif_sequences/", mode: 'copy'

input:
set name, file(txt) from seq_to_json
set name, file (txt) from seq_to_json

output:
file('*.json')
file("${name}_seq.json")

script:
cluster_id = name.split('_')[-1]
"""
Rscript ${path_bin}/2.2_motif_estimation/ get_motif_seq.R -i ${txt} -o ${name}_seq.json -n ${þærams.best_motif}
Rscript ${path_bin}/2.2_motif_estimation/get_motif_seq.R -i ${txt} -o ${name}_seq.json -n ${params.best_motif} -t ${path_bin}/2.2_motif_estimation/tmp/cluster_${cluster_id} -c ${cluster_id}
"""
}

Expand All @@ -641,7 +643,7 @@ best_motif.combine(fa_scan).set {files_for_genome_scan}

/*
process genome_scan {
conda "${path_env}"
//conda "${path_env}"
input:
set name, file(meme), file(fasta) from files_for_genome_scan
Expand Down Expand Up @@ -670,7 +672,7 @@ process cluster_quality {


process create_GTF {
conda "${path_env}"
//conda "${path_env}"

publishDir "${params.out}/3.1_create_gtf/", mode: 'copy'

Expand Down

0 comments on commit 8e5049e

Please sign in to comment.