forked from TheJacksonLaboratory/ATAC-seq
-
Notifications
You must be signed in to change notification settings - Fork 2
/
make_atac_seq_shifted_bam_8_cleanup.sh
executable file
·56 lines (48 loc) · 1.79 KB
/
make_atac_seq_shifted_bam_8_cleanup.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
#!/bin/bash
# Aligning fastq files to the genome and creating shifted_sorted.bam file -- preprocessing for ATAC-seq
# ahead of peak calling
#
# STEP 6 of 6
#
# Name : make_atac_seq_shifted_bam_6_cleanup.sh
#
# Purpose: This routine removes all the trim and trimU fastq files (intermediate files that may be reproduced)
# It also removes all sam files, and the unsorted bam file, also all .o and .e files for readibility.
#
# Author:
# Asli Uyar, PhD
# Shane Sanders, PhD
# Anne Deslattes Mays, PhD
#
# Date: 2016 October 10
#
# Call: make_atac_seq_shifted_bam_6_cleanup.sh <ATAC-Seq Banchereau-Lab/GT-delivery/ATAC-seq directory (with trailing /> ]
#
# Assumptions:
#
# 1. code has been checked out - fastqc has been run - working directory created
# 2. we are in the same directory as the scripts.
# 3. trimmomatic has been run
# 4. bwa has been run
# 5. shifted_bam has been called to make the sam file correct for ATAC_seq
# 6. the shifted_bam script and bedtobam has been called so all that is left to do is cleanup!
#
#
#-------------------------------------------------------------------------------------
#dataDIR=$1 #ARGV, contains folder with FASTQ files, right now needs trailing /
scriptDIR=$(pwd)
workingDIR=$scriptDIR/working
trimmomaticDIR=$workingDIR/trimmomatic/
bwaDIR=$trimmomaticDIR/adapterTrimmed/bwa
rm $scriptDIR/*.o*
rm $scriptDIR/*.e*
rm $workingDIR/*.o*
rm $workingDIR/*.e*
rm $trimmomaticDIR/*.o*
rm $trimmomaticDIR/*.e*
rm $trimmomaticDIR/*.trim.*
rm $trimmomaticDIR/*.trimU.*
rm $trimmomaticDIR/adapterTrimmed/*.trim.*
rm $bwaDIR/*.sam
rm $bwaDIR/*shifted.bam
echo "done with STEP 6 cleanup is complete all is done with make_atac_seq_shifted_bam"