Skip to main content
2 of 3
added 5 characters in body
terdon
  • 10.6k
  • 5
  • 23
  • 48

Aligning FASTQs to FASTA reference

I'd like to align some FASTQs to an average mtDNA FASTA file that I have downloaded so I can have the human mtDNA isolated from those FASTQs. For that, I used bowtie2. Can I expect that after running the command bowtie2 -x ref_index -U seq.fastq.gz -S seq.sam my seq.sam will only contain the DNA that I'm interested in (i.e., Human mtDNA)?

I have this example below from a class in which is supposed that the human DNA is discarded (Opposite of what I want). But I don't understand the roles of the line 3. Is it necessary to filter out undesired DNA?

  1. bowtie2 -p $THREADS -x host_DB -1 $FW_READS -2 $RV_READS --un-conc-gz SAMPLE_host_removed > $STUDY-data.sam

  2. samtools view -bS $STUDY-data.sam > $STUDY-data.bam

  3. samtools view -b -f 12 -F 256 $STUDY-data.bam > $STUDY-data-no-human.bam

  4. samtools sort -n -o $STUDY-sorted-data.bam $STUDY-data-no-human.bam 1>> $REPORTS_DIR/report_stdout.txt

  5. samtools fastq -1 $STUDY-reads-r1.fq -2 $STUDY-reads-r2.fq $STUDY-sorted-data.bam 1>> $REPORTS_DIR/report_stdout.txt

dyxcvi
  • 151
  • 5