Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Now, we're ready to execute the actual alignment, with the goal of producing a SAM/BAM file from the input FASTQ files and reference.  We will first generate SAI files from each of the FASTQ files with the reference individually using the 'aln' command, then combine them (with the reference) into one SAM/BAM output file using the 'sampe' command.   We need a directory to put the alignments when they are finished, as well as any intermediate files, so create a directory called 'alignments'.  The command flow, all together, is as follows:. Notice how each file is in its proper directory, which requires us to specify the whole file path in the alignment commands.

Code Block
cds
mkdir alignments
bwa aln references/yeast/sacCer3.fa fastq_align/Sample_Yeast_L005_R1.cat.fastq.gz > alignments/yeast_R1.sai
bwa aln references/yeast/sacCer3.fa fastq_align/Sample_Yeast_L005_R2.cat.fastq.gz > alignments/yeast_R2.sai
bwa sampe references/yeast/sacCer3.fa alignments/yeast_R1.sai alignments/yeast_R2.sai fastq_align/Sample_Yeast_L005_R1.cat.fastq.gz fastq_align/Sample_Yeast_L005_R2.cat.fastq.gz > alignments/yeast_pairedend.sam

Notice how each file is in its proper directory, which requires us to specify the whole file path in the alignment commandsYou did it!  In the alignments directory, there should exist the two intermediate files (the SAI files), along with the SAM file that contains the alignments.  It's just a text file, so take a look with head, more, less, tail, or whatever you feel like.  In the next section, with samtools, you'll learn some additional ways to analyze the data.

OptionEffectBest Practice Setting
-k  
-n  
-l  
-t  

...