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

uchime_ref --db can't read from stdin #506

Closed
frederic-mahe opened this issue Jan 26, 2023 · 3 comments
Closed

uchime_ref --db can't read from stdin #506

frederic-mahe opened this issue Jan 26, 2023 · 3 comments

Comments

@frederic-mahe
Copy link
Collaborator

while working on issue #504, I've noticed that --db - (reading --db data from stdin) does not work and yields a Fatal error. This could be intended, for instance to avoid reading both queries and references from stdin. If not, allowing --db - would make the user interface more predictable and flexible.

## reading from process substitutions works
vsearch \
    --uchime_ref <(printf ">query\nAAGG\n") \
    --db <(printf ">parentA\nAAAA\n>parentB\nGGGG\n") \
    --quiet \
    --uchimeout /dev/null

## reading from stdin works for the queries
printf ">query\nAAGG\n" | \
    vsearch \
        --uchime_ref - \
        --db <(printf ">parentA\nAAAA\n>parentB\nGGGG\n") \
        --quiet \
        --uchimeout /dev/null

## reading from stdin does not work for the references
printf ">parentA\nAAAA\n>parentB\nGGGG\n" | \
    vsearch \
        --uchime_ref <(printf ">query\nAAGG\n") \
        --db - \
        --quiet \
        --uchimeout /dev/null # Fatal error: Unable to get status for input file (-)
@frederic-mahe
Copy link
Collaborator Author

frederic-mahe commented Jan 26, 2023

--db /dev/stdin works, so the issue really is with --db -:

## reading explicitely from stdin works for the references
printf ">parentA\nAAAA\n>parentB\nGGGG\n" | \
    vsearch \
        --uchime_ref <(printf ">query\nAAGG\n") \
        --db /dev/stdin \
        --quiet \
        --uchimeout /dev/null

@torognes
Copy link
Owner

I think --db generally does not accept - as argument meaning read from stdin. I think this was done intentionally to avoid the use of - for multiple arguments, which would cause problems.

VSEARCH could be rewritten to accept - for many/all input file options, but only allowing it used in one at a time.

@frederic-mahe
Copy link
Collaborator Author

VSEARCH could be rewritten to accept - for many/all input file options, but only allowing it used in one at a time.

I don't think that's necessary.

I've added a statement in the manpage, and some tests to cover that behavior frederic-mahe/vsearch-tests@7277b1c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants