Problem in using picard.jar
1
1
Entering edit mode
5.4 years ago
Raheleh ▴ 260

Hello every one,

It's about a month that I stuck with picard. Every command that I try to run with picard failed. And for all of them I get the same error:

ERROR: Invalid argument '-I' , '-O'

When I try this argument I= or R=

I get this:

NOTE: Picard's command line syntax is changing.

* For more information, please see: * https://github.com/broadinstitute/picard/wiki/Command-Line-Syntax-Transition-For-Users-(Pre-Transition)

* The command line looks like this in the new syntax: * MergeVcfs -I sample1.vcf -I sample2.vcf.vcf -O Output.vcf.gz

can anyone tell me if I am doing sth wrong or it's a bug in picard?

I really appreciate any help!

picard • 7.9k views
ADD COMMENT
0
Entering edit mode

Please be as complete as possible and include the commands you tried, together with the version of Picard you are using.

ADD REPLY
0
Entering edit mode

I'm using the latest version of picard: 2.18.20

This are the tools which I try to run by picard, but failed:

NormalizeFasta MarkDuplicates MergeVcfs CreateSequenceDictionary

I'm doing the exact command given from the website.

for example for MergVcfs, this is the command:

java -jar picard.jar MergeVcfs I=Germline.hc.fpfilterPassed.vcf  I=Somatic.hc.fpfilterPassed.vcf O=Output.vcf.gz

When I run the command I got this:

NOTE: Picard's command line syntax is changing.

** For more information, please see: ** https://github.com/broadinstitute/picard/wiki/Command-Line-Syntax-Transition-For-Users-(Pre-Transition)

** The command line looks like this in the new syntax:

** MergeVcfs -I Germline.hc.fpfilterPassed.vcf -I Somatic.hc.fpfilterPassed.vcf -O Output.vcf.gz

It returns me nothing. I tried this command:

java -jar picard.jar MergeVcfs -I Germline.hc.fpfilterPassed.vcf  -I Somatic.hc.fpfilterPassed.vcf -O Output.vcf.gz

But I got this error:

ERROR: Invalid argument '-I'

Thanks!

ADD REPLY
0
Entering edit mode

Does removing the excessive space between Germline.hc.fpfilterPassed.vcf -I make a difference?

ADD REPLY
0
Entering edit mode

Hello WouterDeCoster,

No, it doesn't.

ADD REPLY
2
Entering edit mode
5.4 years ago

works on my machine using https://github.com/broadinstitute/picard/releases/download/2.18.20/picard.jar

java -jar /path/to/picard.jar MergeVcfs I=/path/to/S1.vcf.gz I=/path/to/S1.vcf.gz O=/path/to/out.vcf.gz
(...)
[Sun Dec 16 14:57:17 CET 2018] picard.vcf.MergeVcfs done. Elapsed time: 0.01 minutes.
Runtime.totalMemory()=40632320

yes there is the message NOTE: Picard's command line syntax is changing. but that's just an information.

ADD COMMENT
0
Entering edit mode

Dear Pierre, thanks for reply. I downloaded your machine and put all the files in the same directory and ran your command: java -jar picard.jar MergeVcfs I=Germline.hc.fpfilterPassed.vcf.gz I=Somatic.hc.fpfilterPassed.vcf.gz O=out.vcf.gz

It returned nothing and gave this exception:

Exception in thread "main" java.lang.IllegalArgumentException: A sequence dictionary must be available (either through the input file or by setting it explicitly).

I tried to create sequence dictionary using this command:

java -jar picard.jar CreateSequenceDictionary R=hg38.fa O=hg38.fa.dic

It returned an empty file and gave this error:

[Mon Dec 17 08:20:31 IRST 2018] CreateSequenceDictionary OUTPUT=hg38.fa.dic REFERENCE=hg38.fa    TRUNCATE_NAMES_AT_WHITESPACE=true NUM_SEQUENCES=2147483647 VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json USE_JDK_DEFLATER=false USE_JDK_INFLATER=false [Mon Dec 17 08:20:31 IRST 2018] Executing as mohammadi@user-Z10PE-D16-WS on Linux
4.13.0-16-generic amd64; OpenJDK 64-Bit Server VM 1.8.0_144-8u144-b01-2-b01; Deflater: Intel; Inflater: Intel; Provider GCS is not available; Picard version: 2.18.20-SNAPSHOT [Mon Dec 17 08:20:31 IRST 2018] picard.sam.CreateSequenceDictionary done. Elapsed time: 0.00 minutes. Runtime.totalMemory()=1011351552 To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp Exception in thread "main" htsjdk.samtools.SAMException: Error opening file: hg38.fa   at htsjdk.samtools.util.IOUtil.openFileForReading(IOUtil.java:637)  at htsjdk.samtools.reference.FastaSequenceFile.<init>(FastaSequenceFile.java:64)    at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getReferenceSequenceFile(ReferenceSequenceFileFactory.java:140)   at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getReferenceSequenceFile(ReferenceSequenceFileFactory.java:96)    at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getReferenceSequenceFile(ReferenceSequenceFileFactory.java:84)    at picard.sam.CreateSequenceDictionary.doWork(CreateSequenceDictionary.java:220)    at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:295)  at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)    at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113) Caused by: java.nio.file.NoSuchFileException: hg38.fa  at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)   at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)    at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)    at java.nio.file.Files.newByteChannel(Files.java:361)

Any help? Many thanks!

ADD REPLY
1
Entering edit mode
htsjdk.samtools.SAMException: Error opening file: hg38.fa at

If your shell/terminal is not within the same folder as hg38.fa you have to specify the full path to it.

O=hg38.fa.dic

The file extension should be .dict. This is what picard tools are looking for. And it has to be in the same folder as hg38.fa.

fin swimmer

ADD REPLY
1
Entering edit mode

A sequence dictionary must be available (either through the input file or by setting it explicitly).

a vcf should contain the ##contig lines. After CreateSequenceDictionary, you should add it with https://broadinstitute.github.io/picard/command-line-overview.html#UpdateVcfSequenceDictionary

ADD REPLY
0
Entering edit mode

Dear fin and Pierre, many thanks for your help!

Now I have hg38.fa.dict file :-) However, when I run this command: java -jar picard.jar VcfFormatConverter I=Germline.hc.fpfilterPassed.vcf O=Germline.hc.fpfilterPassed.bcf REQUIRE_INDEX=true to update my vcf file with the new sequence dictionary, I get this error:

> [Mon Dec 17 11:03:47 IRST 2018] VcfFormatConverter
> INPUT=Germline.hc.fpfilterPassed.vcf
> OUTPUT=Germline.hc.fpfilterPassed.bcf REQUIRE_INDEX=true   
> VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT
> COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=true
> CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json
> USE_JDK_DEFLATER=false USE_JDK_INFLATER=false [Mon Dec 17 11:03:47
> IRST 2018] Executing as adi@user-Z10PE-D16-WS on Linux
> 4.13.0-16-generic amd64; OpenJDK 64-Bit Server VM 1.8.0_144-8u144-b01-2-b01; Deflater: Intel; Inflater: Intel; Provider GCS is not available; Picard version: 2.18.20-SNAPSHOT [Mon Dec 17
> 11:03:47 IRST 2018] picard.vcf.VcfFormatConverter done. Elapsed time:
> 0.00 minutes. Runtime.totalMemory()=1011351552 To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
> Exception in thread "main" htsjdk.tribble.TribbleException: An index
> is required, but none found., for input source:
> file:///media/adi/DA9CC7989CC76D97/WES_project/apps/test/gatk-4.0.11.0/Germline.hc.fpfilterPassed.vcf
>   at
> htsjdk.tribble.TribbleIndexedFeatureReader.<init>(TribbleIndexedFeatureReader.java:135)
>   at
> htsjdk.tribble.AbstractFeatureReader.getFeatureReader(AbstractFeatureReader.java:113)
>   at
> htsjdk.tribble.AbstractFeatureReader.getFeatureReader(AbstractFeatureReader.java:77)
>   at htsjdk.variant.vcf.VCFFileReader.<init>(VCFFileReader.java:140)
>   at htsjdk.variant.vcf.VCFFileReader.<init>(VCFFileReader.java:92)   at
> picard.vcf.VcfFormatConverter.doWork(VcfFormatConverter.java:101)     at
> picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:295)
>   at
> picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
>   at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)

Can you help me again out of this problem? Thanks, Raheleh

ADD REPLY
1
Entering edit mode

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLY
1
Entering edit mode

your vcfs are not indexed. bzip them and index with bcftools index -t your.vcf.gz

ADD REPLY
1
Entering edit mode

why do you use VcfFormatConverter ?

ADD REPLY
0
Entering edit mode

Oops, my bad. So sorry. I ran this command: java -jar picard.jar UpdateVcfSequenceDictionary I=Germline.hc.fpfilterPassed.vcf O=Germline.hc.fpfilterPassed_new.vcf SEQUENCE_DICTIONARY=hg38.fa.dict

and now everything is fine :-)

Many thanks!

ADD REPLY

Login before adding your answer.

Traffic: 1640 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6