We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

Question about picard BuildBamIndex

sclee1sclee1 seoulMember
edited January 2015 in Ask the GATK team

Greeting all.

Currently, I have been using Picard's built-in library "BuildBamIndex" in order to index my bam files.

I have followed the manual described in Picard sites but I got error message.

Here is my command line that you can easily understand as below.

java -Xmx8g -XX:ParallelGCThreads=8 -jar $picard/BuildBamIndex.jar I=$RealignedBamDir/$output6

I tried different approach to avoid this error message so I used "samtools index" which i think is also same function as Picard BuildBamIndex.

After using samtools, I successfully got my bam index files.

I suppose that there are no major difference between Picard bamindex and samtools bam index.

I am confusing that why only samtools index procedure is working fine?

Below is my error message when run "BuildBamIndex" from Picard.

**[Sun Jan 18 22:15:42 KST 2015] picard.sam.BuildBamIndex INPUT=/DATA1/sclee1/data/URC_WES/U01/01U_N_Filtered_Sorted_Markdup_readgroup.bam VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
[Sun Jan 18 22:15:42 KST 2015] picard.sam.BuildBamIndex done. Elapsed time: 0.00 minutes.
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" htsjdk.samtools.SAMException: Exception creating BAM index for record HSQ-2K:530:C5PJAACXX:6:2109:18806:13902 1/2 101b aligned read.
at htsjdk.samtools.BAMIndexer.processAlignment(BAMIndexer.java:92)
at htsjdk.samtools.BAMIndexer.createIndex(BAMIndexer.java:291)
at htsjdk.samtools.BAMIndexer.createIndex(BAMIndexer.java:271)
at picard.sam.BuildBamIndex.doWork(BuildBamIndex.java:133)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:187)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)
Caused by: htsjdk.samtools.SAMException: BAM cannot be indexed without setting a fileSource for record HSQ-2K:530:C5PJAACXX:6:2109:18806:13902 1/2 101b aligned read.
at htsjdk.samtools.BAMIndexMetaData.recordMetaData(BAMIndexMetaData.java:130)
at htsjdk.samtools.BAMIndexer$BAMIndexBuilder.processAlignment(BAMIndexer.java:182)
at htsjdk.samtools.BAMIndexer.processAlignment(BAMIndexer.java:90)
... 6 more

I look forward to hearing positive answers from you soon.



  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Hi there,

    I'm sorry, I don't know what is wrong here. You should ask this on the Picard/samtools mailing list (see the url indicated in the error message), they may be able to help you.

  • dvalenzudvalenzu HelsinkiMember

    Hi sclee1,
    it seems to be a bug in the last version of Picard. Can you confirm which version are you using?
    I just have the same problem (and fount your answer by googling the error) with Picard 128 (latest release),
    I have just tried with version 125 and it works fine.
    Good luck!
    p.s: We should report the bug to the Picard team :-)

Sign In or Register to comment.