Documentation ¶
Index ¶
- Constants
- Variables
- type AggQuery
- type Aggregation
- type AggregationBody
- type AndNode
- type ComparisonNode
- type CountBody
- type CountQuery
- type Field
- type FilterNode
- type FilterNodeWithChildren
- type ListBody
- type ListQuery
- type NotNode
- type Occurrence
- type OrNode
- type Pagination
- type Query
- type SQON
- type SortBody
- type SortField
- type Table
Constants ¶
View Source
const (
ArrayType = "array"
)
Variables ¶
View Source
var AdRatioField = Field{ Name: "ad_ratio", CanBeSelected: true, CanBeFiltered: true, Table: OccurrenceTable, }
View Source
var AfField = Field{ Name: "af", CanBeSelected: true, CanBeFiltered: true, CanBeSorted: true, Table: VariantTable, }
View Source
var ChromosomeField = Field{ Name: "chromosome", CanBeSelected: true, CanBeFiltered: true, CanBeSorted: true, CanBeAggregated: true, Table: OccurrenceTable, }
View Source
var ClinvarField = Field{ Name: "clinvar_interpretation", Alias: "clinvar", CanBeSelected: true, CanBeFiltered: true, CanBeSorted: false, CanBeAggregated: true, Type: ArrayType, Table: VariantTable, }
View Source
var ConsequenceFilterTable = Table{
Name: "consequences_filter",
Alias: "cf",
}
View Source
var ConsequenceIdField = Field{ Name: "consequence_id", CanBeFiltered: true, CanBeAggregated: true, Table: ConsequenceFilterTable, }
View Source
var FilterField = Field{ Name: "filter", CanBeSelected: true, CanBeFiltered: true, CanBeAggregated: true, Table: OccurrenceTable, }
View Source
var HgvsgField = Field{ Name: "hgvsg", CanBeSelected: true, CanBeFiltered: true, CanBeSorted: true, Table: VariantTable, }
View Source
var ImpactScoreField = Field{ Name: "impact_score", CanBeFiltered: true, CanBeAggregated: true, Table: ConsequenceFilterTable, }
View Source
var LocusIdField = Field{ Name: "locus_id", CanBeSelected: true, CanBeFiltered: true, CanBeSorted: true, Table: OccurrenceTable, }
View Source
var OccurrenceTable = Table{
Name: "occurrences",
Alias: "o",
}
View Source
var OccurrencesFields = []Field{ SeqIdField, LocusIdField, FilterField, ZygosityField, QualityField, AdRatioField, PfField, AfField, VariantClassField, HgvsgField, ChromosomeField, ClinvarField, ConsequenceIdField, SymbolField, ImpactScoreField, SiftPredField, }
View Source
var PfField = Field{ Name: "pf", CanBeSelected: true, CanBeFiltered: true, CanBeSorted: true, Table: VariantTable, }
View Source
var QualityField = Field{ Name: "quality", CanBeSelected: true, CanBeFiltered: true, Table: OccurrenceTable, }
View Source
var SeqIdField = Field{ Name: "seq_id", CanBeSelected: true, CanBeFiltered: true, Table: OccurrenceTable, }
View Source
var SiftPredField = Field{ Name: "sift_pred", CanBeFiltered: true, CanBeAggregated: true, Table: ConsequenceFilterTable, }
View Source
var SymbolField = Field{ Name: "symbol", CanBeFiltered: true, CanBeAggregated: true, Table: ConsequenceFilterTable, }
View Source
var VariantClassField = Field{ Name: "variant_class", CanBeSelected: true, CanBeFiltered: true, CanBeSorted: true, CanBeAggregated: true, Table: VariantTable, }
View Source
var VariantTable = Table{
Name: "variants",
Alias: "v",
}
View Source
var ZygosityField = Field{ Name: "zygosity", CanBeSelected: true, CanBeFiltered: true, CanBeAggregated: true, Table: OccurrenceTable, }
Functions ¶
This section is empty.
Types ¶
type AggQuery ¶
type AggQuery interface { Filters() FilterNode GetAggregateField() Field HasFieldFromTable(table Table) bool }
type Aggregation ¶
type AggregationBody ¶
type AndNode ¶
type AndNode struct {
Children []FilterNode
}
func (*AndNode) GetChildren ¶
func (n *AndNode) GetChildren() []FilterNode
type ComparisonNode ¶
func (*ComparisonNode) ToSQL ¶
func (n *ComparisonNode) ToSQL() (string, []interface{})
type CountQuery ¶
type CountQuery interface { Filters() FilterNode HasFieldFromTable(table Table) bool }
func NewCountQuery ¶
func NewCountQuery(sqon *SQON, fields []Field) (CountQuery, error)
type Field ¶
type Field struct { Name string // Name of the field, correspond to column name Alias string // Alias of the field to use in query CanBeSelected bool // Whether the field is authorized for selection CanBeFiltered bool // Whether the field is authorized for filtering CanBeSorted bool // Whether the field is authorized for sorting CanBeAggregated bool // Whether the field is authorized for aggregation CustomOp string // Custom operation, e.g., "array_contains" DefaultOp string // Default operation to use if no custom one exists Table Table // Table to which the field belongs Type string // Type of the field }
type FilterNode ¶
type FilterNode interface {
ToSQL() (string, []interface{})
}
type FilterNodeWithChildren ¶
type FilterNodeWithChildren interface { ToSQL() (string, []interface{}) GetChildren() []FilterNode }
type ListQuery ¶
type ListQuery interface { SelectedFields() []Field Filters() FilterNode Pagination() *Pagination SortedFields() []SortField HasFieldFromTable(table Table) bool }
func NewListQuery ¶
type NotNode ¶
type NotNode struct {
Child FilterNode
}
type Occurrence ¶
type Occurrence struct { SeqId int `json:"seq_id,omitempty"` Chromosome string `json:"chromosome,omitempty"` LocusId int64 `json:"locus_id,omitempty"` Quality float32 `json:"quality,omitempty"` Filter string `json:"filter,omitempty"` Zygosity string `json:"zygosity,omitempty"` Pf float64 `json:"pf,omitempty"` Af float64 `json:"af,omitempty"` GnomadV3Af float64 `json:"gnomad_v3_af,omitempty"` Hgvsg string `json:"hgvsg,omitempty"` OmimInheritanceCode string `json:"omim_inheritance_code,omitempty"` AdRatio float64 `json:"ad_ratio,omitempty"` VariantClass string `json:"variant_class,omitempty"` VepImpact string `json:"vep_impact,omitempty"` Symbol string `json:"symbol,omitempty"` Clinvar utils.JsonArray[string] `gorm:"type:json" json:"clinvar,omitempty"` ManeSelect bool `json:"mane_select,omitempty"` Canonical bool `json:"canonical,omitempty"` }
type OrNode ¶
type OrNode struct {
Children []FilterNode
}
func (*OrNode) GetChildren ¶
func (n *OrNode) GetChildren() []FilterNode
type Pagination ¶
type Query ¶
type Query interface { Filters() FilterNode HasFieldFromTable(table Table) bool }
type SQON ¶
type SQON struct { Field string `json:"field,omitempty"` // Field to filter on (for leaf nodes) Value interface{} `json:"value,omitempty"` // Value(s) for the filter Content []SQON `json:"content,omitempty"` // Nested SQON (for "not" or nested filters) Op string `json:"op,omitempty"` // Operation at this node }
Click to show internal directories.
Click to hide internal directories.