You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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.
@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.
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.
The text was updated successfully, but these errors were encountered: