This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Picard MarkDuplicates from bam files

Hi, I am using Picard to find duplicate reads. My command is:

java -jar  build/libs/picard.jar MarkDuplicates \
      I=Input.bam \
      O=marked_duplicate.bam \
      M=marked_dup_metrics.txt

I followed this syntax from here https://broadinstitute.github.io/picard/command-line-overview.html#MarkDuplicates I am getting the error which says that:

picard.sam.markduplicates.MarkDuplicates done. Elapsed time: 0.02 minutes.

But there is nothing in marked_duplicate.bam

I don't know what is th error. It would be helpful if I could get a lead.

picard next-gen sequence

What is the version ?. It cannot be the only message. Picard first prints all the parameters.

what is the output of

samtools view -c Input.bam

?

Hi, with the above command I got this number 24556057 which means my input file contains these many alignments right?

To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp Exception in thread "main" java.lang.IllegalArgumentException: A reference must be supplied (reference sequence SAMSequenceRecord(name=AF396436.1,length=47577,dict_index=1158,assembly=null) not found). at htsjdk.samtools.cram.build.CRAMReferenceRegion.getReferenceBases(CRAMReferenceRegion.java:77) at htsjdk.samtools.cram.structure.Slice.normalizeCRAMRecords(Slice.java:450) at htsjdk.samtools.cram.structure.Container.getSAMRecords(Container.java:322) at htsjdk.samtools.CRAMIterator.nextContainer(CRAMIterator.java:112) at htsjdk.samtools.CRAMIterator.hasNext(CRAMIterator.java:204) at htsjdk.samtools.SamReader$AssertingIterator.hasNext(SamReader.java:591) at picard.sam.markduplicates.MarkDuplicates.buildSortedReadEndLists(MarkDuplicates.java:523) at picard.sam.markduplicates.MarkDuplicates.doWork(MarkDuplicates.java:257) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:303) at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103) at picard.cmdline. PicardCommandLine.main(PicardCommandLine.java:113)

This is the error I get all the time

1 answer

I found the solution: I didn't sort my bam file and Picard was not taking in.So, I first sort that by coordinates.

Log in to answer this question.