This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Could not find or load main class net.sf.picard.sam.SortSam

Hi,

I am trying to run a protocol from a paper in nature, and I am stuck with this step: The commands parameters are as described in the paper, but I get an error msg "Error: Could not find or load main class net.sf.picard.sam.SortSam"

anyone have any idea what I am doing wrong?

java -Xmx2048m -XX:+UseParallelOldGC -XX:ParallelGCThreads=4 -XX:GCTimeLimit=50 -XX:GCHeapFreeLimit=10 -Djava.io.tmpdir=/nadata/users/me/ -cp /nadata/software/GATK_3.6/GenomeAnalysisTK.jar net.sf.picard.sam.SortSam INPUT=/nadata/users/me/B_RBFOX2_R1.fastq.adaptorTrim_round2_rmRep_reDup.bam TMP_DIR=/nadata/users/me/ OUTPUT=/nadata/users/mor/ECLIP/RBFOX2/B_RBFOX2_R1.fastq.adaptorTrim_round2_rmRep_reDup_sorted.bam VALIDATION_STRINGENCY=SILENT SO=coordinate CREATE_INDEX=true
    Error: Could not find or load main class net.sf.picard.sam.SortSam

Thanks!

chip-seq rna-seq

It would be helpful if you also post the link to the paper and in which section it is described. (BTW, it is just a typo here right? ava insetad of java)

I also do the same thing of that, did you use samtools sort instead ?

Please use ADD COMMENT or ADD REPLY to answer to previous reactions, as such this thread remains logically structured and easy to follow. I have now moved your post but as you can see it's not optimal. Adding an answer should only be used for providing a solution to the question asked.

I'm new to here, really think you !

1 answer

there is no such net.sf.picard.sam.SortSam in GATK (tested with 3.7)

   $  jar tvf GenomeAnalysisTK.jar | grep SortSam

SortSam is not part of the package net.sf.picard.sam since a long time: https://github.com/broadinstitute/picard/blob/master/src/main/java/picard/sam/SortSam.java (but picard.sam )

what you want is not GATK but picard : https://github.com/broadinstitute/picard/releases/tag/2.9.2

java -jar picard.jar SortSam

furthermore, samtools sort is faster

I tried substituting the link to GATK with a link to Picard but it didn't work... I also did samtools sort, and it worked like charm, but I'd still like to know why this didn't work...

Log in to answer this question.