mirror of
https://github.com/pcvolkmer/mv64e-onkostar-data.git
synced 2025-09-14 00:12:52 +00:00
feat: add "Stützende molekulare Alterationen"
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This file is part of mv64e-onkostar-data
|
||||
*
|
||||
* Copyright (C) 2025 Paul-Christian Volkmer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package dev.pcvolkmer.onco.datamapper.genes;
|
||||
|
||||
import dev.pcvolkmer.mv64e.mtb.Chromosome;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class GeneUtilsTest {
|
||||
|
||||
@Test
|
||||
void findByHgncId() {
|
||||
var actual = GeneUtils.findByHgncId("HGNC:1097");
|
||||
|
||||
assertThat(actual).isPresent().hasValueSatisfying(gene -> {
|
||||
assertThat(gene.getHgncId()).isEqualTo("HGNC:1097");
|
||||
assertThat(gene.getEnsemblId()).isEqualTo("ENSG00000157764");
|
||||
assertThat(gene.getSymbol()).isEqualTo("BRAF");
|
||||
assertThat(gene.getName()).isEqualTo("B-Raf proto-oncogene, serine/threonine kinase");
|
||||
assertThat(gene.getChromosome()).isEqualTo("7q34");
|
||||
assertThat(gene.getSingleChromosomeInPropertyForm()).hasValue(Chromosome.CHR7);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void findByHgncSymbol() {
|
||||
var actual = GeneUtils.findBySymbol("ABCD1");
|
||||
|
||||
assertThat(actual).isPresent().hasValueSatisfying(gene -> {
|
||||
assertThat(gene.getHgncId()).isEqualTo("HGNC:61");
|
||||
assertThat(gene.getEnsemblId()).isEqualTo("ENSG00000101986");
|
||||
assertThat(gene.getSymbol()).isEqualTo("ABCD1");
|
||||
assertThat(gene.getName()).isEqualTo("ATP binding cassette subfamily D member 1");
|
||||
assertThat(gene.getChromosome()).isEqualTo("Xq28");
|
||||
assertThat(gene.getSingleChromosomeInPropertyForm()).hasValue(Chromosome.CHR_X);
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is part of mv64e-onkostar-data
|
||||
*
|
||||
* Copyright (C) 2025 Paul-Christian Volkmer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package dev.pcvolkmer.onco.datamapper.mapper;
|
||||
|
||||
import dev.pcvolkmer.mv64e.mtb.Coding;
|
||||
import dev.pcvolkmer.mv64e.mtb.GeneAlterationReference;
|
||||
import dev.pcvolkmer.mv64e.mtb.Reference;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class JsonToMolAltVarianteMapperTest {
|
||||
|
||||
@Test
|
||||
void shouldMapJson() {
|
||||
var json = "[{\"id\":22641112,\"ergebnis\":\"Einfache Variante (Mutation)\",\"gen\":\"BRAF\",\"exon\":\"-\",\"pathogenitaetsklasse\":\"-\"}]";
|
||||
|
||||
var actual = JsonToMolAltVarianteMapper.map(json);
|
||||
|
||||
assertThat(actual).hasSize(1);
|
||||
|
||||
var variant = actual.get(0);
|
||||
assertThat(variant).isEqualTo(
|
||||
GeneAlterationReference.builder()
|
||||
.gene(Coding.builder().code("HGNC:1097").display("BRAF").system("https://www.genenames.org/").build())
|
||||
.variant(Reference.builder().id("22641112").type("Variant").build())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user