Skip to content

Commit

Permalink
fix!: system should use source homepage (#389)
Browse files Browse the repository at this point in the history
Per discussion here: ga4gh/gks-core#107
  • Loading branch information
korikuzma authored Dec 30, 2024
1 parent f217f66 commit e2eb35c
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 82 deletions.
22 changes: 11 additions & 11 deletions docs/source/normalizing_data/normalization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Normalized records are structured as `Genes <https://github.com/ga4gh/vrs/tree/2
{
"coding": {
"code": "HGNC:1097",
"system": "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/",
"system": "https://www.genenames.org",
},
"relation": "exactMatch",
},
Expand All @@ -91,14 +91,14 @@ Normalized records are structured as `Genes <https://github.com/ga4gh/vrs/tree/2
{
"coding": {
"code": "ENSG00000157764",
"system": "https://www.ensembl.org/id/",
"system": "https://www.ensembl.org",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "1943",
"system": "https://www.guidetopharmacology.org/GRAC/ObjectDisplayForward?objectId=",
"system": "https://www.guidetopharmacology.org",
},
"relation": "relatedMatch",
},
Expand All @@ -109,46 +109,46 @@ Normalized records are structured as `Genes <https://github.com/ga4gh/vrs/tree/2
{
"coding": {
"code": "BRAF",
"system": "https://cancer.sanger.ac.uk/cosmic/gene/overview?ln=",
"system": "https://cancer.sanger.ac.uk/cosmic",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "2284096",
"system": "https://www.ncbi.nlm.nih.gov/pubmed/",
"system": "https://pubmed.ncbi.nlm.nih.gov",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "uc003vwc.5",
"system": "https://genome.cse.ucsc.edu/cgi-bin/hgGene?hgg_gene=",
"system": "https://genome.ucsc.edu",
},
"relation": "relatedMatch",
},
{
"coding": {"code": "164757", "system": "https://www.omim.org/entry/"},
"coding": {"code": "164757", "system": "https://www.omim.org"},
"relation": "relatedMatch",
},
{
"coding": {
"code": "NM_004333",
"system": "https://www.ncbi.nlm.nih.gov/refseq/?term=",
"system": "https://www.ncbi.nlm.nih.gov/refseq/",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "P15056",
"system": "https://purl.uniprot.org/uniprot/",
"system": "https://www.uniprot.org",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "M95712",
"system": "https://www.ebi.ac.uk/ena/browser/view/",
"system": "https://www.ebi.ac.uk/ena/",
},
"relation": "relatedMatch",
},
Expand All @@ -159,7 +159,7 @@ Normalized records are structured as `Genes <https://github.com/ga4gh/vrs/tree/2
{
"coding": {
"code": "1565476",
"system": "https://www.ncbi.nlm.nih.gov/pubmed/",
"system": "https://pubmed.ncbi.nlm.nih.gov",
},
"relation": "relatedMatch",
},
Expand Down
3 changes: 3 additions & 0 deletions src/gene/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ def _create_concept_mapping(
) -> ConceptMapping:
"""Create concept mapping for identifier
``system`` will use source homepage or namespace prefix, in that order of \
preference, if available.
:param concept_id: A lowercase concept identifier represented as a curie
:param relation: SKOS mapping relationship, default is relatedMatch
:raises ValueError: If source of concept ID is not a valid
Expand Down
51 changes: 28 additions & 23 deletions src/gene/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,26 @@ class NamespacePrefix(Enum):
RFAM = "rfam"


# Source to URI (from identifiers.org, if found)
# Source to URI. Will use source homepage
NAMESPACE_TO_SYSTEM_URI: dict[NamespacePrefix, str] = {
NamespacePrefix.HGNC: "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/",
NamespacePrefix.ENSEMBL: "https://www.ensembl.org/id/",
NamespacePrefix.HGNC: "https://www.genenames.org",
NamespacePrefix.ENSEMBL: "https://www.ensembl.org",
NamespacePrefix.NCBI: "https://www.ncbi.nlm.nih.gov/gene/",
NamespacePrefix.ENTREZ: "https://www.ncbi.nlm.nih.gov/gene/",
NamespacePrefix.UCSC: "https://genome.cse.ucsc.edu/cgi-bin/hgGene?hgg_gene=",
NamespacePrefix.ENA: "https://www.ebi.ac.uk/ena/browser/view/",
NamespacePrefix.REFSEQ: "https://www.ncbi.nlm.nih.gov/refseq/?term=",
NamespacePrefix.CCDS: "https://www.ncbi.nlm.nih.gov/CCDS/CcdsBrowse.cgi?REQUEST=CCDS&DATA=",
NamespacePrefix.UNIPROT: "https://purl.uniprot.org/uniprot/",
NamespacePrefix.PUBMED: "https://www.ncbi.nlm.nih.gov/pubmed/",
NamespacePrefix.COSMIC: "https://cancer.sanger.ac.uk/cosmic/gene/overview?ln=",
NamespacePrefix.OMIM: "https://www.omim.org/entry/",
NamespacePrefix.IUPHAR: "https://www.guidetopharmacology.org/GRAC/ObjectDisplayForward?objectId=",
NamespacePrefix.VEGA: "https://www.sanger.ac.uk/tool/vega-genome-browser/",
NamespacePrefix.UCSC: "https://genome.ucsc.edu",
NamespacePrefix.ENA: "https://www.ebi.ac.uk/ena/",
NamespacePrefix.REFSEQ: "https://www.ncbi.nlm.nih.gov/refseq/",
NamespacePrefix.CCDS: "https://www.ncbi.nlm.nih.gov/projects/CCDS/CcdsBrowse.cgi",
NamespacePrefix.UNIPROT: "https://www.uniprot.org",
NamespacePrefix.PUBMED: "https://pubmed.ncbi.nlm.nih.gov",
NamespacePrefix.COSMIC: "https://cancer.sanger.ac.uk/cosmic/",
NamespacePrefix.OMIM: "https://www.omim.org",
NamespacePrefix.SNORNABASE: "https://www-snorna.biotoul.fr",
NamespacePrefix.PSEUDOGENE: "http://pseudogene.org",
NamespacePrefix.MEROPS: "https://www.ebi.ac.uk/merops/",
NamespacePrefix.IUPHAR: "https://www.guidetopharmacology.org",
NamespacePrefix.RFAM: "https://rfam.org",
}

# URI to source
Expand Down Expand Up @@ -343,7 +348,7 @@ class NormalizeService(BaseNormalizationService):
{
"coding": {
"code": "HGNC:1097",
"system": "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/",
"system": "https://www.genenames.org",
},
"relation": "exactMatch",
},
Expand All @@ -357,14 +362,14 @@ class NormalizeService(BaseNormalizationService):
{
"coding": {
"code": "ENSG00000157764",
"system": "https://www.ensembl.org/id/",
"system": "https://www.ensembl.org",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "1943",
"system": "https://www.guidetopharmacology.org/GRAC/ObjectDisplayForward?objectId=",
"system": "https://www.guidetopharmacology.org",
},
"relation": "relatedMatch",
},
Expand All @@ -375,49 +380,49 @@ class NormalizeService(BaseNormalizationService):
{
"coding": {
"code": "BRAF",
"system": "https://cancer.sanger.ac.uk/cosmic/gene/overview?ln=",
"system": "https://cancer.sanger.ac.uk/cosmic",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "2284096",
"system": "https://www.ncbi.nlm.nih.gov/pubmed/",
"system": "https://pubmed.ncbi.nlm.nih.gov",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "uc003vwc.5",
"system": "https://genome.cse.ucsc.edu/cgi-bin/hgGene?hgg_gene=",
"system": "https://genome.ucsc.edu",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "164757",
"system": "https://www.omim.org/entry/",
"system": "https://www.omim.org",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "NM_004333",
"system": "https://www.ncbi.nlm.nih.gov/refseq/?term=",
"system": "https://www.ncbi.nlm.nih.gov/refseq/",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "P15056",
"system": "https://purl.uniprot.org/uniprot/",
"system": "https://www.uniprot.org",
},
"relation": "relatedMatch",
},
{
"coding": {
"code": "M95712",
"system": "https://www.ebi.ac.uk/ena/browser/view/",
"system": "https://www.ebi.ac.uk/ena/",
},
"relation": "relatedMatch",
},
Expand All @@ -428,7 +433,7 @@ class NormalizeService(BaseNormalizationService):
{
"coding": {
"code": "1565476",
"system": "https://www.ncbi.nlm.nih.gov/pubmed/",
"system": "https://pubmed.ncbi.nlm.nih.gov",
},
"relation": "relatedMatch",
},
Expand Down
Loading

0 comments on commit e2eb35c

Please sign in to comment.