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] taxonkit list from taxon name #93

Open
2 tasks done
fgvieira opened this issue Mar 18, 2024 · 6 comments
Open
2 tasks done

[Feature] taxonkit list from taxon name #93

fgvieira opened this issue Mar 18, 2024 · 6 comments

Comments

@fgvieira
Copy link

Prerequisites

  • make sure you're are using the latest version by taxonkit version
  • read the usage

Describe your issue

taxonkit allows to list all children nodes given a taxid, for example:

taxonkit list --ids 554915,33154 [...]

Would it be possible to do the same from the taxon name? For example:

taxonkit list --ids Amoebozoa,Opisthokonta [...]
@shenwei356
Copy link
Owner

Good idea!

I can also make list to accept TaxIds from file and stdin. So you can also use

cat names.txt | taxonkit name2taxid | taxonkit list

@fgvieira
Copy link
Author

And maybe even:

taxonkit list names.txt

Just to be consistent with the other tools.

@fgvieira fgvieira changed the title [Feature Request] taxonkit list from taxon name [Feature] taxonkit list from taxon name Mar 21, 2024
@shenwei356
Copy link
Owner

shenwei356 commented Jun 15, 2024

Sorry for the late implementation.

Accept input TaxIds from stdin/files, not just the flag --ids

# from stdin
echo 9606 | taxonkit list

# from file
taxonkit list <(echo 9606)

Binaries are here: #88 (comment)

@fgvieira
Copy link
Author

Tried version 0.17.0 but I cannot seem to get taxonkit list to use taxon names directly. I tried:

echo homo | taxonkit name2taxid | taxonkit list

and

taxonkit list <(echo homo)

and

taxonkit list --ids homo

and get nothing.

But using 9605 works fine. Would it be possible to support taxon names directly?
It would be nice if it supported several taxa names (just like with taxids), like:

taxonkit list --ids homo,Amoebozoa,Opisthokonta

thanks

@shenwei356
Copy link
Owner

I didn't implement it, cause some TaxIds share the same names, e.g, Drosophila, which would bring some unexpected results.

$ echo Drosophila | taxonkit name2taxid | taxonkit lineage -i 2 -r -L
Drosophila      7215    genus
Drosophila      32281   subgenus
Drosophila      2081351 genus

Anyway, you can just add an extra step of taxonkit name2taxid.

@fgvieira fgvieira reopened this Jul 30, 2024
@fgvieira
Copy link
Author

fgvieira commented Jul 30, 2024

ok, but at least this one should work no?

echo homo | taxonkit name2taxid | taxonkit list

right now, it only works if:

echo homo | taxonkit name2taxid | cut -f 2 | taxonkit list

Maybe implement --name-field option in taxonkit list:

echo homo | taxonkit name2taxid | taxonkit list --name-field 2

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