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?
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.by doing on commandline:
it prints an output, but with:
gives error:
in Rstudio any doesn't work with or without quotes