Skip to content

Commit

Permalink
fixed processing of missing genotype option in backend regression code
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavriel Matt authored and xzhou82 committed Nov 7, 2023
1 parent ed56ade commit 78f0d5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/termsetting/handlers/snplst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ function validateQ(data: any) {
if (data.q.AFcutoff < 0 || data.q.AFcutoff > 100) throw 'AFcutoff is not within 0 to 100'
if (![0, 1, 2].includes(data.q.alleleType)) throw 'alleleType value is not one of 0/1'
if (![0, 1, 2, 3].includes(data.q.geneticModel)) throw 'geneticModel value is not one of 0/1'
if (![0, 1, 2].includes(data.q.missingGenotype)) throw 'missingGenotype value is not one of 0/1'
if (![0, 1].includes(data.q.missingGenotype)) throw 'missingGenotype value is not one of 0/1'
}

export async function fillTW(tw: SnpsTermWrapper, vocabApi: SnpsVocabApi) {
Expand Down
6 changes: 1 addition & 5 deletions server/src/termdb.regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ tw{}
cacheid
alleleType: 0/1
geneticModel: 0/1/2/3
missingGenotype: 0/1/2
missingGenotype: 0/1
snp2effAle{}
snp2refGrp{}
samples {Map}
Expand Down Expand Up @@ -1459,10 +1459,6 @@ function doImputation(snp2sample, tw, cachesampleheader, sampleinfilter) {
return
}
if (tw.q.missingGenotype == 1) {
// numerically as average value
throw 'not done'
}
if (tw.q.missingGenotype == 2) {
// drop sample
const incompleteSamples = new Set() // any samples with missing gt
for (const { samples } of snp2sample.values()) {
Expand Down

0 comments on commit 78f0d5a

Please sign in to comment.