Skip to content

Commit

Permalink
Avoid repeated lookup of RDP
Browse files Browse the repository at this point in the history
  • Loading branch information
markquintontulloch committed Dec 9, 2024
1 parent 08fc5a7 commit 77a5e6e
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ public class GeneXrefHelper {
@Inject CrossReferenceService xrefService;
@Inject GeneDAO geneDAO;

ResourceDescriptorPage ncbiGeneOtherExpressionPage = null;

@Transactional
public void addGeoCrossReference(Gene gene, String entrezCurie) {

CrossReference xref = new CrossReference();

ResourceDescriptorPage rdp = rdpService.getPageForResourceDescriptor("NCBI_Gene", "gene/other_expression");
if (ncbiGeneOtherExpressionPage == null) {
ncbiGeneOtherExpressionPage = rdpService.getPageForResourceDescriptor("NCBI_Gene", "gene/other_expression");
}
xref.setDisplayName("GEO");
xref.setReferencedCurie(entrezCurie);
xref.setResourceDescriptorPage(rdp);
xref.setResourceDescriptorPage(ncbiGeneOtherExpressionPage);

List<CrossReference> updatedXrefs = xrefService.getUpdatedXrefList(List.of(xref), gene.getCrossReferences());

Expand Down

0 comments on commit 77a5e6e

Please sign in to comment.