1.0.3 • Published 1 year ago

@labinfo/hgnc-get-gene-info v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

HGNC Gene Info Wrapper

This package is designed to facilitate interactions with the Human Gene Nomenclature Committee (HGNC) API. It enables the retrieval of genetic information using specific methods based on stored or searchable fields

Properties

  • rootURL: string: Base URL for API requests to HGNC. Default value is 'https://rest.genenames.org'.
  • frontRootURL: string: Base URL for requests to HGNC Site. Default value is 'https://www.genenames.org'.
  • output: "XML" | "JSON": Desired output format for the API responses. Possible values are 'XML' or 'JSON', with 'JSON' being the default.

Methods

  • fetchInfo(): Returns general information available from the API.
  • fetchBy(storedField: string, query: any): Fetches information from the API based on a specific field and a query. Throws an error if the specified field is not in the storedFields list.
  • searchByAllFields(query: any): Conducts a search on all searchable fields with the specified query.
  • searchBy(searchableField: string, query: any): Conducts a search on a specific field with the specified query. Throws an error if the specified field is not in the searchableFields list.
  • dbOverview(dumentType:string): Returns general information from database.

Accessible Properties

  • storedFields: Returns a list of fields that can be specified for the fetchBy method.
  • searchableFields: Returns a list of fields that can be specified for the searchBy method.
  • documentTypes: Return s list of fields that can br specified for th dbOverview method.

Usage Examples

Creating an Instance of the Class

const hgnc = new HGNC();

Fetching General Information

The information request (https://rest.genenames.org/info) is utilized to obtain details about the service itself rather than to retrieve data from the server. The response from this request will provide information such as the last update time of the server data (lastModified), the total number of documents (numDoc), which fields are searchable through search and fetch methods (searchableFields), and which fields can be returned by the fetch operation (storedFields).

async () => {
  const info = await hgnc.fetchInfo();
};

Fetching by a Specific Field

The fetch request is the primary method used to obtain specific records from the server, which will include all fields listed in the "storedFields" section of the info response. The fetch operation requires the user to specify a queryable field (as detailed in the "searchableFields" section of the info) along with the search term in the URL.

The definition list below shows all the fields that could possibly be returned within a fetch request:

FieldTypeDescriptionExample URL
agrstringThe Alliance of Genomic Resources HGNC ID for the Human gene page within the resource.https://www.alliancegenome.org/gene/<AGR HGNC ID>
alias_namestring arraySee alias_name within the searchable fields for the definition.
alias_symbolstring arraySee alias_symbol within the searchable fields for the definition.
bioparadigms_slcstringSymbol used to link to the SLC tables database at bioparadigms.org for the gene.http://slc.bioparadigms.org/protein?GeneName=<SYMBOL>
ccds_idstring arraySee ccds_id within the searchable fields for the definition.https://www.ncbi.nlm.nih.gov/CCDS/CcdsBrowse.cgi?REQUEST=CCDS&DATA=<CCDS ID>
cdstringSymbol used within the Human Cell Differentiation Molecule database for the gene.http://www.hcdm.org/index.php?option=com_molecule&cdnumber=<SYMBOL>
cosmicstringSymbol used within the Catalogue of somatic mutations in cancer for the gene.http://cancer.sanger.ac.uk/cosmic/gene/overview?ln=<SYMBOL>
curator_notesstring arraySee curator_notes within the searchable fields for the definition.
date_approved_reserveddateThe date the entry was first approved.
date_modifieddateDate the entry was last modified.
date_name_changeddateThe date the gene name was last changed.
date_symbol_changeddateThe date the gene symbol was last changed.
enastring arraySee ena within the searchable fields for the definition.https://www.ebi.ac.uk/ena/data/view/<ENA ACCESSION>
ensembl_gene_idstringSee ensembl_gene_id within the searchable fields for the definition.https://www.ensembl.org/Homo_sapiens/Gene/Summary?g=<ENSEMBL GENE ID>
entrez_idstringSee entrez_id within the searchable fields for the definition.https://www.ncbi.nlm.nih.gov/gene/<ID>
enzyme_idstring arrayENZYME EC accession number.http://enzyme.expasy.org/EC/<EC ACCESSION NUMBER>
genccstring arrayHGNC ID associated to a Gene Curation Coalition (GenCC) record.https://search.thegencc.org/genes/<HGNC ID>
gene_groupstringHGNC gene group names to which the gene belongs.
gene_group_idint arrayHGNC gene group ID to which the gene belongs./data/genegroup/#!/group/<ID>
gtrnadbstringThe GtRNAdb ID to which the gene belongs. This will only appear if the gene is a tRNA.http://gtrnadb.ucsc.edu/genomes/eukaryota/Hsapi38/genes/<gtrnadb>.html
hgnc_idstringSee hgnc_id within the searchable fields for the definition./data/gene-symbol-report/#!/hgnc_id/<HGNC ID>
homeodbintHomeobox Database ID.http://homeodb.cbi.pku.edu.cn/gene_info.get?id=<ID>
horde_idstringSymbol used within HORDE for the gene.http://genome.weizmann.ac.il/horde/card/index/symbol:<SYMBOL>
imgtstringSymbol used within international ImMunoGeneTics information system.http://www.imgt.org/IMGT_GENE-DB/GENElect?query=2+<SYMBOL>&species=Homo+sapiens
intermediate_filament_dbstringID used to link to the Human Intermediate Filament Database.http://www.interfil.org/details.php?id=<ID>
iupharstringThe objectId used to link to the IUPHAR/BPS Guide to PHARMACOLOGY database.http://www.guidetopharmacology.org/GRAC/ObjectDisplayForward?objectId=<ID>
lncipediastringThe LNCipedia ID to which the gene belongs. This will only appear if the gene is a long non-coding RNA.https://lncipedia.org/db/gene/<lncipedia>
lncrnadbstringlncRNA Database ID.http://www.lncrnadb.org/<ID>
locationstringCytogenetic location of the gene (e.g., 2q34).
locus_groupstringSee locus_group within the searchable fields for the definition.
locus_typestringSee locus_type within the searchable fields for the definition.
lsdbstring arrayThe name of the Locus Specific Mutation Database and URL for the gene separated by a | character.eg Mutations of the ATP-binding Cassette Transporter Retina\|http://www.retina-international.org/files/sci-news/abcrmut.htm
mamit-trnadbintID to link to the Mamit-tRNA database.http://mamit-trna.u-strasbg.fr/mutations.asp?idAA=<ID>
mane_selectstring arraySee mane_select within the searchable fields for the definition.
meropsstringID used to link to the MEROPS peptidase database.https://www.ebi.ac.uk/merops/cgi-bin/pepsum?id=<ID>
mgd_idstring arraySee mgd_id within the searchable fields for the definition.http://www.informatics.jax.org/marker/<MGD ID>
mirbasestringmiRBase ID.http://www.mirbase.org/cgi-bin/mirna_entry.pl?acc=<ID>
namestringSee name within the searchable fields for the definition.
omim_idint arrayOnline Mendelian Inheritance in Man (OMIM) ID.http://www.omim.org/entry/<ID>
orphanetintOrphanet ID.http://www.orpha.net/consor/cgi-bin/OC_Exp.php?Lng=GB&Expert=<ID>
prev_namestring arraySee prev_name within the searchable fields for the definition.
prev_symbolstring arraySee prev_symbol within the searchable fields for the definition.
pseudogene.orgstringPseudogene.org ID.http://tables.pseudogene.org/<ID>
pubmed_idlong arrayPubmed and Europe Pubmed Central PMIDs.https://www.ncbi.nlm.nih.gov/pubmed/<PMID> and https://europepmc.org/search/?page=1&query=<PMID>
refseq_accessionstring arraySee refseq_accession within the searchable fields for the definition.https://www.ncbi.nlm.nih.gov/nuccore/<REFSEQ ACCESSION>
rgd_idstring arraySee rgd_id within the searchable fields for the definition. To use the ID to link to RGD remove "RGD:" from the ID.http://rgd.mcw.edu/rgdweb/report/gene/main.html?id=<RGD ID>
rna_central_idstring arraySee rna_central_id within the searchable fields for the definition.https://rnacentral.org/rna/<RNACentral ID>/9606
snornabasestringsnoRNABase ID.https://www-snorna.biotoul.fr//plus.php?snoid=<ID>
statusstringSee status within the searchable fields for the definition.
symbolstringSee symbol within the searchable fields for the definition.
symbol_report_tagstringSee symbol_report_tag within the searchable fields for the definition.
ucsc_idstringSee ucsc_id within the searchable fields for the definition.
uniprot_idsstring arraySee uniprot_ids within the searchable fields for the definition.http://www.uniprot.org/uniprot/<UNIPROT ID>
uuidstringUnique ID held within the search server.
vega_idstringSee vega_id within the searchable fields for the definition.http://vega.sanger.ac.uk/Homo_sapiens/Gene/Sequence?db=core;g=<VEGA GENE ID>
async () => {
  const resource = "ensembl_gene_id";
  const query = "ENSG00000166526";
  const data = await hgnc.fetchBy(resource, query);
};

Search

The search request is more powerful than the fetch for querying the database, but the search only returns the fields hgnc_id, symbol, and score. If you want to retrieve all the data for a set of genes from the search results, the user could use the hgnc_id returned by the search to then initiate a request for the hgnc_id using fetch.

Below is a definition list containing the fields that can be used to fetch and search records found within the HGNC record.

FieldDescriptionExample URL
alias_nameOther names used to refer to this gene as seen in the "Alias names" field in the gene symbol report.https://rest.genenames.org/search/alias_name/%22A-kinase%20anchor%20protein,%20350kDa%22
alias_symbolOther symbols used to refer to this gene as seen in the "Alias symbols" field in the gene symbol report.https://rest.genenames.org/search/alias_symbol/BRAF1
ccds_idConsensus CDS ID. This field may be found within the "Nucleotide resources" section of the gene symbol report.https://rest.genenames.org/search/ccds_id/CCDS5863
curator_notesThis field contains additional information related to the entry that has been manually added by an HGNC curator.https://rest.genenames.org/search/curator_notes/functional
enaInternational Nucleotide Sequence Database Collaboration (GenBank, ENA, and DDBJ) accession number(s).https://rest.genenames.org/search/ena/M95712
ensembl_gene_idEnsembl gene ID. Found within the "Gene resources" section of the gene symbol report.https://rest.genenames.org/search/ensembl_gene_id/ENSG00000157764
entrez_idEntrez gene ID. Found within the "Gene resources" section of the gene symbol report.https://rest.genenames.org/search/entrez_id/673
hgnc_idHGNC ID. A unique ID created by the HGNC for every approved symbol.https://rest.genenames.org/search/hgnc_id/1097
locationThe chromosomal location. For details on searching specific chromosomes or chromosome arms, please use wildcards.https://rest.genenames.org/search/location/01*
locus_groupA group name for a set of related locus types as defined by the HGNC.https://rest.genenames.org/search/locus_group/%22non-coding%20RNA%22
locus_typeThe locus type as defined by the HGNC.https://rest.genenames.org/search/locus_type/%22RNA,%20long%20non-coding%22
mane_selectMANE Select nucleotide accession with version.https://rest.genenames.org/search/locus_type/%22RNA,%20long%20non-coding%22
mgd_idMouse genome informatics database ID. Found within the "Homologs" section of the gene symbol report.https://rest.genenames.org/search/mgd_id/%22MGI:88190%22
nameHGNC approved name for the gene. Equates to the "Approved name" field within the gene symbol report.https://rest.genenames.org/search/name/%22zinc%20finger%20protein%20536%22
omim_idAn Online Mendelian Inheritance in Man (OMIM) ID.https://rest.genenames.org/search/omim_id/194510
prev_nameGene names previously approved by the HGNC for this gene. Equates to the "Previous names" field within the gene symbol report.https://rest.genenames.org/search/prev_name/%22solute%20carrier%20family%205%20(choline%20transporter),%20member%207%22
prev_symbolSymbols previously approved by the HGNC for this gene. Equates to the "Previous symbols" field within the gene symbol report.https://rest.genenames.org/search/prev_symbol/RN5S49
refseq_accessionRefSeq nucleotide accession. Found within the "Nucleotide resources" section of the gene symbol report.https://rest.genenames.org/search/refseq_accession/NM_033360
rgd_idRat genome database gene ID. Found within the "Homologs" section of the gene symbol report.https://rest.genenames.org/search/rgd_id/%22RGD:2981%22
rna_central_idAn RNAcentral ID. Found within the "Nucleotide resources" section of the gene symbol report.https://rest.genenames.org/search/rna_central_id/URS000075AC83
statusStatus of the symbol report, which can be either "Approved" or "Entry Withdrawn".https://rest.genenames.org/search/status/Approved
symbolThe HGNC approved gene symbol. Equates to the "Approved symbol" field within the gene symbol report.https://rest.genenames.org/search/symbol/KLF4
symbol_report_tagThe tag that may appear next to the title of the symbol report. Tags include "Ambiguous" for ambiguous locus type genes, "Placeholder symbol", and "Stable symbol".https://rest.genenames.org/search/symbol_report_tag/Ambiguous
ucsc_idUCSC gene ID. Found within the "Gene resources" section of the gene symbol report.https://rest.genenames.org/search/ucsc_id/%22uc001rgp%22
uniprot_idsUniProt protein accession. Found within the "Protein resources" section of the gene symbol report.https://rest.genenames.org/search/uniprot_ids/P00568
vega_idVega gene ID. Found within the "Gene resources" section of the gene symbol report.https://rest.genenames.org/search/vega_id/OTTHUMG00000020722

Searching by All Fields

async () => {
  const query = "BRAF";
  const data = await hgnc.searchByAllFields(query);
};

Searching by a Specific Field

Search can do more powerful request then just a simple look up on a field as seen in the examples below:

Search exampleNote
ZNF*Return all records that have symbols that start with ZNF
ZNF?Return all records that have symbols that start with ZNF and includes an extra character after ZNF (i.e., ZNF3 but not ZNF12)
:ZNF3An alternative form of https://rest.genenames.org/search/symbol/ZNF3
:ZNF*+AND+status:ApprovedReturn all records that have symbols that start with ZNF which have been approved by the HGNC
:ZNF3+OR+ZNF12Return ZNF3 and ZNF12
:ZNF*+NOT+status:ApprovedReturn all records that have symbols that start with ZNF which are not approved (i.e., entry withdrawn)
async () => {
  const resource = "symbol";
  const query = "ZNF*"; // Return all records that have symbols that start with ZNF
  const data = await hgnc.searchBy(resource, query);
};
async () => {
  const resource = "symbol";
  const query = ":ZNF*+NOT+status:Approved"; // Return all records that have symbols that start with ZNF which are not approved
  const data = await hgnc.searchBy(resource, query);
};

DB Overview

This method returns an overview in numbers of the database data. You can see the JSON schema of the response in this file.

async () => {
  const documentType = "gene"; // "gene", "group" or "site"
  const {response}  = await hgnc.dbOverview(documentType);
};

This document covers the basic functionalities of the HGNC class for interacting with the HGNC API, making it easier to retrieve genetic data efficiently and in a structured manner.

For more detailed documentation, access the link: HGNC REST API Help.