Skip to content

Commit

Permalink
make hgnc: seconday identifier and see if omim still works
Browse files Browse the repository at this point in the history
  • Loading branch information
kkarra committed Sep 22, 2021
1 parent de62042 commit a03a39c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ private String getGene(String g, String org) throws ObjectStoreException {
if(gene == null) {
System.out.println("creating new gene..." + g);
gene = createItem("Gene");
gene.setAttribute("primaryIdentifier", g);
if(g.startsWith("HGNC:")){
gene.setAttribute("secondaryIdentifier", g);
}else {
gene.setAttribute("primaryIdentifier", g);
}
gene.setReference("organism", org);
genes.put(g, gene);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,16 @@ private void createGeneByTaxonId(String taxonId, GeneInfoRecord record,
// xref
for (String key : record.xrefs.keySet()) {
for (String id : record.xrefs.get(key)) {
createCrossReference(gene.getIdentifier(), id, key, true);
if(key.startsWith("HGNC")){
gene.setAttribute("secondaryIdentifier", id);
}else {
createCrossReference(gene.getIdentifier(), id, key, true);
}
}
}

for (String ensemblId : record.ensemblIds) {
gene.setAttribute("secondaryIdentifier", ensemblId);
//gene.setAttribute("secondaryIdentifier", ensemblId);
createCrossReference(gene.getIdentifier(), ensemblId, "Ensembl", true);
}

Expand Down

0 comments on commit a03a39c

Please sign in to comment.