Skip to content

Commit

Permalink
Merge pull request #72 from drpatelh/master
Browse files Browse the repository at this point in the history
Specify temp dir for sort commands
  • Loading branch information
drpatelh authored Jan 20, 2020
2 parents 58e979d + e7ea781 commit 3e7abf0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### `Fixed`

* [#118](https://github.com/nf-core/chipseq/issues/118) - Running on with SGE
* [#132](https://github.com/nf-core/chipseq/issues/132) - BigWig Error: sort: cannot create temporary file in '': Read-only file system
* Make executables in `bin/` compatible with Python 3

### `Dependencies`
Expand Down
12 changes: 6 additions & 6 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ process MergedLibBigWig {
"""
SCALE_FACTOR=\$(grep 'mapped (' $flagstat | awk '{print 1000000/\$1}')
echo \$SCALE_FACTOR > ${prefix}.scale_factor.txt
genomeCoverageBed -ibam ${bam[0]} -bg -scale \$SCALE_FACTOR $pe_fragment $extend | sort -k1,1 -k2,2n > ${prefix}.bedGraph
genomeCoverageBed -ibam ${bam[0]} -bg -scale \$SCALE_FACTOR $pe_fragment $extend | sort -T '.' -k1,1 -k2,2n > ${prefix}.bedGraph
bedGraphToBigWig ${prefix}.bedGraph $sizes ${prefix}.bigWig
Expand Down Expand Up @@ -1213,7 +1213,7 @@ process MergedLibConsensusPeakSet {
collapsecols = params.narrow_peak ? (["collapse"]*9).join(',') : (["collapse"]*8).join(',')
expandparam = params.narrow_peak ? "--is_narrow_peak" : ""
"""
sort -k1,1 -k2,2n ${peaks.collect{it.toString()}.sort().join(' ')} \\
sort -T '.' -k1,1 -k2,2n ${peaks.collect{it.toString()}.sort().join(' ')} \\
| mergeBed -c $mergecols -o $collapsecols > ${prefix}.txt
macs2_merged_expand.py \\
Expand Down Expand Up @@ -1265,7 +1265,7 @@ process MergedLibConsensusPeakSetAnnotate {
-cpu $task.cpus \\
> ${prefix}.annotatePeaks.txt
cut -f2- ${prefix}.annotatePeaks.txt | awk 'NR==1; NR > 1 {print \$0 | "sort -k1,1 -k2,2n"}' | cut -f6- > tmp.txt
cut -f2- ${prefix}.annotatePeaks.txt | awk 'NR==1; NR > 1 {print \$0 | "sort -T '.' -k1,1 -k2,2n"}' | cut -f6- > tmp.txt
paste $bool tmp.txt > ${prefix}.boolean.annotatePeaks.txt
"""
}
Expand Down Expand Up @@ -1517,7 +1517,7 @@ process MergedRepBigWig {
"""
SCALE_FACTOR=\$(grep 'mapped (' $flagstat | awk '{print 1000000/\$1}')
echo \$SCALE_FACTOR > ${prefix}.scale_factor.txt
genomeCoverageBed -ibam ${bam[0]} -bg -scale \$SCALE_FACTOR $pe_fragment $extend | sort -k1,1 -k2,2n > ${prefix}.bedGraph
genomeCoverageBed -ibam ${bam[0]} -bg -scale \$SCALE_FACTOR $pe_fragment $extend | sort -T '.' -k1,1 -k2,2n > ${prefix}.bedGraph
bedGraphToBigWig ${prefix}.bedGraph $sizes ${prefix}.bigWig
Expand Down Expand Up @@ -1680,7 +1680,7 @@ process MergedRepConsensusPeakSet {
collapsecols = params.narrow_peak ? (["collapse"]*9).join(',') : (["collapse"]*8).join(',')
expandparam = params.narrow_peak ? "--is_narrow_peak" : ""
"""
sort -k1,1 -k2,2n ${peaks.collect{it.toString()}.sort().join(' ')} \\
sort -T '.' -k1,1 -k2,2n ${peaks.collect{it.toString()}.sort().join(' ')} \\
| mergeBed -c $mergecols -o $collapsecols > ${prefix}.txt
macs2_merged_expand.py \\
Expand Down Expand Up @@ -1731,7 +1731,7 @@ process MergedRepConsensusPeakSetAnnotate {
-cpu $task.cpus \\
> ${prefix}.annotatePeaks.txt
cut -f2- ${prefix}.annotatePeaks.txt | awk 'NR==1; NR > 1 {print \$0 | "sort -k1,1 -k2,2n"}' | cut -f6- > tmp.txt
cut -f2- ${prefix}.annotatePeaks.txt | awk 'NR==1; NR > 1 {print \$0 | "sort -T '.' -k1,1 -k2,2n"}' | cut -f6- > tmp.txt
paste $bool tmp.txt > ${prefix}.boolean.annotatePeaks.txt
"""
}
Expand Down

0 comments on commit 3e7abf0

Please sign in to comment.