Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.

Running Java and Picard for the first time - so confused!

anandianandi StellenboschMember

Hi all.
Please bear with this newbie question. I am trying to run Picard MarkDuplicates with java and have read all the documentation I can find and still I'm getting strange errors!

1) I made a path for java by adding these lines to my .bash_profile:

$export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
$export JRE_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
$export PATH=$PATH:$HOME/bin:JAVA_HOME:JRE_HOME

2) I am running the MarkDuplicates script as follows:

java -Xmx2g -jar /home/.apps/picard-tools/1.119/MarkDuplicates.jar INPUT=inputfile.bam OUTPUT=outputfile.bam METRICS_FILE=stats/filename.sorted AS=TRUE REMOVE_DUPLICATES=false VALIDATION_STRINGENCY=SILENT TMP_DIR=temp/CREATE_INDEX=true

In the .out file I get the following error:
OpenJDK 64-Bit Server VM warning: You have loaded library /home/.apps/picard-tools/1.119/libIntelDeflater.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.

And in the .err file I get:
[Thu Aug 27 09:14:37 SAST 2015] picard.sam.MarkDuplicates INPUT=[home/anandie/BWA/7DLAetAln.bam] OUTPUT=7DLAetAln.sorted.markdup.bam METRICS_FILE=stats/7DLAetAln_Markdup.sorted REMOVE_DUPLICATES=false ASSUME_SORTED=true TMP_DIR=[temp/CREATE_INDEX=true] VALIDATION_STRINGENCY=SILENT PROGRAM_RECORD_ID=MarkDuplicates PROGRAM_GROUP_NAME=MarkDuplicates MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP=50000 MAX_FILE_HANDLES_FOR_READ_ENDS_MAP=8000 SORTING_COLLECTION_SIZE_RATIO=0.25 READ_NAME_REGEX=[a-zA-Z0-9]+:[0-9]:([0-9]+):([0-9]+):([0-9]+).* OPTICAL_DUPLICATE_PIXEL_DISTANCE=100 VERBOSITY=INFO QUIET=false COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
[Thu Aug 27 09:14:37 SAST 2015] Executing as [email protected] on Linux 2.6.32-573.3.1.el6.x86_64 amd64; OpenJDK 64-Bit Server VM 1.7.0_85-mockbuild_2015_07_15_13_21-b00; Picard version: 1.119(d44cdb51745f5e8075c826430a39d8a61f1dd832_1408991805) IntelDeflater
[Thu Aug 27 09:14:37 SAST 2015] picard.sam.MarkDuplicates done. Elapsed time: 0.00 minutes.
Runtime.totalMemory()=2058354688
To get help, see http://picard.sourceforge.net/index.shtml#GettingHelp
Exception in thread "main" htsjdk.samtools.SAMException: Cannot read non-existent file: /home/anandie/BWA/home/anandie/BWA/7DLAetAln.bam
at htsjdk.samtools.util.IOUtil.assertFileIsReadable(IOUtil.java:280)
at picard.sam.MarkDuplicates.doWork(MarkDuplicates.java:171)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:183)
at picard.sam.MarkDuplicates.main(MarkDuplicates.java:161)

I have tried running ValidateSamFile in a similar manner and also get the same error.

Can someone please point me in the right direction! Is it java or picardtools giving the problem? Where can I start my search!

Thanks for your time!

Answers

  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin

    @anandi
    Hi,

    From the error message "Exception in thread "main" htsjdk.samtools.SAMException: Cannot read non-existent file: /home/anandie/BWA/home/anandie/BWA/7DLAetAln.bam", it looks like the bam file you specified is not in the directory. Can you check that the bam file and the bam index file are both in /home/anandie/BWA/home/anandie/BWA/?

    Thanks,
    Sheila

  • thibaultthibault Broad InstituteMember, Broadie, Moderator, Dev admin

    Pay careful attention to how you're specifying the input: I see the relative path home/anandie/BWA/7DLAetAln.bam with no leading slash but I strongly suspect that you want the absolute path /home/anandie/BWA/7DLAetAln.bam including the leading slash.

Sign In or Register to comment.