Skip to content
Snippets Groups Projects
Verified Commit d17e7d00 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

danpos: add xls > bed convertion

parent 3df18d9c
No related branches found
No related tags found
No related merge requests found
......@@ -181,7 +181,8 @@ process dpeak_bam {
tuple val(file_id), path(bam_ip), path(bam_wce)
output:
tuple val(file_id), path("${file_prefix}/pooled/*.wig"), emit: wig
tuple val(file_id), path("${file_prefix}/*.wig"), emit: wig
tuple val(file_id), path("${file_prefix}/*.bed"), emit: bed
tuple val(file_id), path("${file_prefix}"), emit: folder
script:
......@@ -208,6 +209,10 @@ danpos.py dpeak -m ${m} \
-b ${bam_wce} \
-o ${file_prefix} \
${bam_ip}
mv ${file_prefix}/pooled/* ${file_prefix}/
rm -R ${file_prefix}/pooled
awk -v FS='\t' -v OFS='\t' 'FNR > 1 { print \$1, \$2-1, \$3, "Interval_"NR-1, \$6, "+" }' ${file_prefix}/${bam_ip.simpleName}.bgsub.peaks.xls > ${file_prefix}/${bam_ip.simpleName}.bgsub.positions.bed
awk -v FS='\t' -v OFS='\t' 'FNR > 1 { print \$1, \$4-1, \$4, "Interval_"NR-1, \$6, "+" }' ${file_prefix}/${bam_ip.simpleName}.bgsub.peaks.xls > ${file_prefix}/${bam_ip.simpleName}.bgsub.positions.summit.bed
"""
}
......@@ -236,7 +241,8 @@ process dpeak_wig {
tuple val(file_id), path(wig_ip), path(wig_wce)
output:
tuple val(file_id), path("${file_prefix}/pooled/*.wig"), emit: wig
tuple val(file_id), path("${file_prefix}/*.wig"), emit: wig
tuple val(file_id), path("${file_prefix}/*.bed"), emit: bed
tuple val(file_id), path("${file_prefix}"), emit: folder
script:
......@@ -263,6 +269,10 @@ danpos.py dpeak -m ${m} \
-b ${wig_wce} \
-o ${file_prefix} \
${wig_ip}
mv ${file_prefix}/pooled/* ${file_prefix}/
rm -R ${file_prefix}/pooled
awk -v FS='\t' -v OFS='\t' 'FNR > 1 { print \$1, \$2-1, \$3, "Interval_"NR-1, \$6, "+" }' ${file_prefix}/${wig_ip.simpleName}.bgsub.peaks.xls > ${file_prefix}/${wig_ip.simpleName}.bgsub.positions.bed
awk -v FS='\t' -v OFS='\t' 'FNR > 1 { print \$1, \$4-1, \$4, "Interval_"NR-1, \$6, "+" }' ${file_prefix}/${wig_ip.simpleName}.bgsub.peaks.xls > ${file_prefix}/${wig_ip.simpleName}.bgsub.positions.summit.bed
"""
}
......
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