Hi, I've installed a local Galaxy. I used data_manager_fetch_genome_all_fasta to get a galGal4 genome. I then used data_manager_bowtie2_index_builder to build bowtie2 index.
In my test run, I first passed my data through FastQC and then Fastq_groomer. Then I tried bowtie2. I can see the reference genomes and options without a problem. After I hit run, it seems to go through the bowtie2 process alright as I can see it start and finish in the process monitor, but it can not finish and gave me this error:
Traceback (most recent call last): File "/home/joe/galaxy-dev/lib/galaxy/jobs/runners/local.py", line 128, in queue_job job_wrapper.finish( stdout, stderr, exit_code ) File "/home/joe/galaxy-dev/lib/galaxy/jobs/__init__.py", line 1211, in finish dataset.datatype.set_meta( dataset, overwrite=False ) File "/home/joe/galaxy-dev/lib/galaxy/datatypes/binary.py", line 339, in set_meta exit_code = subprocess.call( args=command, stderr=open( stderr_name, 'wb' ) ) File "/usr/lib/python2.7/subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
I tried the suggestion in http://stackoverflow.com/questions/18962785/oserror-errno-2-no-such-file-or-directory-while-using-python-subprocess-in-dj and add shell=True keyword argument to line 339 in binary.py, and then I had a different problem
Traceback (most recent call last): File "/home/joe/galaxy-dev/lib/galaxy/jobs/runners/local.py", line 128, in queue_job job_wrapper.finish( stdout, stderr, exit_code ) File "/home/joe/galaxy-dev/lib/galaxy/jobs/__init__.py", line 1211, in finish dataset.datatype.set_meta( dataset, overwrite=False ) File "/home/joe/galaxy-dev/lib/galaxy/datatypes/binary.py", line 359, in set_meta raise Exception( "Error Setting BAM Metadata: %s" % stderr ) Exception: Error Setting BAM Metadata: index: 1: index: samtools: not found
It appears that the env.sh file was not executed. So I manually add the path to the samtools binary to the system PATH variable and make sure that it can be found on terminal. However, this problem persists.
After several trials, it became clear to me that the bowtie2 process itself actually also calls samtools. It's after the bowtie2 process is finished and when the result is piped to samtools that the error occurs. While the bowtie2 process itself can locate where samtools is, a python program doesn't seem to be able to. I then download and build Samtools-1.2 from source. Now the Bowtie2 wrapper can find samtools, but I ended up with a standard error showing Samtools command usage, which would indicate that the command sent out by the wrapper is wrong?
The Job command loos like this :
bowtie2 -p ${GALAXY_SLOTS:-4} -x /home/joe/galaxy-dev/tool-data/galGal4/bowtie2_index/galGal4/galGal4 -U "/home/joe/galaxy-dev/database/files/000/dataset_5.dat" --very-fast-local | samtools view -Su - | samtools sort -o - - > /home/joe/galaxy-dev/database/files/000/dataset_22.dat
The first samtools command seems to have an extra '-', and the second samtools command seems to have extra '--'. Am I right about this? Where can I fix this ?
Is Samtools installed? This looks like a dependency issue.
Yes. It's installed along with the Bowtie2. (Dependency automatically handled). When Bowtie2 is running, I can see a Samtools running as well. If I uninstalled the Samtools installed by Galaxy, I can't really start the process at all. With the automatically installed Samtools, the error shows up apparently after the bowtie2 aligning process is finished. According to the Job Command-line, the bowtie2 result is piped to samtools. I believe this is where problem occurs. Please see my updated post.