Skip to content
Pierre Lindenbaum edited this page Sep 5, 2016 · 7 revisions

##Motivation

Statistics about the flags and reads in a BAM

##Compilation

Requirements / Dependencies

Download and Compile

$ git clone "https://github.com/lindenb/jvarkit.git"
$ cd jvarkit
$ make bamstats02

by default, the libraries are not included in the jar file, so you shouldn't move them (https://github.com/lindenb/jvarkit/issues/15#issuecomment-140099011 ). You can create a bigger but standalone executable jar by adding standalone=yes on the command line:

$ git clone "https://github.com/lindenb/jvarkit.git"
$ cd jvarkit
$ make bamstats02 standalone=yes

The required libraries will be downloaded and installed in the dist directory.

edit 'local.mk' (optional)

The a file local.mk can be created edited to override/add some definitions.

For example it can be used to set the HTTP proxy:

http.proxy.host=your.host.com
http.proxy.port=124567

##Synopsis

$ java -jar dist/bamstats02.jar  [options] (stdin|file) 

Options

  • -o|--output (OUTPUT-FILE) Output file. Default:stdout.
  • -B|--bed (BED) Optional Bed File
  • -h|--help print help
  • -version|--version show version and exit

##Source Code

Main code is: https://github.com/lindenb/jvarkit/blob/master/src/main/java/com/github/lindenb/jvarkit/tools/bamstats01/BamStats02.java

Example

$  find dir -name "*final.bam" | xargs  java -jar dist/bamstats02.jar -B capture.bed  > output.tsv
$  verticalize output.tsv

>>> 2
$1	#filename	dir/Sample0258.final.bam
$2	sampleName	Sample0258
$3	chromosome	2
$4	mapq	60
$5	inTarget	1
$6	READ_PAIRED	1
$7	READ_MAPPED_IN_PROPER_PAIR	1
$8	READ_UNMAPPED	0
$9	MATE_UNMAPPED	0
$10	READ_REVERSE_STRAND	1
$11	MATE_REVERSE_STRAND	0
$12	FIRST_IN_PAIR	0
$13	SECOND_IN_PAIR	1
$14	NOT_PRIMARY_ALIGNMENT	0
$15	READ_FAILS_VENDOR_QUALITY_CHECK	0
$16	READ_IS_DUPLICATE	0
$17	SUPPLEMENTARY_ALIGNMENT	0
$18	count	463982
<<< 2

>>> 3
$1	#filename	dir/Sample0258.final.bam
$2	sampleName	Sample0258
$3	chromosome	.
$4	mapq	0
$5	inTarget	-1
$6	READ_PAIRED	1
$7	READ_MAPPED_IN_PROPER_PAIR	0
$8	READ_UNMAPPED	1
$9	MATE_UNMAPPED	1
$10	READ_REVERSE_STRAND	0
$11	MATE_REVERSE_STRAND	0
$12	FIRST_IN_PAIR	1
$13	SECOND_IN_PAIR	0
$14	NOT_PRIMARY_ALIGNMENT	0
$15	READ_FAILS_VENDOR_QUALITY_CHECK	0
$16	READ_IS_DUPLICATE	0
$17	SUPPLEMENTARY_ALIGNMENT	0
$18	count	458630
<<< 3

>>> 4
$1	#filename	dir/Sample0258.final.bam
$2	sampleName	Sample0258
$3	chromosome	.
$4	mapq	0
$5	inTarget	-1
$6	READ_PAIRED	1
$7	READ_MAPPED_IN_PROPER_PAIR	0
$8	READ_UNMAPPED	1
$9	MATE_UNMAPPED	1
$10	READ_REVERSE_STRAND	0
$11	MATE_REVERSE_STRAND	0
$12	FIRST_IN_PAIR	0
$13	SECOND_IN_PAIR	1
$14	NOT_PRIMARY_ALIGNMENT	0
$15	READ_FAILS_VENDOR_QUALITY_CHECK	0
$16	READ_IS_DUPLICATE	0
$17	SUPPLEMENTARY_ALIGNMENT	0
$18	count	458630
<<< 4



### See also
[BamStats02View](BamStats02View)


## Contribute

- Issue Tracker: http://github.com/lindenb/jvarkit/issues
- Source Code: http://github.com/lindenb/jvarkit

## License

The project is licensed under the MIT license.

## Citing

Should you cite **bamstats02** ? https://github.com/mr-c/shouldacite/blob/master/should-I-cite-this-software.md

The current reference is:

http://dx.doi.org/10.6084/m9.figshare.1425030

> Lindenbaum, Pierre (2015): JVarkit: java-based utilities for Bioinformatics. figshare.
> http://dx.doi.org/10.6084/m9.figshare.1425030


Clone this wiki locally