Skip to content

Commit 3e31b1d

Browse files
author
Nuwah12
committed
correct homer
1 parent 6b64831 commit 3e31b1d

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

wdl_tasks/peak_calling.wdl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ task EstimateFragSize {
1313
Int mem = 50
1414
}
1515

16-
command <<<
17-
bash <<'EOF'
18-
FRAGSIZE=$(homer findPeaks -style factor -size given -input ~{bam} 2>/dev/null \
19-
| grep 'fragment length' \
20-
| awk '{print $NF}')
16+
command <<<
17+
set -euo pipefail
18+
19+
# Make tag directory
20+
makeTagDirectory tagdir ~{bam} -format sam
21+
22+
# Extract fragment size from HOMER tagInfo.txt
23+
FRAGSIZE=$(grep "fragmentLengthEstimate=" tagdir/tagInfo.txt | awk -F'=' '{print $2}')
24+
25+
# Write to file for Cromwell output
2126
echo "$FRAGSIZE" > fragsize.txt
22-
EOF
2327
>>>
2428

2529
output {

0 commit comments

Comments
 (0)