[BioSQL-l] Select all sequences querying on taxon_name

Hilmar Lapp hlapp at drycafe.net
Tue Jul 2 23:24:13 UTC 2019



> On Jul 2, 2019, at 7:01 PM, Pedro Almeida <p.almeida.mc at gmail.com <mailto:p.almeida.mc at gmail.com>> wrote:
> 
> […]
> 
> The best approach for these kind of cases could actually be to select all the terminal nodes from up a certain NCBI taxon id (e.g. 4751 for Fungi). Not sure if this is possible but that might be for another question. :)

BTW of course this is possible. You can use your original query and change the WHERE clause to “WHERE taxon.ncbi_taxon_id = 4751”. This would be more the typical usage. I.e., for a given NCBI taxon ID, give me all descendants. To limit the result to terminals, you would have to also condition to records for which no child exists (using NOT EXISTS, or, if SQLite doesn’t have that, using an outer join and constraining the outer joined id to NULL).

 -hilmar

-- 
Hilmar Lapp -:- lappland.io



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biosql-l/attachments/20190702/0228dfee/attachment.htm>


More information about the BioSQL-l mailing list