This is a test version of Biostars. For the public version, visit https://www.biostars.org.
picard error version 1.139 on ubuntu 14.04

I seem to have trouble with calling picard from the command line but other tools work perfectly.

path:

/home/cmccabe/Desktop/NGS/bedops-2.14.4/bin:/home/cmccabe/Desktop/NGS/samtools-1.2:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cmccabe/Desktop/NGS/bedtools2-25.0/bin:/home/cmccabe/Desktop/NGS/bbmap-35.59:/home/cmccabe/Desktop/NGS/FastQC-0.11.4:/home/cmccabe/Desktop/NGS/picard-tools-1.139

The code below throws an error as the picard.jar can not be found:

cmccabe@DTV-A5211QLM:~/Desktop/NGS$ java -jar picard.jar SortSam \
> INPUT=/home/cmccabe/IDP/mapped_unmatched_adapter_removed_quality_trimmed_NA12878-NextSeq-S1_R1_and_R2.sam \
> OUTPUT=/home/cmccabe/Desktop/NGS/picard-tools-1.139/sorted_mapped_unmatched_adapter_removed_quality_trimmed_NA12878-NextSeq-S1_R1_and_R2.bam \
> SORT_ORDER=coordinate
Error: Unable to access jarfile picard.jar

However, that same command in a slightly different (path to jar file added) way works perfectly:

cmccabe@DTV-A5211QLM:~/Desktop/NGS$ java -jar /home/cmccabe/Desktop/NGS/picard-tools-1.139/picard.jar SortSam INPUT=/home/cmccabe/IDP/mapped_unmatched_adapter_removed_quality_trimmed_NA12878-NextSeq-S1_R1_and_R2.sam OUTPUT=/home/cmccabe/Desktop/NGS/picard-tools-1.139/sorted_mapped_unmatched_adapter_removed_quality_trimmed_NA12878-NextSeq-S1_R1_and_R2.bam SORT_ORDER=coordinate

I guess it's just more out of curiosity why only picard seems to act this way on ubuntu 14.04. Thank you .

I add everything to path using as this seems to permanently add the path to the scripts:

echo export
PATH=$PATH:"/home/dnascopev/Desktop/picard-tools-1.139" >>
~/.bashrc
picard

1 answer

You have to set CLASSPATH, see here.

So something like:

echo export CLASSPATH="/home/dnascopev/Desktop/picard-tools-1.139/picard.jar" >> ~/.bashrc

Thank you :)

Looks like is I do:

echo ${CLASSPATH} it is blank until I:

export
CLASSPATH=/home/cmccabe/Desktop/NGS/picard-tools-1.139 then when I do echo ${CLASSPATH} the correct path displays.  When I close and re-open terminal the change does not save, so maybe I need to add classpath to bashrc?  Thanks.

Log in to answer this question.