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

Add filter to and field selection to /samples #33

Closed
awm33 opened this issue Oct 9, 2016 · 2 comments
Closed

Add filter to and field selection to /samples #33

awm33 opened this issue Oct 9, 2016 · 2 comments
Assignees
Labels

Comments

@awm33
Copy link
Member

awm33 commented Oct 9, 2016

In response to the needs presented in cognoma/cancer-data#29 we need to add the ability for the frontend to get a list of samples related to a given mutated gene.

Example:
/samples?mutations__gene=1234&mutations__status=true&&fields=sample_id

Looks like the SearchFilter class supports filtering related models. The dynamic fields library can be used to filter fields. Note: Even though the examples use ModelSerializer, it should work with the regular Serializer used in this repo.

@dhimmel
Copy link
Member

dhimmel commented Oct 14, 2016

Would it be possible to specify a list of genes as well and for each gene receive a list of samples with that mutation?

I can imagine many situations where the frontend will need the samples with a mutation for multiple mutations and it would make sense to just do one network query.

@awm33
Copy link
Member Author

awm33 commented Oct 15, 2016

@dhimmel The endpoint returns sample objects with mutations being a child. I think what you're describing might be achieved through /samples?mutations__gene=1234&mutations__gene=2356&mutations__gene=21883&fields=sample_id,mutations

Maybe adding mutations as a searchable relation on /genes may make sense as well. For example /genes? entrezid=90808&entrezid=89979&entrezid=8668&mutations__status=true&expand=mutation&fields=entrezid

Then gene.mutations[...].sample would have the sample ids.

I just used 3 as an example, idk how many genes would be typical.

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

No branches or pull requests

2 participants