Package: dnacol
Color DNA/RNA bases, protein amino acid codes and quality scores in terminal outputAboutThis is a python script to color DNA, RNA and protein sequences in the terminal.
If called usingdnacol, it will read lines from STDIN or from a file and color all strings of
DNA/RNA it can find. In addition, it can also color phred-encoded
quality scores in FASTQ/SAM files.
If called usingpcol, it will instead color protein sequences encoded as amino acid one-letter codes.ScreenshotsFormat-specific coloringBy default,dnacolwill find and color all strings of one or more DNA/RNA letters andpcolwill color all strings of the twenty standard amino acid letters.
However, they will also recognize a few standard file formats and apply more
targeting coloring. When reading a file, these formats will
automatically be recognized based on their file extensions. When reading
from STDIN,dnacolandpcolwill try to identify the format based on the data
itself (for FASTQ/SAM/VCF files). The format can also be specified using
the--formatoption.SAM format (--format=sam, automatically enabled when filename
ends in.samor a line matching the SAM format is found)Ignore headers, color the SEQ column as DNA and the QUAL column as
quality scoresFASTQ format (--format=fastq, automatically enabled when filename
ends in.fastqor.fqor the first four lines match the FASTQ
format)Color the second line of every read as DNAColor the fourth line of every read as quality scoresVCF format (--format=vcf, automatically enabled when filename
ends in.vcfor a VCF header line is found)Ignore comments, only color the REF and ALT columnFASTA format (--format=fasta, automatically enabled when filename
ends in.fastaor.fa)Ignore sequence identifiersColormapsThe script support different colormaps, which specify a color for each possible letter of the sequence.
These are shown indnacol--help. When called usingdnacol, the script will use thedna_brgycolormap by default,
whilepcolwill use theproteincolormap. You can change thednacolcolormap using a configuration file (see below).Options-w, --wide
    wide output (add spaces around each base)
-f FORMAT, --format FORMAT
    file format (auto|text|sam|vcf|fastq|fasta)ConfigurationYou can create a configuration file in YAML format called/etc/dnacolor~/.dnacolto change the behavior of this script.
At the moment, the only setting available is the colormap to use for DNA sequences.
See seednacol--helpfor examples of the colormaps that are available.To use thegbyrinstead of thebrgycolormap, set thedna_colormapoption like this:dna_colormap: gbyrDownload/InstallTo install, usepip:pip install dnacolIf the system-wide directory is not writable, you can install to your home directory with:pip install dnacol --userAlternatively, you can clone this git
repository and use the providedsetup.pyscript.git clone https://github.com/koelling/dnacol.git
cd dnacol && python setup.py installdnacolhas been tested with Python 2.7 and Python 3.5 and 3.6.Examples#read gzipped file
dnacol examples/phix.fa.gz | head

#pipe from stdin
head examples/reads.txt | dnacol --wide

#use `pcol` for protein sequences
pcol examples/hras.fa

#use `less -R` to display colors in less
dnacol examples/phix.fa.gz | less -R