Assume for all instances below that a single FASTA reference
ref.fasta
and a single FASTQ read file
reads.fastq
are in the same directory as the program executable
Running
bowtie
:
- Build the index
-
bowtie-build ref.fasta reference
- Single-end alignments
-
bowtie -S reference reads.fastq output.sam
(-S
required for SAM output)
Running
bwa
- Build the index
- Single-end alignment
-
bwa aln ref.fasta reads.fastq > output.sai
- Convert to SAM
-
bwa samse ref.fasta output.sai reads.fastq > output.sam
Running
Mosaik
- Build the index
-
MosaikBuild -fr ref.fasta -oa ref.dat
- Convert the reads
-
MosaikBuild -q reads.fastq -out reads.dat -st illumina
(illumina
is the machine the reads were produced by)
- Single-end alignments
-
MosaikAligner -in reads.dat -out output.dat -ia ref.dat -hs 14 -act 17 -mm 2 unique
- Convert to SAM
-
MosaikText -in output.dat -sam output.sam
Note that the above was adapted from the
Build
and
Align
scripts from in the
data
directory of the Mosaik download.
If all went well, you should obtain an
output.sam
file, using any of the above programs...
You can then display this using
SAMTools
:
- Index the reference
- Convert SAM to BAM
-
samtools import ref.fasta output.sam output.bam
- Sort the BAM (orders the reads by positions in the reference)
-
samtools sort output.bam sorted
(will create sorted.bam
)
- Index the sorted BAM (unsorted BAM files cannot be indexed)
-
samtools index sorted.bam
- Display
-
samtools tview sorted.bam ref.fasta
On a side note, you can convert a BAM file to a SAM file like so:
-
samtools view sorted.bam > sorted.sam
As typing these can be a real pain, I actually automate the process using batch files...