Hello guys
I have 100-bp PE reads for chip-seq, and the reads were aligned using bwa. The alignment results - the sam file - was further processed with samtools. I used the following commands to filter out properly paired reads with unique mappability, but not sure if I am doing it in a correct way. Could you give me some suggestion for that? Thank you!
The file immediately after bwa alignment is after_align.sam. Then I used:
1.samtools view -bSh after_align.sam >after_align.bam
2.samtools view -q 1 after_align.bam -o uniq.bam
3.samtools rmdup uniq.bam uniq.rmdup.bam
4.samtools view -f 0x0001 -f 0x0002 uniq.rmdup.bam -o paired.bam # this is to get properly paired reads
5.samtools sort -n paired.bam paired_sort_name
6.samtools fixmate paired_sort_name.bam fixmate.bam#fixmate.. do I need to do this?
Did I miss anything ? Is there anything to add?
Thank you!
I have 100-bp PE reads for chip-seq, and the reads were aligned using bwa. The alignment results - the sam file - was further processed with samtools. I used the following commands to filter out properly paired reads with unique mappability, but not sure if I am doing it in a correct way. Could you give me some suggestion for that? Thank you!
The file immediately after bwa alignment is after_align.sam. Then I used:
1.samtools view -bSh after_align.sam >after_align.bam
2.samtools view -q 1 after_align.bam -o uniq.bam
3.samtools rmdup uniq.bam uniq.rmdup.bam
4.samtools view -f 0x0001 -f 0x0002 uniq.rmdup.bam -o paired.bam # this is to get properly paired reads
5.samtools sort -n paired.bam paired_sort_name
6.samtools fixmate paired_sort_name.bam fixmate.bam#fixmate.. do I need to do this?
Did I miss anything ? Is there anything to add?
Thank you!