Skip to content

Commit

Permalink
refactor(#684): rename genotype to variant
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Jan 3, 2024
1 parent 35bd613 commit 3643a46
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/integration_test/drugs_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ void main() {
'CYP2C9': CpicLookup(
gene: 'CYP2C9',
phenotype: 'Normal Metabolizer',
genotype: '*1/*1',
variant: '*1/*1',
lookupkey: '2')
};
UserData.instance.diplotypes = {
'CYP2C9': GeneResult(
gene: 'CYP2C9',
phenotype: 'Normal Metabolizer',
genotype: '*1/*1',
variant: '*1/*1',
allelesTested: '1')
};
final testDrugWithoutGuidelines = Drug(
Expand Down
4 changes: 2 additions & 2 deletions app/lib/common/models/userdata/cpic_lookup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CpicLookup implements Genotype {
CpicLookup({
required this.gene,
required this.phenotype,
required this.genotype,
required this.variant,
required this.lookupkey,
});

Expand All @@ -29,7 +29,7 @@ class CpicLookup implements Genotype {
@override
@HiveField(1)
@JsonKey(name: 'diplotype')
String genotype;
String variant;

@HiveField(2)
@JsonKey(name: 'generesult')
Expand Down
4 changes: 2 additions & 2 deletions app/lib/common/models/userdata/gene_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ part 'gene_result.g.dart';
class GeneResult implements Genotype {
GeneResult({
required this.gene,
required this.genotype,
required this.variant,
required this.phenotype,
required this.allelesTested,
});
Expand All @@ -26,7 +26,7 @@ class GeneResult implements Genotype {

@override
@HiveField(1)
String genotype;
String variant;

@HiveField(2)
String phenotype;
Expand Down
4 changes: 2 additions & 2 deletions app/lib/common/models/userdata/genotype.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
abstract class Genotype{
Genotype({
required this.gene,
required this.genotype,
required this.variant,
});

String gene;
String genotype;
String variant;
}
4 changes: 2 additions & 2 deletions app/lib/common/models/userdata/userdata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class UserData {
);
}

static String? genotypeFor(String gene) =>
UserData.instance.diplotypes?[gene]?.genotype;
static String? variantFor(String gene) =>
UserData.instance.diplotypes?[gene]?.variant;

static String? allelesTestedFor(String gene) =>
UserData.instance.diplotypes?[gene]?.allelesTested;
Expand Down
2 changes: 1 addition & 1 deletion app/lib/common/utilities/genome_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Future<void> fetchAndSaveLookups() async {
// extract the matching lookups
for (final diplotype in usersDiplotypes.values) {
// the gene and the genotype build the key for the hashmap
final key = '${diplotype.gene}__${diplotype.genotype}';
final key = '${diplotype.gene}__${diplotype.variant}';
final lookup = lookupsHashMap[key];
if (lookup == null) continue;
// uncomment to print literal mismatches between lab/CPIC phenotypes
Expand Down
2 changes: 1 addition & 1 deletion app/lib/common/utilities/pdf_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ List<pw.Widget> _buildUserPart(
) {
final patientGenotype = _userInfoPerGene(
drug,
(gene, drug, context) => UserData.genotypeFor(gene),
(gene, drug, context) => UserData.variantFor(gene),
buildContext,
);
final patientPhenotype = _userInfoPerGene(
Expand Down
2 changes: 1 addition & 1 deletion app/lib/report/pages/gene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class GenePage extends HookWidget {
children: [
_buildRow(
context.l10n.gene_page_genotype,
lookup.genotype,
lookup.variant,
tooltip: context.l10n.gene_page_genotype_tooltip
),
_buildPhenotypeRow(context),
Expand Down
2 changes: 1 addition & 1 deletion app/lib/report/pages/report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ReportPage extends StatelessWidget {
// phenotype will be overwritten with phenotype from lab or inhibited
// phenotype using PhenotypeInformation in GeneCard and GenePage
phenotype: notTestedString,
genotype: UserData.instance.diplotypes?[gene]?.genotype ??
variant: UserData.instance.diplotypes?[gene]?.variant ??
notTestedString,
lookupkey: notTestedString
)
Expand Down

0 comments on commit 3643a46

Please sign in to comment.