-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path4_alignment_bowtie2.txt
49 lines (30 loc) · 1.76 KB
/
4_alignment_bowtie2.txt
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
#warming_AK
#Adriana L. Romero-Olivares' protocol for processing RNAseq data of soil
#Section 4
#File name: 4_align_bowtie2
#Step: Alignment of reads with bowtie2
#this protocol uses bowtie2 as a tool to align reads to the reference meta-transcriptome assembled with Trinity
#first build an index for the reference meta-transcriptome
module load bowtie2/2.2.7
module load samtools/1.3
bowtie2-build Trinity_ALL_f.Trinity.fasta Trinity_ALL_f.Trinity_output.fasta
#next, align reads from control and treatment on separate processes
#here, I ran two different alignments, one for control samples and one for treatment samples
#you will need paired and unpaired files generated with Trimommatic on step 1
#for control
module load bowtie2/2.2.7
module load samtools/1.3
bowtie2 --local --rf -p 45 -x Trinity_ALL_f.Trinity_output.fasta -1 file_trimmed.r1_paired.fq -2 file_trimmed.r2_paired.fq -U file_trimmed.r1_unpaired.fq,file_trimmed.r2_unpaired.fq -S bowtie2.CALL_aligned_rf.sam
#for treatment
module load bowtie2/2.2.7
module load samtools/1.3
bowtie2 --local --rf -p 45 -x Trinity_ALL_f.Trinity_output.fasta -1 file_trimmed.r1_paired.fq -2 file_trimmed.r2_paired.fq -U file_trimmed.r1_unpaired.fq,file_trimmed.r2_unpaired.fq -S bowtie2.WALL_aligned_rf.sam
#convert files from sam to bam
module load samtools/1.3
samtools view -bS -@5 bowtie2.CALL_aligned_rf.sam > bowtie2.CALL_aligned_rf.bam
samtools view -bS -@5 bowtie2.WALL_aligned_rf.sam > bowtie2.WALL_aligned_rf.bam
#sort bam files
module load samtools/1.3
samtools sort -@20 -n -o bowtie2.CALL_sorted_rf.bam bowtie2.CALL_aligned_rf.bam
samtools sort -@20 -n -o bowtie2.WALL_sorted_rf.bam bowtie2.WALL_aligned_rf.bam
#files _sorted_rf.bam are used for downstream analyses