Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Use picard-tools script rather than full path to Picard jar #78

Open
samuell opened this issue May 4, 2016 · 4 comments
Open

Use picard-tools script rather than full path to Picard jar #78

samuell opened this issue May 4, 2016 · 4 comments

Comments

@samuell
Copy link
Contributor

samuell commented May 4, 2016

(I commented also here about this.)

This is relevant to the Picard sub-tools.

I noticed that at least when intalling via apt-get on Ubuntu, you get a picard-tools script in /usr/bin, which is executable from everywhere, that basically replaces the java -jar [...path...]/picard.jar part.

Calling that script instead of using java and the full path to the jar would be more portable as it is not specific to a given path for the jar. It should also be easy to create a custom such script in one's /usr/bin/ or other folders set in one's PATH, if installing in a custom location.

(For java options, I checked in the picard-tools script that it sends the JAVA_OPTIONS env variable to java, in case that is needed, for setting the memory usage and the like.)

@samuell samuell changed the title Use picard-tools script rather than full path to jar Use picard-tools script rather than full path to Picard jar May 4, 2016
@mr-c
Copy link
Member

mr-c commented May 4, 2016

Howdy @samuell, that is a great find. Can you send a pull request to switch to that usage?

@samuell
Copy link
Contributor Author

samuell commented May 4, 2016

@mr-c Sure, will make a try as soon as I start to grok all the details of the syntax :)

@portah
Copy link
Collaborator

portah commented May 5, 2016

@mr-c and @samuell, If you use those picard tools without docker and natively on ubuntu then yes you solution is better, but what if someone runs it somewhere else SuSE, Centos, MacOS, etc...

The particular solution that we have involves docker image, and in that image a particular version of picard is installed in /usr/local/bin...

@mr-c
Copy link
Member

mr-c commented May 5, 2016

CWL tool descriptions in this repository shouldn't require the use of Docker; frankly there shouldn't be any hard coded paths.

The picard-tools shell script is useful; but it is an enhancement from Debian and hasn't been adopted by the original authors.

Java does present a particular problem as there isn't a standard place to install jars.

A more portable approach to running Java programs that don't install a wrapper is for the user (or docker image) to set the CLASSPATH environment variable to the location of the installed jar file. Then the CWL command line tool description can invoke java along with the Main Class and any other default arguments:

baseCommand: [ java, picard.cmdline.PicardCommandLine, BuildBamIndex ]

Equivalent to the following at the command line using the Debian paths:

user@host:~$ CLASSPATH=/usr/share/java/picard.jar java picard.cmdline.PicardCommandLine BuildBamIndex

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants