Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped the options reference path getter calls with calls to os.path.join #6

Merged
merged 1 commit into from
Jun 23, 2014

Conversation

kgori
Copy link
Contributor

@kgori kgori commented Jun 20, 2014

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 <module>
    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'

….join, in case the path doesn't end in a trailing path separator
namphuon pushed a commit that referenced this pull request Jun 23, 2014
Wrapped the options reference path getter calls with calls to os.path.join
@namphuon namphuon merged commit aeda200 into smirarab:master Jun 23, 2014
@namphuon
Copy link
Collaborator

Thanks!

smirarab pushed a commit that referenced this pull request Jul 17, 2024
run matrix unit tests, i.e py3.9 and py3.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants