Skip to content
Pierre Lindenbaum edited this page Mar 24, 2016 · 7 revisions

##Motivation

Create a TreeMap from one or more SAM/BAM file. Ouput is a SVG file.

##Compilation

Requirements / Dependencies

Download and Compile

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

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 addinging standalone=yes on the command line:

$ git clone "https://github.com/lindenb/jvarkit.git"
$ cd jvarkit
$ make bamtreepack 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 paths.

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/bamtreepack.jar  [options] (stdin|file) 

Options

  • -o|--output (OUTPUT-FILE) Output file. Default:stdout
  • -c|--config (CONFIG.XML) XML config file
  • -x|--dimension (VALUE) dimension of the output rectangle Default value : "1000x1000".
  • -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/treepack/BamTreePack.java

Synopsis

$ $ java -jar dist/bamtreemap.jar -c config.xml (stdin|bam1 bam2 ....) > out.svg

XML config

XML root is . children is '' . A '' has an attribute 'name'. The text content of the will be evaluated as a javascript expression with the embedded javascript engine. The javascript engine injects record a https://github.com/samtools/htsjdk/blob/master/src/java/htsjdk/samtools/SAMRecord.java and header a https://samtools.github.io/htsjdk/javadoc/htsjdk/htsjdk/samtools/SAMFileHeader.html.

Example

$ cat config.xml

<?xml version="1.0"?>
<treepack>
  <node name="chr">(record.getReadUnmappedFlag()?"UNMAPPED":record.getContig())</node>
  <node name="mapq">(record.getReadUnmappedFlag()?null:record.getMappingQuality())</node>
</treepack>


$ java  -jar dist/bamtreepack.jar -c config.xml  \
  "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase1/data/NA12340/alignment/NA12340.mapped.ILLUMINA.bwa.CEU.low_coverage.20101123.bam" \
  "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase1/data/NA12273/alignment/NA12273.mapped.ILLUMINA.bwa.CEU.low_coverage.20101123.bam" > out.svg

https://pbs.twimg.com/media/BeaCYQgCEAAZxio.png:large

See also

Contribute

License

The project is licensed under the MIT license.

Citing

Should you cite bamtreepack ? 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