/** * Extract the ensembl gene accession (if any) among the list of uniprot cross references * @param crossReferences : the Uniprot cross references * @return the ensembl gene accession (if any) among the list of uniprot cross references, null otherwise */ protected static String extractENSEMBLGeneAccessionFrom(Collection<UniprotXref> crossReferences){ for (UniprotXref xRef : crossReferences){ if (xRef.getDatabase() != null){ if (DatabaseType.ENSEMBL.toString().equalsIgnoreCase(xRef.getDatabase())){ String accession = xRef.getAccession(); if (ensemblGenePattern.matcher(accession).matches()){ return accession; } return xRef.getAccession(); } } } return null; }