The current GATK version is 3.8-0
Examples: Monday, today, last week, Mar 26, 3/26/04

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

You can opt in to receive email notifications, for example when your questions get answered or when there are new announcements, by following the instructions given here.

#### ☞ Got a problem?

1. Search using the upper-right search box, e.g. using the error message.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

#### ☞ Formatting tip!

Wrap blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ` ) each to make a code block as demonstrated here.

GATK version 4.beta.3 (i.e. the third beta release) is out. See the GATK4 beta page for download and details.

# Picard ViewSam Performance

TorontoMember
edited June 2016

Hi,

I have been playing around with the latest Picard Tools build (2.4.1) with the intention of eventually using HTSJDK directly to manipulate SAM/BAM/CRAM files. I've found that when I run the ViewSam Picard Tool on a CRAM, it takes a very long time to run. In this example, my "interval.txt" contains a single range 7:169000-170000 that has been converted from a Bed file into an Interval file with a SequenceDictionary I constructed from a FASTA file.

Running the same query in SamTools 1.3.1 View is extremely quick - a matter of seconds. The ViewSam Picard Tool takes 33 minutes.

java -jar /picard-tools-2.4.1/picard.jar ViewSam INPUT=sample.cram INTERVAL_LIST=interval.txt REFERENCE_SEQUENCE=genome.fa

[Wed Jun 22 20:41:31 UTC 2016] picard.sam.ViewSam INPUT=sample.cram INTERVAL_LIST=interval.txt REFERENCE_SEQUENCE=genome.fa ALIGNMENT_STATUS=All PF_STATUS=All HEADER_ONLY=false RECORDS_ONLY=false VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json

Running this on the BAM version of the file also takes a long time. The sample CRAM file I'm testing with is approximately 88 GB. Both my reference file and my CRAM file are indexed (I have genome.fa.fai and sample.cram.crai in the same directory as genome.fa and sample.cram)

What factors might be contributing to the long processing time? Are there additional parameters I should be specifying? Or is this expected due to how ViewSam is implemented. I haven't gone through the source code yet - I guess I'm hoping for a quick sanity check before committing time to chasing this down.

Thanks,
Andy

Tagged: