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

[Feature request] Support for stdin #35

Open
jolespin opened this issue Jun 13, 2023 · 5 comments
Open

[Feature request] Support for stdin #35

jolespin opened this issue Jun 13, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@jolespin
Copy link

jolespin commented Jun 13, 2023

I'm trying to replace prodigal with pyrodigal in my VEBA binning-prokaryotic.py module. I use stdin because I do some filtering on contig lengths w/ seqkit before I do gene calls and don't want to rewrite the contigs b/c that's a lot of space.

Can you add support for reading fasta input as stdin?

Preferably it no input is provided then assume it's stdin which is the current functionality of prodigal.

Also, I just noticed there's not support for stdout. Can you add this functionality as well? This is the default functionality of prodigal and it's quite useful. I use it to pipe directly into this script: https://github.com/jolespin/veba/blob/devel/src/scripts/append_geneid_to_prodigal_gff.py which adds the gene id.

@althonos althonos added the enhancement New feature or request label Jun 26, 2023
@althonos
Copy link
Owner

Hi @jolespin,

I'm always a bit reluctant to add more features to the CLI as the primary goal of Pyrodigal is to be used as a library when possible, and because I don't want to mimic the Prodigal CLI 100% (like the broken GenBank output for instance). However, I had a look at your code architecture, and while I believe it would be best not to invoke Pyrodigal as a subprocess, I understand why it's organized like that. I'd accept a PR if you want to try, otherwise I'll have a look but can't promise when.

@jolespin
Copy link
Author

Can you point me in the direction of the executable I should edit? I thought it was the _cli.py but noticed there are some arguments that are not usable in the cli such as the number of threads.

@althonos
Copy link
Owner

No, you're right, it's indeed the _cli.py file that should be changed. The --jobs argument was added recently and was not available in the Pyrodigal release on PyPI, but you could use it locally. Check the CONTRIBUTING.md guide if you need help setting up a local copy of the repository for testing 😃

@jolespin
Copy link
Author

Have you got any other requests about stdin support?

@althonos
Copy link
Owner

Not really, just make the stdin and stdout explicit in CLI, e.g. pyrodigal -i - to read from stdin, rather that assuming stdin when the -i flag is missing. I think it's better to keep the -i flag required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants