Thanks Brian, I´d rather have a local solution than relying on web queries.
Hello,
I would like to know if there is any library out there to run a lowest common ancestor on the ncbi tree.
i have annotated a set of contigs into species and would like to use LCA to recover the ancestor. I have found MEGAN but it is based on java and is not very fast.
is there any tool or library out there that could be used ?' Was thinking of c++ or python implementations.
Thanks, david
1 answer
With NCBI taxonomy identifiers, you can do this:
http://taxonomy.jgi-psf.org/tax/id/ancestor/9606,9612,9913
You can alternatively use the names (underscores are optional; spaces work too)
http://taxonomy.jgi-psf.org/tax/name/ancestor/homo_sapiens,canis_lupus,bos_taurus
...or just get the NCBI taxID in plaintext rather than the json-formatted lineage:
http://taxonomy.jgi-psf.org/tax/pt_name/ancestor/homo_sapiens,canis_lupus,bos_taurus
You can go to http://taxonomy.jgi-psf.org for more details. This is pretty simple to get via a curl call (just put "curl " in front of the url). Incidentally this is based on Java and very fast :)
If you want you can do this locally instead, by downloading the BBMap package, but I think the web service is the fastest.
Log in to answer this question.
see Last Common Ancestor From Ncbi Taxonomy Using Java
Thanks Pierre, seems you need to submit a couple of taxids for LCA. In my case I can have many taxids to submit, not just tow taxids ??? Also forgot to mention that input file is a blasttab file.