Git Product home page Git Product logo

basecounts's Introduction

basecounts

basecounts is a simple tool to extract nucleotide counts from BAM files for the user specific loci. This tool can also be used to generate VAF table for known somatic varaints without the proper variant calling.

Installation

Clone the repository and run make. Requires htslib.

git clone https://github.com/PoisonAlien/basecounts
cd basecounts
make
$ basecounts
-------------------------------------------------------------------------
basecounts: A tool to extract nucleotide counts
            of genomic loci from the BAM file. Version: 0.1.0
USAGE:
    basecounts [OPTIONS] <loci> <bam>
    e.g; basecounts target_loci.tsv Tumor.bam
OPTIONS:
    -f  Indexed fasta file. If provided, extracts and adds reference base to the ouput tsv
    -q  Min. mapping quality threshold. Default 10 [Read filter]
    -F  Exclude reads with FLAGS >= INT. Default 3852 [Read filter]
    -o  Output file basename. Default parses from basename of BAM file
ARGS:
    <loci>   loci file (chr\tpos)
    <bam>    Indexed BAM file
OUPUT:
    <output>.tsv    TSV file with nucletide counts for all variants
-------------------------------------------------------------------------

Usage

basecounts takes a 2 column tsv file with loci and the sorted/indexed BAM file as positional arguments.

First two columns of loci file should be chromsome and position.

$ head loci.tsv
1	6304615
1	10407830
1	46269731
1	47133825
1	50884996
1	84662414
1	152328587
1	216019313
1	226252155
#basic usage
$ basecounts loci.tsv tumor.bam 

#providing fasta file will add the reference base at the loci
$ basecounts -f GRCh37.fa loci.tsv tumor.bam 

#Output is a TSV file with readcounts suporting all 4 nucleotide bases and INDELS
$ head tumor.tsv 
loci    fa_ref  A       T       G       C       Ins     Del
1:6304615       A       70      0       0       19      0       0
1:10407830      C       0       0       39      50      0       0
1:46269731      A       50      3       1       21      0       0
1:47133825      T       3       37      14      4       0       0
1:50884996      A       51      0       0       15      0       0
1:84662414      G       0       2       81      0       0       0
1:152328587     A       85      3       0       0       0       0
1:216019313     T       0       53      17      0       0       0
1:226252155     G       0       41      52      0       0       0

basecounts's People

Contributors

poisonalien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

xtmgah

basecounts's Issues

Using basecounts, is there a way to output read name list containing indels on a specific chromosome position?

Hi,

Thank you very much for developing basecounts tool.

As the issue title describes, I need to obtain a read name list (or read fastq file) containing indels on a specific chromosome position. Could basecounts give such output?

To clarify, I want to exclude reads with only SNVs but not indels on the chromosome position. However, the tools I have found till now (e.g., ASCIIGenome) can only find reads containing SNVs and indels as a pool, but cannot separate reads containing SNVs and reads containing indels.

Many thanks.
Yingzi

error

Hi I get the following error when I run basecounts tool:

chr	pos	refbase	spaceholder	"sample_id.processed"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Fetch', src/bambases.rs:67:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

My command is:
./target/release/basecounts -a -v /cluster/home/arna/basecounts/test.bed /path/input/sample_id.processed.bam

Could you please let me know what is wrong with my run?
Thanks!
Arna

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.