ukhsa-collaboration / snapperdb

GNU General Public License v3.0
23 stars 5 forks source link

Feature request: Querying SNP addresses #12

Open mgenphl opened 6 years ago

mgenphl commented 6 years ago

Hello.

I have not found any way of querying the SNP addresses within the code. I have to manually query the Postgres database. I would be happy to work on a PR if you like.

Thank you.

Anders.

Wang-Jing-NZ commented 6 years ago

we have been writing our own python scripts for querying the db. It depends on how you want to use the information in the db with other data sources.

timdallman commented 6 years ago

Hi. We've actually just added a sub-routine called get_strains - tag v1.0.4. This will return all isolates in the database with their SNP Address (or just the isolates from a requested SNP cluster). See if that meets your requirements if not always happy to receive a pull request. Similar to Jing we also have a raft of scripts that query the postgres database to integrate the data into our surveillance systems. Best wishes Tim

andersgs commented 6 years ago

Thank you both for your replies.

I'll install the latest version, and see how it goes.

In my mind, I was expecting something along the lines:

snapperdb query --isolate ID --address 250:100:50:25:*: *: * meaning give me all isolates within 10 SNPs from isolate ID.

snapperdb query --address 250:100:50:25:*:*:* might mean "give me all clusters with 10 SNPs".

I would have to speak to some our Epis to understand what other queries they may have, but at least the functionality of some basic querying of this nature would be a great feature to add.

There might be also an option to output the aligment of the clusters...

Best. Anders.