Skip to content

Reads, calls and genes

You have aligned reads (a BAM with its .bai), variant calls (a VCF, gzipped or not) and an annotation (GFF3 or GTF).

karyon rpoB reads.bam genes.gff3 calls.vcf.gz -o rpoB.svg

The depth of the reads over the gene rpoB, the gene as an arrow, and seven calls as lollipops The same figure on the dark page

  • reads depth: how many reads cover each base. The dip is a stretch no read covers.
  • genes: each gene once, with its name and its direction.
  • calls: each variant at its position, as tall as its allele frequency, coloured by the consequence an annotator wrote in its ANN, BCSQ or CSQ, as snpEff, bcftools csq and Ensembl VEP write them, from the most damaging down, or by its shape, a substitution, an insertion or a deletion, where none is written.

Change it

To Write
See the reads, not their depth --pileup reads.bam
See the bases, zoomed in NC_000962.3:761,100-761,200 --pileup reads.bam ref.fa
Number the gene's codons, from its CDS, zoomed in NC_000962.3:761,081-761,200 in place of rpoB, and ref.fa --codons after the files; the CDS is read from genes.gff3, which stays on the line
Draw a wider stretch NC_000962.3:755,000-770,000 in place of rpoB
Draw two genes, one under the other rpoB rpoC in place of rpoB
Draw two genes side by side rpoB rpoC in place of rpoB, and --panel-columns 2
Shade a stretch through every track, named over it --shade NC_000962.3:761,082-761,162=RRDR
Make a row taller reads.bam --height 100
Rename a row calls.vcf.gz --label "variant calls"
Every call in one colour, each consequence keeping its shape, for up to four consequences in view calls.vcf.gz --color '#8b0000'

The example files: reads.bam, reads.bam.bai, genes.gff3, calls.vcf.gz, calls.vcf.gz.tbi and ref.fa. The two indexes are read from beside their files, the .bai for the reads over the gene and the .tbi for its calls, so a gene out of a whole genome's reads and calls draws about as fast as these do. Every option: karyon help coverage, or the command line reference.