problem with R library
REQUIRED for all errors and issues:
a) GATK version used:4.4
b) Exact command used:
module load Python-3.11.1 java.17.0.6
module load R.4.3.0
# with getopt_1.20.0 and optparse_1.3.2
gatk --java-options "-Xms80G -Xmx80G -XX:-UseGCOverheadLimit -XX:+UseParallelGC -XX:ParallelGCThreads=16" PlotDenoisedCopyRatios --standardized-copy-ratios $outputbis/10_IC_1000.standardizedCR.tsv --denoised-copy-ratios $outputbis/10_IC_1000.denoisedCR.tsv --sequence-dictionary $dic --minimum-contig-length 46709983 --output $outputbis/plots --output-prefix 10_IC_1000
c) Entire program log:
gatk --java-options "-Xms80G -Xmx80G -XX:-UseGCOverheadLimit -XX:+UseParallelGC -XX:ParallelGCThreads=16" PlotDenoisedCopyRatios --standardized-copy-ratios $outputbis/10_IC_1000.standardizedCR.tsv --denoised-copy-ratios $outputbis/10_IC_1000.denoisedCR.tsv --sequence-dictionary $dic --minimum-contig-length 46709983 --output $outputbis/plots --output-prefix 10_IC_1000
Using GATK jar /usr/local/bioinfo/src/GATK/gatk-4.4.0.0/gatk-package-4.4.0.0-local.jar
Running:
java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -Xms80G -Xmx80G -XX:-UseGCOverheadLimit -XX:+UseParallelGC -XX:ParallelGCThreads=16 -jar /usr/local/bioinfo/src/GATK/gatk-4.4.0.0/gatk-package-4.4.0.0-local.jar PlotDenoisedCopyRatios --standardized-copy-ratios /home/user/work/TWIST/GATK_CNV_BIS/10_IC_1000.standardizedCR.tsv --denoised-copy-ratios /home/user/work/TWIST/GATK_CNV_BIS/10_IC_1000.denoisedCR.tsv --sequence-dictionary /home/user/work/GRCh38_p13/GRCh38_p13.dict --minimum-contig-length 46709983 --output /home/user/work/TWIST/GATK_CNV_BIS/plots --output-prefix 10_IC_1000
11:27:33.631 INFO NativeLibraryLoader - Loading libgkl_compression.so from jar:file:/usr/local/bioinfo/src/GATK/gatk-4.4.0.0/gatk-package-4.4.0.0-local.jar!/com/intel/gkl/native/libgkl_compression.so
11:27:33.713 INFO PlotDenoisedCopyRatios - ------------------------------------------------------------
11:27:33.715 INFO PlotDenoisedCopyRatios - The Genome Analysis Toolkit (GATK) v4.4.0.0
11:27:33.716 INFO PlotDenoisedCopyRatios - For support and documentation go to https://software.broadinstitute.org/gatk/
11:27:33.716 INFO PlotDenoisedCopyRatios - Executing as user@n003 on Linux v4.18.0-372.32.1.el8_6.x86_64 amd64
11:27:33.716 INFO PlotDenoisedCopyRatios - Java runtime: Java HotSpot(TM) 64-Bit Server VM v17.0.6+9-LTS-190
11:27:33.716 INFO PlotDenoisedCopyRatios - Start Date/Time: June 21, 2023 at 11:27:33 AM CEST
11:27:33.716 INFO PlotDenoisedCopyRatios - ------------------------------------------------------------
11:27:33.716 INFO PlotDenoisedCopyRatios - ------------------------------------------------------------
11:27:33.720 INFO PlotDenoisedCopyRatios - HTSJDK Version: 3.0.5
11:27:33.720 INFO PlotDenoisedCopyRatios - Picard Version: 3.0.0
11:27:33.720 INFO PlotDenoisedCopyRatios - Built for Spark Version: 3.3.1
11:27:33.720 INFO PlotDenoisedCopyRatios - HTSJDK Defaults.COMPRESSION_LEVEL : 2
11:27:33.724 INFO PlotDenoisedCopyRatios - HTSJDK Defaults.USE_ASYNC_IO_READ_FOR_SAMTOOLS : false
11:27:33.724 INFO PlotDenoisedCopyRatios - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_SAMTOOLS : true
11:27:33.724 INFO PlotDenoisedCopyRatios - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_TRIBBLE : false
11:27:33.724 INFO PlotDenoisedCopyRatios - Deflater: IntelDeflater
11:27:33.724 INFO PlotDenoisedCopyRatios - Inflater: IntelInflater
11:27:33.725 INFO PlotDenoisedCopyRatios - GCS max retries/reopens: 20
11:27:33.725 INFO PlotDenoisedCopyRatios - Requester pays: disabled
11:27:33.725 INFO PlotDenoisedCopyRatios - Initializing engine
11:27:33.725 INFO PlotDenoisedCopyRatios - Done initializing engine
11:27:33.727 INFO PlotDenoisedCopyRatios - Reading and validating input files...
11:27:34.479 INFO PlotDenoisedCopyRatios - Contigs above length threshold: {chr1=248956422, chr2=242193529, chr3=198295559, chr4=190214555, chr5=181538259, chr6=170805979, chr7=159345973, chr8=145138636, chr9=138394717, chr10=133797422, chr11=135086622, chr12=133275309, chr13=114364328, chr14=107043718, chr15=101991189, chr16=90338345, chr17=83257441, chr18=80373285, chr19=58617616, chr20=64444167, chr21=46709983, chr22=50818468, chrX=156040895, chrY=57227415}
11:27:34.616 INFO PlotDenoisedCopyRatios - Writing plots to /home/user/work/TWIST/GATK_CNV_BIS/plots...
11:27:35.497 INFO PlotDenoisedCopyRatios - Shutting down engine
[June 21, 2023 at 11:27:35 AM CEST] org.broadinstitute.hellbender.tools.copynumber.plotting.PlotDenoisedCopyRatios done. Elapsed time: 0.03 minutes.
Runtime.totalMemory()=82320556032
org.broadinstitute.hellbender.utils.R.RScriptExecutorException:
Rscript exited with 1
Command Line: Rscript -e tempLibDir = '/tmp/Rlib.12028575267112998038';source('/tmp/CNVPlottingLibrary.12900203348667863938.R');source('/tmp/PlotDenoisedCopyRatios.17342650199295787863.R'); --args --sample_name=10_IC_1000 --standardized_copy_ratios_file=/work/user/user/TWIST/GATK_CNV_BIS/10_IC_1000.standardizedCR.tsv --denoised_copy_ratios_file=/work/user/user/TWIST/GATK_CNV_BIS/10_IC_1000.denoisedCR.tsv --contig_names=chr1CONTIG_DELIMITERchr2CONTIG_DELIMITERchr3CONTIG_DELIMITERchr4CONTIG_DELIMITERchr5CONTIG_DELIMITERchr6CONTIG_DELIMITERchr7CONTIG_DELIMITERchr8CONTIG_DELIMITERchr9CONTIG_DELIMITERchr10CONTIG_DELIMITERchr11CONTIG_DELIMITERchr12CONTIG_DELIMITERchr13CONTIG_DELIMITERchr14CONTIG_DELIMITERchr15CONTIG_DELIMITERchr16CONTIG_DELIMITERchr17CONTIG_DELIMITERchr18CONTIG_DELIMITERchr19CONTIG_DELIMITERchr20CONTIG_DELIMITERchr21CONTIG_DELIMITERchr22CONTIG_DELIMITERchrXCONTIG_DELIMITERchrY --contig_lengths=248956422CONTIG_DELIMITER242193529CONTIG_DELIMITER198295559CONTIG_DELIMITER190214555CONTIG_DELIMITER181538259CONTIG_DELIMITER170805979CONTIG_DELIMITER159345973CONTIG_DELIMITER145138636CONTIG_DELIMITER138394717CONTIG_DELIMITER133797422CONTIG_DELIMITER135086622CONTIG_DELIMITER133275309CONTIG_DELIMITER114364328CONTIG_DELIMITER107043718CONTIG_DELIMITER101991189CONTIG_DELIMITER90338345CONTIG_DELIMITER83257441CONTIG_DELIMITER80373285CONTIG_DELIMITER58617616CONTIG_DELIMITER64444167CONTIG_DELIMITER46709983CONTIG_DELIMITER50818468CONTIG_DELIMITER156040895CONTIG_DELIMITER57227415 --maximum_copy_ratio=4.0 --point_size_copy_ratio=0.2 --output_dir=/work/user/user/TWIST/GATK_CNV_BIS/plots/ --output_prefix=10_IC_1000
Stdout:
Stderr: Error in getopt(spec = spec, opt = args) : long flag "args" is invalid
Calls: source ... withVisible -> eval -> eval -> parse_args -> getopt
at org.broadinstitute.hellbender.utils.R.RScriptExecutor.getScriptException(RScriptExecutor.java:79)
at org.broadinstitute.hellbender.utils.R.RScriptExecutor.getScriptException(RScriptExecutor.java:18)
at org.broadinstitute.hellbender.utils.runtime.ScriptExecutor.executeCuratedArgs(ScriptExecutor.java:112)
at org.broadinstitute.hellbender.utils.R.RScriptExecutor.exec(RScriptExecutor.java:125)
at org.broadinstitute.hellbender.tools.copynumber.plotting.PlotDenoisedCopyRatios.writeDenoisingPlots(PlotDenoisedCopyRatios.java:218)
at org.broadinstitute.hellbender.tools.copynumber.plotting.PlotDenoisedCopyRatios.doWork(PlotDenoisedCopyRatios.java:174)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:149)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:198)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:217)
at org.broadinstitute.hellbender.Main.runCommandLineProgram(Main.java:160)
at org.broadinstitute.hellbender.Main.mainEntry(Main.java:203)
at org.broadinstitute.hellbender.Main.main(Main.java:289)
-
It seems that gatk installation and R cannot communicate with each other properly. Can you try with a gatk conda environment installation or the docker image. I just recently performed a similar study and my conda environment installed R and local gatk works perfectly.
-
yes, i known.
But it works fine with past version of GATK,
so, my solution was to use version 4.2.6.1 with R-3.6.2 -
Same problem here, using conda installed GATK version 4.4.0.0.
I am under the impression that the "--args" argument in not recognized by "Rscript".
This is consistent with the help page from the Rscript command (at least for R versions 4.1 & above). My understanding is that Rscript is an alias for "R --slave --no-restore --file=<script.R> --args". Indeed the man page of "getopt" states that:
If R was invoked directly via the “R” command, this corresponds to all argu-
ments passed to R after the “–args” flag.
If R was invoked via the “Rscript” command, this corresponds to all arguments
after the name of the R script file.If that analysis were correct, then removing "--args" in PlotDenoisedCopyRatios and PlotModeledSegments should do the trick.
Thanks!
-
Hi Eric Blanc
Thank you for the valuable suggestion. I will move this issue to developers to discuss and implement an update depending on the discussion and result.
For the above problem it also looks like an incompatible getopts and optparse library issue with gatk therefore the user solved the problem by using an older version of R and gatk. Sometimes infrastructures may have incompatible software installed by default. Currently the docker image for gatk includes all required library and tool versions to function properly. Any problems happening with local installs may not happen with the docker version so we recommend using gatk docker image instead.
Regards.
Please sign in to leave a comment.
4 comments