Simple use cases for Karma

The shortest possible command list for mapping base space fastq files is:
  • karma --createIndex --reference reference.fa
  • karma --reference reference.fa reads.fastq
If you additionally wish to map color space files (AB SOLiD), you do this instead:
  • karma --colorSpace --createIndex --reference referenceCS.fa
  • karma --colorSpace --reference referenceCS.fa reads.fastq

Mapping Single End Files

For this example, we'll assume the index has been created , and stored in a default location, you are ready to use Karma.

Assuming you have one or more read files with the names reads1.fastq, reads2.fastq and so on, you just do this:


karma reads1.fastq reads2.fastq
In this example, four files will be created: reads1.srm.sam, reads1.srm.stats, reads2.srm.sam and reads2.srm.stats.

The files with the .sam suffix are the SAM format output files. The files with the .stats suffix are files with some basic statistics about the read data.

Mapping Paired End Files

Besides the single command line option --pairedReads, the only difference between single end and paired end reads is that karma reads sets of two files at a time from the command line, so you need to have an even number of files specified.

Here's the simplest example, assuming that pair1.fastq and pair2.fastq are two corresponding paired end FASTQ base space format files.


karma --pairedReads pair1.fastq pair2.fastq

The result will be two files, pair1.srm.sam and pair1.srm.stats written to the current working directory.

Common variations

Any fastq reads file may have the .gz suffix, which will be taken to mean the file is gzip compressed, and will be uncompressed on the fly. Hence you can use the shorthand:


karma --pairedReads pair1.fastq.gz pair2.fastq.gz

By default, KARMA writes a SAM output record for every record it reads, regardless of the mapping result. If there are errors, it indicates this in the optional fields at the end of the SAM record.

Frequently, it may be useful to filter reads by map quality. To do this, use the --minimumMapQuality option:


karma --minimumMapQuality 60 --pairedReads pair1.fastq.gz pair2.fastq.gz
The above example will write sequences that were mapped with quality 60 and above.