Skip to content

Controlling How HTSJDK Operates Through System Properties

Nils Homer edited this page May 7, 2018 · 2 revisions

Various system properties can be specified to control how HTSJDK operates (see Source). Each property described below should be prefixed with samjdk (ex. -Dsamdjk.create_index=true on the command line).

Property Type Default Description
create_index boolean false Create the index when writing a coordinate sorted BAM
create_md5 boolean false Create MD5 files when writing SAM/BAM/CRAM files
use_async_io_read_for_samtools boolean false Use asynchronous I/O (one thread per file) when reading (samtools package only) (ex. SAM/BAM/CRAM files)
use_async_io_write_for_samtools boolean false Use asynchronous I/O (one thread per file) when writing (samtools package only) (ex. SAM/BAM/CRAM files)
use_async_io_write_for_tribble boolean false Use asynchronous I/O (one thread per file) when writing (tribble package only)
compression_level int 5 Compression level to be used for writing BAM and other block-compressed outputs
buffer_size int 128k Buffer size, in bytes, used whenever reading/writing files or streams
sam_flag_field_format samflagfield DECIMAL The output format of the flag field when writing SAM text. Ignored for reading SAM text
non_zero_buffer_size int 128k The buffer size when buffer_size is zero (when a non-zero buffer size must be guaranteed)
reference_fasta file null The reference FASTA file. Typically required when reading or writing CRAM files
custom_reader_factory string <empty string> The custom reader factory able to handle URL based resources like ga4gh. Expected format: <url prefix>,<fully qualified factory class name>[,<jar file name>]. E.g. https://www.googleapis.com/genomics/v1beta/reads/,com.google.genomics.ReaderFactory OR https://www.googleapis.com/genomics/v1beta/reads/,com.google.genomics.ReaderFactory,/tmp/genomics.jar
use_cram_ref_download boolean false True to allow reference files to be downloaed for CRAM, in case the reference file is not specified by the user. Enabling this is not necessarily a good idea, since this process often fails.
ebi_reference_service_url_mask string "https://www.ebi.ac.uk/ena/cram/md5/%s" A mask (pattern) to use when building EBI reference service URL for a given MD5 checksum. Must contain one and only one string placeholder.
sra_libraries_download boolean false Boolean describing whether downloading of SRA native libraries is allowed, in case such native libraries are not found locally
disable_snappy_property_name string "snappy.disable" The name of the system property that disables snappy
disable_snappy_compressor boolean false Disable use of the Snappy compressor