-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3.5.sh
executable file
·712 lines (526 loc) · 21.9 KB
/
3.5.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
#!/bin/bash
#SBATCH -J ATACseq
#SBATCH -o %x.out
#SBATCH -n 12
#SBATCH --mem-per-cpu=18000
usage(){
echo "A T A C - S E Q W O R K F L O W - @bixBeta"
echo
echo
echo "Usage: bash" $0 "[-h arg] [-p arg] [-d args] [-t arg] [-g arg] [-q arg] [-a arg] [-Q arg] [-F arg] "
echo
echo "---------------------------------------------------------------------------------------------------------------"
echo "[-h] --> Display Help"
echo "[-p] --> Project Identifier Number"
echo "[-d] --> Comma Spearated Values for Delimiter and Field <delim,field or default> default: _,1 "
echo "[-t] --> Trimming <nextseq or nova>;"
echo "[-g] --> Reference Genome <mm10, hg38, dm6>"
echo "[-a] --> Reference Genome <bwa or bt2 >"
echo "[-q] --> Execute atacQC.R script <yes>"
echo ""
echo "---------------------- MACS2 PARAMS ------------------------"
echo " [-Q] --> macs2 q val cutoff, default = 0.05"
echo " [-F] --> macs2 fold enrichment cutoff, default = 5"
echo "---------------------------------------------------------------------------------------------------------------"
}
declare -A genomeDir
genomeDir=(
["mm10"]="/workdir/genomes/Mus_musculus/mm10/ENSEMBL/BWAIndex/genome.fa" \
["hg38"]="/workdir/genomes/Homo_sapiens/hg38/ENSEMBL/bwa.index/Homo_sapiens.GRCh38.dna.toplevel.fa" \
)
declare -A genomeDirBT2
genomeDirBT2=(
["mm10"]="/workdir/genomes/Mus_musculus/mm10/ENSEMBL/bowtie2index/mm10" \
["hg38"]="" \
["dm6"]="/workdir/genomes/Drosophila_melanogaster/dm6/ENSEMBL/Bowtie2.Index/dm6"
)
declare -A gtfs
gtfs=(
["mm10"]="/workdir/genomes/Mus_musculus/mm10/ENSEMBL/Mus_musculus.GRCm38.96.gtf" \
["hg38"]="/workdir/genomes/Homo_sapiens/hg38/ENSEMBL/Homo_sapiens.GRCh38.96.gtf" \
["dm6"]="/workdir/genomes/Drosophila_melanogaster/dm6/ENSEMBL/Drosophila_melanogaster.BDGP6.32.106.gtf"
)
declare -A gAlias # for compatibility with atacQC.R
gAlias=(
["mm10"]="mouse" \
["hg38"]="human" \
["dm6"]="fly"
)
declare -A gSize # for macs2
gSize=(
["mm10"]="mm" \
["hg38"]="hs" \
["dm6"]="dm"
)
declare -A blkList
blkList=(
["mm10"]="/workdir/genomes/Mus_musculus/mm10/ENSEMBL/no-chr-mm10-blacklist.v2.bed" \
["hg38"]="/workdir/genomes/Homo_sapiens/hg38/ENSEMBL/no-chr-hg38-blacklist.v2.bed" \
["dm6"]="/workdir/tools/blacklists/dm6-blacklist.v2.bed"
)
trimPE(){
cd fastqs
ls -1 *_R1.fastq* > .R1
ls -1 *_R2.fastq* > .R2
paste -d " " .R1 .R2 > Reads.list
readarray fastqs < Reads.list
mkdir fastQC
for i in "${fastqs[@]}"
do
#trim_galore --nextseq 20 --gzip -j 8 --length 50 --paired --fastqc --fastqc_args "-t 4 --outdir ./fastQC" $i
A=`echo $i | cut -d " " -f1`
B=`echo $i | cut -d " " -f2`
iSUB=`echo $i | cut -d ${DELIMITER} -f${FIELD}`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif fastp -z 4 -w 20 \
--length_required 50 --qualified_quality_phred 20 \
--trim_poly_g \
-i $A \
-I $B \
-o ${iSUB}_val_1.fq.gz \
-O ${iSUB}_val_2.fq.gz \
-h ${iSUB}.fastp.html \
-j ${iSUB}.fastp.json
done
mkdir TrimQC_stats trimmed_fastqs
mv *_trimming_report.txt *json *html TrimQC_stats
mv *_val* trimmed_fastqs
mv TrimQC_stats fastQC trimmed_fastqs ../
cd ..
}
trimNovaPE(){
cd fastqs
ls -1 *_1.fq* > .R1
ls -1 *_2.fq* > .R2
paste -d " " .R1 .R2 > Reads.list
readarray fastqs < Reads.list
mkdir fastQC
for i in "${fastqs[@]}"
do
#trim_galore --nextseq 20 --gzip -j 8 --length 50 --paired --fastqc --fastqc_args "-t 4 --outdir ./fastQC" $i
A=`echo $i | cut -d " " -f1`
B=`echo $i | cut -d " " -f2`
iSUB=`echo $i | cut -d ${DELIMITER} -f${FIELD}`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif fastp -z 4 -w 20 \
--length_required 50 --qualified_quality_phred 20 \
--trim_poly_g \
-i $A \
-I $B \
-o ${iSUB}_val_1.fq.gz \
-O ${iSUB}_val_2.fq.gz \
-h ${iSUB}.fastp.html \
-j ${iSUB}.fastp.json
done
mkdir TrimQC_stats trimmed_fastqs
mv *_trimming_report.txt *json *html TrimQC_stats
mv *_val* trimmed_fastqs
mv TrimQC_stats fastQC trimmed_fastqs ..
cd ..
}
alignPE.bwa(){
cd trimmed_fastqs
ls -1 *_val_1.fq.gz > .trR1
ls -1 *_val_2.fq.gz > .trR2
paste -d " " .trR1 .trR2 > Trimmed.list
readarray trimmedFastqs < Trimmed.list
for i in "${trimmedFastqs[@]}"
do
# INDEX="/workdir/genomes/Mus_musculus/mm10/ENSEMBL/BWAIndex/genome.fa"
iSUB=`echo $i | cut -d ${DELIMITER} -f${FIELD}`
bwa mem -t 24 -M -R "@RG\tID:${iSUB}\tSM:${iSUB}\tPL:ILLUMINA\tLB:${iSUB}\tPU:1" ${genomeDir[${DIR}]} $i \
| samtools view -@ 24 -b -h -F 0x0100 -O BAM -o ${iSUB}.bam
done
mkdir primary-BAMS
mv *.bam primary-BAMS
mv primary-BAMS ..
cd ..
}
alignPE.bt2(){
cd trimmed_fastqs
ls -1 *_val_1.fq.gz > .trR1
ls -1 *_val_2.fq.gz > .trR2
paste -d " " .trR1 .trR2 > Trimmed.list
readarray trimmedFastqs < Trimmed.list
for i in "${trimmedFastqs[@]}"
do
iSUB=`echo $i | cut -d ${DELIMITER} -f${FIELD}`
A=`echo $i | cut -d " " -f1`
B=`echo $i | cut -d " " -f2`
(/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif bowtie2 \
--no-unal \
-x ${genomeDirBT2[${DIR}]} \
-1 $A -2 $B \
--threads 12 \
-S - | /workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools view -@ 24 -b -h -F 0x0100 -O BAM -o ${iSUB}.bam)2>${iSUB}.log
done
mkdir primary-BAMS
mv *.bam primary-BAMS
mv primary-BAMS ..
cd ..
}
sort(){
cd primary-BAMS
for i in *.bam
do
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools sort $i > `echo $i | cut -d "." -f1`.sorted.bam
done
for i in *.sorted.bam
do
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools index $i
done
# alignment stats etc. on raw bams
for i in *.sorted.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools flagstat $i > ${iSUB}.primary.flagstat
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools idxstats $i > ${iSUB}.primary.idxstats
done
mkdir primary_stats
mv *.primary.flagstat *.primary.idxstats primary_stats/
cd ..
pwd
}
rmMT(){
cd primary-BAMS
for i in *.sorted.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools view -H `ls -1 *.sorted.bam | head -1` | cut -f2 | grep "SN:" | cut -d ":" -f2 | grep -v "MT\|_\|\." | xargs /workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools view -b $i > ${iSUB}.noMT.bam
done
for i in *.noMT.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools index $i
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools flagstat $i > ${iSUB}.noMT.flagstat
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools idxstats $i > ${iSUB}.noMT.idxstats
done
mkdir noMT_stats
mv *noMT.flagstat *noMT.idxstats noMT_stats/
for i in *.noMT.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif bedtools intersect -v -a $i -b ${blkList[${DIR}]} > ${iSUB}.noBlacklist.noMT.bam
done
# for i in *.noBlacklist.noMT.bam
# do
# iSUB=`echo $i | cut -d "." -f1`
# /workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools index $i
# /workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools flagstat $i > ${iSUB}.noBlacklist.noMT.flagstat
# /workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools idxstats $i > ${iSUB}.noBlacklist.noMT.idxstats
# done
# mkdir noBLK_stats
# mv *.noBlacklist.noMT.flagstat *.noBlacklist.noMT.idxstats noBLK_stats/
cd ..
}
markDups(){
cd primary-BAMS
for i in *.noBlacklist.noMT.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif java -jar /myBin/picard.jar \
MarkDuplicates \
INPUT=$i \
OUTPUT=${iSUB}.dupMarked.noBlacklist.noMT.bam \
ASSUME_SORTED=true \
REMOVE_DUPLICATES=false \
METRICS_FILE=${iSUB}.MarkDuplicates.metrics.txt \
VALIDATION_STRINGENCY=LENIENT \
TMP_DIR=tmp
done
cd ..
}
dedupBAM(){
cd primary-BAMS
# alignment stats etc. on dupMarked no MT bams
for i in *.dupMarked.noBlacklist.noMT.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools index $i
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools flagstat $i > ${iSUB}.noBlacklist.noMT.flagstat
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools idxstats $i > ${iSUB}.noBlacklist.noMT.idxstats
done
for i in *.dupMarked.noBlacklist.noMT.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools view -b -h -F 0X400 $i > ${iSUB}.DEDUP.bam
done
for i in *.DEDUP.bam; do /workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools index $i ; /workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools idxstats $i > `echo $i | cut -d "." -f1`.DEDUP.idxstats; done
for i in *.DEDUP.bam; do /workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools flagstat $i > `echo $i | cut -d "." -f1`.DEDUP.flagstat; done
multiqc -n ${PIN}.multiqc.report .
mkdir dedup-BAMS
mv *.DEDUP* dedup-BAMS/
mv dedup-BAMS ..
cd ..
}
tagDir(){
cd dedup-BAMS
for i in *.DEDUP.bam
do
iSUB=`echo "$i" | cut -d'.' -f1` # subset to rename
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif makeTagDirectory "$iSUB".tag.dir "$i"
done
cd ..
}
callPeak(){
cd dedup-BAMS
echo "calling peaks on DEDUP bams"
echo "qval cutoff = $QVAL"
echo "fe cutoff = $FE"
mkdir peaks.OUT
#export PYTHONPATH=/programs/macs2-2.2.7.1-r9/lib64/python3.9/site-packages
#export PATH=/programs/macs2-2.2.7.1-r9/bin:$PATH
for i in *.DEDUP.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif macs2 callpeak -t $i \
-f BAMPE \
-n ${iSUB} \
-g ${gSize[${DIR}]} \
-q ${QVAL} \
--outdir peaks.OUT \
--nomodel --shift 37 --ext 73 \
--fe-cutoff ${FE} \
--keep-dup all
done
cd ..
}
mergedPeaks(){
echo "running module mergedPeaks"
echo "qval cutoff = $QVAL"
echo "fe cutoff = $FE"
cd dedup-BAMS
allBams=`echo *.DEDUP.bam`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif macs2 callpeak -t ${allBams} \
-f BAMPE \
-n allSamplesMergedPeakset \
-g ${gSize[${DIR}]} \
-q ${QVAL} \
--outdir peaks.OUT \
--nomodel --shift 37 --ext 73 \
--fe-cutoff ${FE} \
--keep-dup all
cd ..
}
saf(){
# awk 'BEGIN{FS=OFS="\t"; print "GeneID\tChr\tStart\tEnd\tStrand"}{print $4, $1, $2+1, $3, "."}' ${sample}_peaks.narrowPeak > ${sample}_peaks.saf
cd dedup-BAMS/peaks.OUT
awk 'BEGIN{FS=OFS="\t"; print "GeneID\tChr\tStart\tEnd\tStrand"}{print $4, $1, $2+1, $3, "."}' allSamplesMergedPeakset_peaks.narrowPeak > allSamplesMergedPeakset.saf
cd ../../
}
#saf
frip(){
# featureCounts -p -a ${sample}_peaks.saf -F SAF -o readCountInPeaks.txt ${sample}.sorted.marked.filtered.shifted.bam
cd dedup-BAMS/
for i in *.DEDUP.bam
do
iSUB=`echo $i | cut -d "." -f1`
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif featureCounts -p -a peaks.OUT/allSamplesMergedPeakset.saf -F SAF -o "${iSUB}".readCountInPeaks.txt $i
done
cd ..
}
annotatePeaks(){
cd dedup-BAMS/peaks.OUT
/workdir/TREx_shared/projects/CHIP_ATAC_V3.sif annotatePeaks.pl allSamplesMergedPeakset.saf ${DIR} -gtf ${gtfs[${DIR}]} > allSamplesMergedPeakset.Annotated.saf
cd ../..
}
bedGraphs(){
cd dedup-BAMS
for i in *.tag.dir
do
/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif makeUCSCfile ${i} -o auto -fsize 1e10 -res 1 -color 106,42,73 -style chipseq
done
mkdir tagDirs
mv *.tag.dir tagDirs
cd tagDirs
mkdir bedGraphs
for i in *.tag.dir
do
cd $i
zcat *.ucsc.bedGraph.gz | awk '{if(NR>1) print "chr"$0; else print $0}' | gzip > `basename *.ucsc.bedGraph.gz .ucsc.bedGraph.gz`.ucsc.bg.gz
mv *.ucsc.bg.gz ../bedGraphs
cd ..
done
cd ..
mkdir featureCounts
mv *.txt featureCounts
multiqc -n ${PIN}.FRIP.multiqc.report -b "Please note that the featureCounts M Assigned Column refers to Fragments and Not Reads" --ignore tagDirs --ignore peaks.OUT .
cd ..
}
atacQC(){
cd dedup-BAMS
echo "genome alias" = ${gAlias[${DIR}]}
/workdir/TREx_shared/projects/CHIP_ATAC_V2.sif atacQC.R ${gAlias[${DIR}]}
# ${gAlias[${DIR}]}
/workdir/TREx_shared/projects/CHIP_ATAC_V2.sif html.atacQC.sh `echo ${PIN}_atacQC`
cd ..
/workdir/TREx_shared/projects/CHIP_ATAC_V2.sif tree > folder.structure
}
while getopts "hp:t:g:q:d:a:Q:F:" opt; do
case ${opt} in
h)
echo
echo
echo
usage
echo
echo
exit 1
;;
p )
PIN=$OPTARG
echo "Project Identifier = " $PIN
;;
t )
T=$OPTARG
;;
g)
DIR=$OPTARG
;;
q)
QC=$OPTARG
;;
d)
DELIM=$OPTARG
;;
a)
AL=$OPTARG
;;
Q)
QVAL=$OPTARG
;;
F)
FE=$OPTARG
;;
\? )
echo
echo
echo
usage
;;
esac
done
# shift $((OPTIND -1))
#-------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------------------
## check if PIN is provided
if [[ -z "${PIN+x}" ]]; then
PIN="PIN_Null"
fi
# PARAMETER CHECKS
#-------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------------------
## check if delimiter parameter exists
if [[ ! -z "${DELIM+x}" ]]; then
#statements
if [[ $DELIM == default ]]; then
DELIMITER="_"
FIELD="1"
echo "file naming will be done using the default delimiter settings"
else
DELIMITER=`echo $DELIM | cut -d , -f1`
FIELD=`echo $DELIM | cut -d , -f2-`
echo "file naming will be done using the delim = $DELIMITER and field = $FIELD settings"
fi
fi
#-------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------------------
## check if trimming parameter exists
if [[ ! -z "${T+x}" ]]; then
if [[ $T == nextseq ]]; then
trimPE
elif [[ $T == nova ]]; then
trimNovaPE
else
echo "-t only accepts nextseq or nova as arguments"
exit 1
fi
fi
#-------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------------------
# check if macs2 cutoffs are provided
if [[ -z "${QVAL+x}" ]]; then
QVAL=0.05
fi
if [[ -z "${FE+x}" ]]; then
FE=5
fi
#-------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------------------
## check if genomeDir provided
if [[ ! -z "${DIR+x}" ]]; then
if [ ${genomeDir[${DIR}]+_} ]; then
echo Reference genome selected = $DIR
echo
if [[ ! -z "${AL+x}" ]]; then
if [[ $AL == bwa ]]; then
alignPE.bwa
sort
rmMT
markDups
dedupBAM
callPeak
mergedPeaks
saf
frip
tagDir
annotatePeaks
bedGraphs
elif [[ $AL == bt2 ]]; then
alignPE.bt2
sort
rmMT
markDups
dedupBAM
callPeak
mergedPeaks
saf
frip
tagDir
annotatePeaks
bedGraphs
else
echo "Please specify the available genome aligner (bt2 or bwa)"
exit 1
fi
fi
else
echo "The reference genome provided '"$DIR"' is not available"
exit 1
fi
fi
if [[ ! -z "${QC+x}" ]]; then
if [[ $QC == yes ]]; then
atacQC
else
echo "-q option only accepts yes as an argument"
exit 1
fi
fi
#-------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------------------
if [[ -z $1 ]] || [[ $1 = "help" ]] ; then
#statements
echo
echo
usage
echo
echo
exit 1
else
echo >> 3.5.atac.log
echo `date -u` >> 3.5.atac.log
echo "Project Identifier Specified = " $PIN >> 3.5.atac.log
echo "Reference Genome Specified = " $DIR >> 3.5.atac.log
echo "Trimming = " $T >> 3.5.atac.log
echo "macs2 qval cutoff = " $QVAL >> 3.5.atac.log
echo "macs2 fe cutoff = " $FE >> 3.5.atac.log
echo >> 3.5.atac.log
echo "ENV INFO: " >> 3.5.atac.log
echo >> 3.5.atac.log
echo "BT2 version:" `/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif bowtie2 --version | head -1 | cut -d ' ' -f3` >> 3.5.atac.log
echo "BWA version: 0.7.17-r1188" >> 3.5.atac.log
echo "multiqc version:" `/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif multiqc --version | cut -d ' ' -f3` >> 3.5.atac.log
echo "samtools version:" `/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif samtools --version | head -1 | cut -d ' ' -f2` >> 3.5.atac.log
echo "macs2 version:" `/workdir/TREx_shared/projects/CHIP_ATAC_DEV.sif macs2 --version | cut -d ' ' -f2` >> 3.5.atac.log
echo "HOMER version: 4.11.1" >> 3.5.atac.log
echo "--------------------------------------------------------------------------------------------------" >> 3.5.atac.log
fi