Question: Mark duplicates PICARD error: Unable to access jarfile 'MarkDuplicates.jar' with commandline/with R dupRadar package
0
gravatar for salamandra
2.1 years ago by
salamandra310
salamandra310 wrote:

I've converted SAM file to BAM, sorted the BAM file and indexed it. Then tried to mark duplicates with PICARD using R dupRadar package:

library(dupRadar)
PICARD_path='/Applications/Anaconda/pkgs/qualimap-2.2.2a-2/share/qualimap-2.2.2a-2/picard-1.70.jar'
BAM_file='/Volumes/PereiraCytolab/Tania/RNA_seq_analysis_Newmethods/Results/BJs/STAR_alignments/1A_ATCACG_withoutadapters'
bamDuprm <- markDuplicates(dupremover="picard", bam=BAM_file, path=PICARD_path, rminput=TRUE)

And got this error:

Unable to access jarfile /Applications/Anaconda/pkgs/qualimap-2.2.2a-2/share/qualimap-2.2.2a-2/picard-1.70.jar/MarkDuplicates.jar
Error in picardMarkDuplicates(bam = bam, out = out, path = path, verbose = verbose,  : 
  picard returned error code1in command: java -XX:ParallelGCThreads=1 -Xmx4g -jar /Applications/Anaconda/pkgs/qualimap-2.2.2a-2/share/qualimap-2.2.2a-2/picard-1.70.jar/MarkDuplicates.jar INPUT=/Volumes/PereiraCytolab/Tania/RNA_seq_analysis_Newmethods/Results/BJs/STAR_alignments/1A_ATCACG_withoutadapters OUTPUT=/Volumes/PereiraCytolab/Tania/RNA_seq_analysis_Newmethods/Results/BJs/STAR_alignments/1A_ATCACG_withoutadapters METRICS_FILE=/Volumes/PereiraCytolab/Tania/RNA_seq_analysis_Newmethods/Results/BJs/STAR_alignments/1A_ATCACG_withoutadapters REMOVE_DUPLICATES=false ASSUME_SORTED=true PROGRAM_RECORD_ID='null'

Then I tried to use the commandline instead:

java -jar $PICARD MarkDuplicates INPUT=1A_ATCACG_withoutadapters_sorted.bam OUTPUT=1A_ATCACG_withoutadapters_sorted_dupmarked.bam METRICS_FILE=dupmarkmetrics.txt

And got this error:

Error: Unable to access jarfile MarkDuplicates

To test if PICARD was correctly installed I did:

java -jar $PICARD -h

And got the list of tools of Picard, so what is wrong?

rna-seq markduplicates picard • 2.4k views
ADD COMMENTlink written 2.1 years ago by salamandra310
java -jar $PICARD MarkDuplicates
java -jar $PICARD -h

are you doing both tests inside your shell and/or both inside R ? For the first line $PICARD is empty. I suspect your R script doesn't contain the environment variable $PICARD. Further more add some double quotesn, use "${PICARD}" instead of $PICARD . It will bne easier to debug.

ADD REPLYlink written 2.1 years ago by Pierre Lindenbaum129k

by doing on commandline:

java -jar $PICARD -h

it prints an output, but with:

java -jar $PICARD MarkDuplicates

gives error:

Error: Unable to access jarfile MarkDuplicates
ADD REPLYlink written 2.1 years ago by salamandra310

in Rstudio any doesn't work with or without quotes

ADD REPLYlink written 2.1 years ago by salamandra310
0
gravatar for Pierre Lindenbaum
2.1 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum129k wrote:

show me the output of

echo java -jar $PICARD -h && echo java -jar $PICARD MarkDuplicates
ADD COMMENTlink written 2.1 years ago by Pierre Lindenbaum129k

it's this:

 java -jar -h
 java -jar MarkDuplicates
ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by salamandra310
1

so $PICARD is not defined. And, unlike what you said,

java -jar -h

will only show the java help

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32      use a 32-bit data model if available
    -d64      use a 64-bit data model if available
    -server   to select the "server" VM
ADD REPLYlink written 2.1 years ago by Pierre Lindenbaum129k

right. I though it was PICARD's help menu but it's java help menu. So I have to write the path to the picard.jar file is that it?

ADD REPLYlink written 2.1 years ago by salamandra310

when providing full path to picard. jar file:

java -jar /Applications/Anaconda/pkgs/qualimap-2.2.2a-2/share/qualimap-2.2.2a-2/picard-1.70.jar -h

still gives error:

no main manifest attribute, in /Applications/Anaconda/pkgs/qualimap-2.2.2a-2/share/qualimap-2.2.2a-2/picard-1.70.jar
ADD REPLYlink written 2.1 years ago by salamandra310
1

this version of picard is very old & deprecated : 2012 https://github.com/broadinstitute/picard/releases/tag/1.70

still gives error:

no main manifest attribute,

see previous question : A: Picard install problem

.

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by Pierre Lindenbaum129k

Now with picard 2.18 I run this:

BAM_file=/Volumes/PereiraLab/Tania/RNAseqcourse/material/results/results_fastqexamples/alignments/HISAT2_adapter_removed_qualitytrim_20150821.A-2_BGVR_P218_R1_paired_with_retrievedgenome_ensembl.bam
output=/Volumes/PereiraLab/Tania/RNAseqcourse/material/results/results_fastqexamples/alignments/result.bam
java -jar /Applications/Anaconda/share/picard-2.18.7-2/picard.jar MarkDuplicates INPUT=BAM_file OUTPUT=output METRICS_FILE=dupmarkmetrics.txt

and got an error:

[Fri Jul 06 15:14:15 WEST 2018] picard.sam.markduplicates.MarkDuplicates done. Elapsed time: 0.00 minutes.
Runtime.totalMemory()=257425408
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" htsjdk.samtools.SAMException: Cannot read non-existent file: file:///Users/Lab/BAM_file
    at htsjdk.samtools.util.IOUtil.assertFileIsReadable(IOUtil.java:426)
    at htsjdk.samtools.util.IOUtil.assertFileIsReadable(IOUtil.java:413)
    at htsjdk.samtools.util.IOUtil.assertInputIsValid(IOUtil.java:389)
    at htsjdk.samtools.util.IOUtil.assertInputsAreValid(IOUtil.java:465)
    at picard.sam.markduplicates.MarkDuplicates.doWork(MarkDuplicates.java:224)
    at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:282)
    at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
    at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)

and the file was not created in OUTPUT directory. what's hapening?

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by salamandra310
1

the file BAM_file doesn't exist.

at this point, I stop helping you.

ADD REPLYlink written 2.1 years ago by Pierre Lindenbaum129k

the file was there, it was missing $. no need to be rude... thank you for your help

ADD REPLYlink written 2.1 years ago by salamandra310

p.s. you suggested v2.19, but i don't know how to install 2.19 with Anaconda (I used conda install -c bioconda picard to update to v2.18

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by salamandra310
Please log in to add an answer.

Help
Access

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