Picard ViewSam Performance
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.