Question: Picard tools MergeBamAlignment error
gravatar for ea11g10
2.5 years ago by
ea11g100 wrote:

Hi all,

I am attempting to go through the Dropseq pipeline, but I have changed a few things to the default. I have aligned my fastq files to the hg38 genome rather than hg19 and I've also used TopHat to align rather than STAR. However, when I get the the MergeBamAlignment step, used to merge an unaligned bam and the aligned bam to re-introduce the tags into the aligned bam files, I keep getting an error but unsure how to resolve it.

Both the bam files are sorted by queryname as the pipeline says to do, but I keep getting the following error (I've removed some of the chromosome names otherwise it would have been too long, as it contains all the contigs):

    Exception in thread "main" java.lang.IllegalArgumentException: Do not use this function to merge dictionaries with different sequences in them. Sequences must be in the same order as well. Found [1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 3, 4, 5, 6, 7, 8, 9, ...].
 at htsjdk.samtools.SAMSequenceDictionary.mergeDictionaries(
 at picard.sam.SamAlignmentMerger.getDictionaryForMergedBam(
 at picard.sam.AbstractAlignmentMerger.mergeAlignment(
 at picard.sam.SamAlignmentMerger.mergeAlignment(
 at picard.sam.MergeBamAlignment.doWork(
 at picard.cmdline.CommandLineProgram.instanceMain(
 at picard.cmdline.PicardCommandLine.instanceMain(

The picard code I'm using is:

picard MergeBamAlignment UNMAPPED_BAM=4571121.blue101/temp/unaligned_mc_tagged_polyA_filtered.bam ALIGNED_BAM=4571121.blue101/temp/aligned.sorted.bam OUTPUT=4565921.blue101/temp/merged.bam REFERENCE_SEQUENCE=/scratch/ea11g10/Dropseq/hg38.fasta PAIRED_RUN=false INCLUDE_SECONDARY_ALIGNMENTS=false    CLIP_ADAPTERS=true IS_BISULFITE_SEQUENCE=false ALIGNED_READS_ONLY=false MAX_INSERTIONS_OR_DELETIONS=1 READ1_TRIM=0 READ2_TRIM=0 ALIGNER_PROPER_PAIR_FLAGS=false SORT_ORDER=coordinate PRIMARY_ALIGNMENT_STRATEGY=BestMapq CLIP_OVERLAPPING_READS=true ADD_MATE_CIGAR=true VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LE

I created the dict file for the hg38.fasta file using picard CreateSequenceDictionary

Any help would be appreciated. Thanks

picard mergebam dropseq • 1.4k views
ADD COMMENTlink written 2.5 years ago by ea11g100

Both the bam files are sorted by queryname

I think, only the UNMAPPED_BAM should be sorted on queryname

ADD REPLYlink modified 2.5 years ago • written 2.5 years ago by Pierre Lindenbaum127k

In the Dropseq pipeline, after alignment of the fastq file, it says to sort the outputted alinged BAM by queryname before it moves onto the merging of the 2 BAM files

ADD REPLYlink written 2.5 years ago by ea11g100
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1827 users visited in the last hour