Skip to content

Analysis Grid Columns

Dave Lawrence edited this page Oct 15, 2020 · 1 revision

Clicking on Analysis Nodes shows that node's Django queryset

Joining from Variant

The queryset is of type ```snpdb.Variant`` queryset, so all columns must be reachable from there via joins using Django's "double__underscore" type syntax. You only ever want 1 row returned for each Variant, so the relationships must either be OneToOne or restricted with a filter (eg FilteredRelation)

Columns

Defined in snpdb.VariantGridColumn it contains info like width/label/description etc, and also the "variant_column" field which is the path from the variant table using Django's double underscore syntax, ie:

In [1]: from snpdb.models import Variant, VariantGridColumn                                                                                    

In [2]: pos_column = VariantGridColumn.objects.get(pk='position')                                                                              

In [3]: pos_column.variant_column                                                                                                              
Out[3]: 'locus__position'

In [4]: Variant.objects.all().values(pos_column.variant_column)[0]                                                                             
Out[4]: {'locus__position': 101487231}

Custom Columns

The columns displayed depend on CustomColumns (configured in user settings) which are a way to build collections of columns in different orders.

Clone this wiki locally