smirarab/sepp — pull request #6 by kgori (2014-06-20 19:39:48+00:00)
Title: Wrapped the options reference path getter calls with calls to os.path.join

Wrapped the options reference path getter calls with calls to os.path.join, in case the path doesn't end in a trailing path separator

I found a small bug when running the test tipp analysis (traceback below), because I had set the REFERENCE environment variable to a path without a trailing slash. This meant that metagenomics.py wasn't able to construct its BLAST paths correctly. The guess easy fix is to add the path separator to REFERENCE, but I wrapped os.path.join calls around the path constructors involving ```options().__getattribute__('reference').path + 'some_string' ```

I don't do many of these pull requests, I hope I got the etiquette right. If not, it's through ignorance, not malice.

The traceback I got was:
Blasting fragments against marker dataset

BLAST Database error: No alias or index file found for nucleotide database [/Users/kgori/staging/sepp/tipp_datablast/markers/alignment.fasta.db] in search path [/Users/kgori/staging/sepp/test/unittest/data/mock/pyrg::]
Traceback (most recent call last):
File "/Users/kgori/staging/sepp/run_abundance.py", line 25, in
main()
File "/Users/kgori/staging/sepp/sepp/metagenomics.py", line 330, in main
build_profile(input,output_directory)
File "/Users/kgori/staging/sepp/sepp/metagenomics.py", line 54, in build_profile
binned_fragments=bin_to_markers(input,temp_dir)
File "/Users/kgori/staging/sepp/sepp/metagenomics.py", line 204, in bin_to_markers
gene_binning = bin_blast_results(blast_results)
File "/Users/kgori/staging/sepp/sepp/metagenomics.py", line 272, in bin_blast_results
gene_mapping = read_mapping(options().__getattribute__('reference').path + 'blast/markers/seq2marker.tab')
File "/Users/kgori/staging/sepp/sepp/metagenomics.py", line 262, in read_mapping
with open(input) as f:
IOError: [Errno 2] No such file or directory: '/Users/kgori/staging/sepp/tipp_datablast/markers/seq2marker.tab'