Execute Tophat Via Java
2
1
Entering edit mode
13.4 years ago
Stevelor ▴ 310

Hi all,

I'm trying to run tophat via an Java interface. With other mapping tools like bowtie etc. it works perfect. If i execute the tophat start command via java runtime exec() it doesn't work! But if i copy the command into the shell it works fine...so what is wrong?! Is it becaue of the nested program structure, that java doesn't allow tophat to execute bowtie??

Can anyone help me or has experiences about that??

Cheers! Steve

tophat java • 3.0k views
ADD COMMENT
0
Entering edit mode

post the error message that you get

ADD REPLY
2
Entering edit mode
13.4 years ago

I guess tophat is in your $PATH that's why it runs without any problem with the shell.

try to put the full path to the tophat executable in the exec command.

ADD COMMENT
0
Entering edit mode

Tophat actually runs.....but the output stream says:

[Fri Jul 15 07:49:32 2011] Beginning TopHat run (v1.3.1)

[Fri Jul 15 07:49:32 2011] Preparing output location /home/chg/Desktop/ [Fri Jul 15 07:49:32 2011] Checking for Bowtie index files [Fri Jul 15 07:49:32 2011] Checking for reference FASTA file [Fri Jul 15 07:49:32 2011] Checking for Bowtie Error locating program: bowtie

BUT BOWTIE IS IN THE $PATH....ahhh :(

ADD REPLY
0
Entering edit mode

Can you use exec("echo $PATH") to check $PATH of the java can find bowtie?

ADD REPLY
0
Entering edit mode
13.4 years ago
Ido Tamir 5.2k

As others posted without error message its difficult to give advice.[?] a) Recent versions of tophat also need bowtie and samtools in the path. You have to add the path to them to the environment when you execute the call to tophat. Although by default the subprocess should inherit our environment.[?]

Runtime.exec(String[] cmdarray, String[] envp)
Executes the specified command and arguments in a separate process with the specified environment.

b) make sure to handle the runtime output correctly (even if its no a lot) javaworld.

ADD COMMENT

Login before adding your answer.

Traffic: 1657 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