60 lines
1.6 KiB
Go
60 lines
1.6 KiB
Go
|
package traits
|
||
|
|
||
|
import "seekia/internal/helpers"
|
||
|
|
||
|
import "maps"
|
||
|
|
||
|
func getHomosexualnessTraitObject()Trait{
|
||
|
|
||
|
// Map Structure: rsID -> References Map
|
||
|
locusReferencesMap := make(map[int64]map[string]string)
|
||
|
|
||
|
referencesMap_List1 := make(map[string]string)
|
||
|
referencesMap_List1["Large-scale GWAS reveals insights into the genetic architecture of same-sex sexual behavior"] = "https://www.science.org/doi/10.1126/science.aat7693"
|
||
|
|
||
|
lociList_1 := []int64{
|
||
|
10261857,
|
||
|
28371400,
|
||
|
34730029,
|
||
|
11114975,
|
||
|
}
|
||
|
|
||
|
for _, rsID := range lociList_1{
|
||
|
locusReferencesMap[rsID] = maps.Clone(referencesMap_List1)
|
||
|
}
|
||
|
|
||
|
homosexualnessLociList := helpers.GetListOfMapKeys(locusReferencesMap)
|
||
|
|
||
|
referencesMap := make(map[string]string)
|
||
|
referencesMap["Large-scale GWAS reveals insights into the genetic architecture of same-sex sexual behavior"] = "https://www.science.org/doi/10.1126/science.aat7693"
|
||
|
|
||
|
valueFormatter := func(inputHomosexualness float64, showUnits bool)(string, error){
|
||
|
|
||
|
inputHomosexualnessString := helpers.ConvertIntToString(int(inputHomosexualness))
|
||
|
|
||
|
if (showUnits == false){
|
||
|
return inputHomosexualnessString, nil
|
||
|
}
|
||
|
|
||
|
formattedValue := inputHomosexualnessString + "/10"
|
||
|
|
||
|
return formattedValue, nil
|
||
|
}
|
||
|
|
||
|
homosexualnessObject := Trait{
|
||
|
TraitName: "Homosexualness",
|
||
|
TraitDescription: "Feelings of sexual attraction towards people who belong to a person's own sex.",
|
||
|
DiscreteOrNumeric: "Numeric",
|
||
|
LocusReferencesMap: locusReferencesMap,
|
||
|
LociList: homosexualnessLociList,
|
||
|
LociList_Rules: []int64{},
|
||
|
RulesList: []TraitRule{},
|
||
|
OutcomesList: []string{},
|
||
|
NumericValueFormatter: valueFormatter,
|
||
|
ReferencesMap: referencesMap,
|
||
|
}
|
||
|
|
||
|
return homosexualnessObject
|
||
|
}
|
||
|
|