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!

Get notifications!

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.
2. Try the latest version of tools.
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.

Did we ask for a bug report?

Then follow instructions in Article#1894.

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.

Jump to another community
Download the latest Picard release at
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

ayangayang TorontoMember
edited June 2016 in Ask the GATK team


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


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.




  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie

    Hmm, that's a surprising observation, at least to me. Maybe try relaxing the validation stringency, in case it's due to the validation checks? That's the most obvious difference I can think of relative to samtools view.

    If that doesn't explain what you're seeing, and since it's more a developer question, I would recommend reposting it as an issue in the Picard repository on GitHub.

  • ayangayang TorontoMember

    Thanks for the suggestion. I set VALIDATION_ to SILENT but it still took the same time. I've reposted the question as a Picard issue in Github

Sign In or Register to comment.