Skip to main content

A command tool to view reads over a loci from bam file, like a lightweigth IGV

Project description

MutView

MutView is a tool to view the reads cover a mutation in bam file, output file is html format. It's so fast and efficient, just like a lightweight IGV(Integrative Genomics Viewer).

Requires

  • python >= 3.7
  • samtools

Installation

pip install mutview

or

pip install git+https://github.com/TuBieJun/MutView.git

Example use

mutview -s -n 250 -c 2 -p 25466919 -r path_of_ref_fasta -S path_of_samtools -b input_bam -o out.html

Argument description

$ mutview
usage: mutview [-h] -p POS -c CHROM -b BAM -r REF -o OUT [-w WINDOW_SIZE] [-s]
               [-n NUM_READS] [-q BASE_Q] [-Q ALN_Q] [-f FONT] [-S SAMTOOLS]

optional arguments:
  -h, --help            show this help message and exit
  -p POS, --pos POS     the mutation position
  -c CHROM, --chrom CHROM
                        the chrom of mutation
  -b BAM, --bam BAM     the input bam file
  -r REF, --ref REF     the reference genome fasta file
  -o OUT, --out OUT     the output html file
  -w WINDOW_SIZE, --window_size WINDOW_SIZE
                        the window size of reference genome around the
                        mutation, default is 300
  -s, --sort            sort as base like igv, default is False
  -n NUM_READS, --num_reads NUM_READS
                        the max reads number to view default is 100
  -q BASE_Q, --base_q BASE_Q
                        the min base quality, reads with bq below the
                        specified threshold will be lowercases. default is 20.
  -Q ALN_Q, --aln_q ALN_Q
                        the min aln quality, bases with mq below the specified
                        threshold will be highlighted. default is 20.
  -f FONT, --font FONT  the the font of the out html file, it should be
                        monospaced font, default is consolas for windows, if
                        you view the out html file in mac, you need set the
                        value to Menlo or other monospaced fonts
  -S SAMTOOLS, --samtools SAMTOOLS
                        the samtools path, default is samtools


Out html Description

  • The bases that are inconsistent with the reference genome will be highlighted.
  • The bases with quality below the specified threshold will be represented in lowercase letters.
  • The background color of reads with alignment quality below the specified threshold will be highlighted.
  • Indels are represented using the characters "I" and "_".
  • The count of each base type will be displayed at the top
  • The left sidebar will display the name of the reads, pair information, and positive/negative strand information.

Here is example out:

example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mutview-0.0.1.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

mutview-0.0.1-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page