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!

Sequence dictionaries are not the same size (613, 0) when trying to merge BAMs with MergeSamFiles

sp580sp580 GermanyMember
edited February 2019 in Ask the GATK team

Hello!

I get the error Sequence dictionaries are not the same size (613, 0) when trying to merge 4 BAMs using the following expression:

SAMPLE_BAMs_RG=$(ls -1 $TMP/*.bam | grep $SAMPLE | sed 's/\/projekte/I=\/projekte/g') #this adds "I=" before the BAM path/name

java -jar $PICARD/picard.jar MergeSamFiles \
        $(echo $SAMPLE_BAMs_RG) \ # passing all BAMs at once
        O=$TMP/$SAMPLE.RG.merged.sorted.bam \
        SORT_ORDER=coordinate

I am not sure what I am missing since there is no flag to specify the dictionary path.

Thanks in advance

Tagged:

Best Answer

Answers

  • shleeshlee CambridgeMember, Broadie ✭✭✭✭✭

    Hi @sp580,

    The tool equates the @SQ lines in the header of the BAM as the sequence dictionary. You will want to check that these are identical for your BAMs.

  • sp580sp580 GermanyMember

    Thanks @shlee
    the @SQ lines are identical among the 4 BAMs I am passing to the tool

    However, there are 613 sequences (@SQ), which I guess is what the error message is also indicating (although I do not get the "0").

    Are there too many sequences in the reference?

  • sp580sp580 GermanyMember

    Thanks @shlee
    the problem was that the input expression was catching another bam which was empty.

    After correcting this, the tool worked. Sorry for using your time :( ... at least now I understand that this error exists and what it means.

    Cheers!

Sign In or Register to comment.