Skip to content

Commit

Permalink
✅ fix tests by fixing SF3B1_alpha type
Browse files Browse the repository at this point in the history
  • Loading branch information
juanesarango committed Dec 11, 2023
1 parent 3592867 commit 1dde3ba
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
42 changes: 21 additions & 21 deletions src/utils/preprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ const processInputs = (patientInput: PatientInput): PatientInput => {
// Construction of SF3B1 features i.e SF3B1_5q
processed.SF3B1_5q =
processed.SF3B1 !== 'NA'
? processed.SF3B1 === '1' &&
processed.del5q === '1' &&
processed.del7_7q === '0' &&
processed.complex === '0'
? Number(processed.SF3B1) === 1 &&
Number(processed.del5q) === 1 &&
Number(processed.del7_7q) === 0 &&
Number(processed.complex) === 0
? '1'
: '0'
: processed.del5q === '0'
: Number(processed.del5q) === 0
? '0'
: 'NA'

Expand All @@ -65,29 +65,29 @@ const processInputs = (patientInput: PatientInput): PatientInput => {
processed.BCORL1 !== 'NA' &&
processed.RUNX1 !== 'NA' &&
processed.NRAS !== 'NA'
? processed.SF3B1 === '1' &&
processed.SF3B1_5q === '0' &&
processed.SRSF2 === '0' &&
processed.STAG2 === '0' &&
processed.BCOR === '0' &&
processed.BCORL1 === '0' &&
processed.RUNX1 === '0' &&
processed.NRAS === '0'
? Number(processed.SF3B1) === 1 &&
Number(processed.SF3B1_5q) === 0 &&
Number(processed.SRSF2) === 0 &&
Number(processed.STAG2) === 0 &&
Number(processed.BCOR) === 0 &&
Number(processed.BCORL1) === 0 &&
Number(processed.RUNX1) === 0 &&
Number(processed.NRAS) === 0
? '1'
: '0'
: processed.SRSF2 === '1' ||
processed.STAG2 === '1' ||
processed.BCOR === '1' ||
processed.BCORL1 === '1' ||
processed.RUNX1 === '1' ||
processed.NRAS === '1'
? '0'
: Number(processed.SRSF2) === 1 ||
Number(processed.STAG2) === 1 ||
Number(processed.BCOR) === 1 ||
Number(processed.BCORL1) === 1 ||
Number(processed.RUNX1) === 1 ||
Number(processed.NRAS) === 1
? '1'
: 'NA'

// Construction of TP53multi feature
processed.TP53loh =
(processed.TP53maxvaf ?? 0) / 100 > 0.55 ||
processed.del17_17p === '1'
Number(processed.del17_17p) === 1
? '1'
: processed.TP53loh

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions test/riskCohort.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Risk Calculations', () => {
})
})

it.skip('Computes scores from a csv file', async () => {
it('Computes scores from a csv file', async () => {
const inputFile = './test/data/IPSSMexample.csv'
const outputFile = './test/data/IPSSMexample-out.csv'

Expand All @@ -79,7 +79,7 @@ describe('Risk Calculations', () => {
patients.forEach((patient) => assertExpectedResults(patient))
})

it.skip('Computes scores from a xlsx file', async () => {
it('Computes scores from a xlsx file', async () => {
const inputFile = './test/data/IPSSMexample.xlsx'
const outputFile = './test/data/IPSSMexample-out.xlsx'

Expand All @@ -94,7 +94,7 @@ describe('Risk Calculations', () => {
patients.forEach((patient) => assertExpectedResults(patient))
})

it.skip('Computes scores from a csv and ouputs a xlsx file', async () => {
it('Computes scores from a csv and ouputs a xlsx file', async () => {
const inputFile = './test/data/IPSSMexample.csv'
const outputFile = './test/data/IPSSMexample-out.xlsx'

Expand All @@ -109,7 +109,7 @@ describe('Risk Calculations', () => {
patients.forEach((patient) => assertExpectedResults(patient))
})

it.skip('Computes scores from a xlsx and ouputs a csv file', async () => {
it('Computes scores from a xlsx and ouputs a csv file', async () => {
const inputFile = './test/data/IPSSMexample.xlsx'
const outputFile = './test/data/IPSSMexample-out.csv'

Expand Down

0 comments on commit 1dde3ba

Please sign in to comment.