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

Cannot parse strain name when '.' in file path #99

Open
Takadonet opened this issue Nov 28, 2017 · 3 comments
Open

Cannot parse strain name when '.' in file path #99

Takadonet opened this issue Nov 28, 2017 · 3 comments

Comments

@Takadonet
Copy link

So the following line keeps failing when one or more '.' are found on the path to pileup file.

Example failing file path is /Storage/galaxy-17.05/working/dapE_11.out__Strain1.dataset_357596.pileup

@mbargull
Copy link

Hi @Takadonet, I took a closer look at the patch and I'd asses (without looking at the entirety of the code) it really does only fix shortcomings without other behavioral changes. Hence I'd be fine with including it in either version for bioconda/bioconda-recipes#6957.
Though, I can't really wrap my head around why the program works correctly anyway -- maybe you can help me understand:
As I see it, the pileup_file string is set to

args.output + '__' + sample_name + '.' + db_name + '.pileup'

at https://github.com/katholt/srst2/blob/v0.2.0/scripts/srst2.py#L1381-L1382 and gets split with

pileup_file.split(".")[1].split("__")[1]

where the patch from #100 applies, at https://github.com/katholt/srst2/blob/v0.2.0/scripts/srst2.py#L453.
Now if the output parameter doesn't include a ., the split(".")[1] would do the wrong thing, I suppose. In you example, dapE_11.out__Strain1.dataset_357596.pileup, you have the .out, so everything is fine; but wouldn't it fail if the output didn't include that dot? I'm confused..

@Takadonet
Copy link
Author

The output always contain a . character hence why it always works. It will not parse correctly when a file path has a . since it will start the split on that instead of the first . in the file name.

@mbargull
Copy link

Ah, ok, I was only looking at the call at
https://github.com/katholt/srst2/blob/v0.2.0/scripts/srst2.py#L1422
which can't work (I think). But for the other calls create_allele_pileup is used beforehand which adds the ., right.

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

No branches or pull requests

2 participants