Skip to content
/ tgv Public
forked from zeqianli/tgv

Explore genomes in the terminal. Light, blazing fast ๐Ÿš€, vim-motion.

License

Notifications You must be signed in to change notification settings

nrminor/tgv

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

28 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Terminal Genome Viewer

Explore omics data without leaving the terminal.

Light, blazing fast ๐Ÿš€, vim motion, memory safe.

https://github.com/user-attachments/assets/ce33b31d-d3eb-4395-9ab4-ab3a501aa1be

(TGV is at an early statge. Please don't rely your papers on it (yet) :)

Contribution and bug reports are welcome! Please join the Discord to discuss ideas.)

Installation

Prerequisites: install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Add Rust to your path (or restart your terminal):
source "$HOME/.cargo/env"

Install stable release

cargo install tgv

Install the latest development branch

# Clone the repository
git clone https://github.com/zeqianli/tgv.git
cd tgv

cargo install --path .

Quick start

# Browse the hg38 human genome. Internet connection required.
tgv
  • Quit: :q
  • Movement:
    • Left / down / up / right: h/j/k/l:
    • Faster left / right: y/p
    • Next gene / previous gene / next exon / previous exon: W/B/w/b
    • Repeat movements: _number_ + _movement_ (e.g. 20B: left by 20 genes)
  • Zoom in / out: z/o
  • Go to gene: :_gene_ (e.g. :TP53)
  • Go to a chromosome position: :_chr_:_position_: (e.g. :1:2345)

Full key bindings and comparison with Vim.

View alignments

# View BAM file aligned to the hg19 human reference genome
tgv sorted.bam -g hg19

# Start at a coordinate
tgv sorted.bam -r 12:25398142 -g hg19

# View a indexed remote BAM, starting at TP53, using the hg38 reference genome
tgv s3://my-bucket/sorted.bam -r TP53

# Use --no-reference for non-human alignments
# (Sequence / feature display not supported yet)
tgv non_human.bam -r 1:123 --no-reference

Supported formats

  • BAM (index and sorted). .bai file is needed.
    • Local, AWS, Google Cloud, or HTTP/HTTPS
    • Local: place the .bai file in the same directory; or specify the index file with -i.
    • s3: set credentials in environmental variables. See: https://www.htslib.org/doc/htslib-s3-plugin.html
    • gss: TODO not tested. Please provide feedback if it works!
    • Note that the custom bai path (-i) is not supported for remote use for due to rust-htslib API limitation.

See ROADMAP.md for future plans.

Contribute

Contribution is welcome. See CONTRIBUTE.md. Please join the Discord to discuss ideas!

FAQ

  • How to quit TGV?
    Just like vim :) Press Esc to ensure you're in normal mode, then type :q and press Enter.

  • Where are the reference genome data from?

About

Explore genomes in the terminal. Light, blazing fast ๐Ÿš€, vim-motion.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%