diff --git a/core-parser/src/main/java/org/uniprot/core/parser/fasta/uniparc/UniParcProteomeFastaParser.java b/core-parser/src/main/java/org/uniprot/core/parser/fasta/uniparc/UniParcProteomeFastaParser.java index d8863d473..9d1b1609d 100644 --- a/core-parser/src/main/java/org/uniprot/core/parser/fasta/uniparc/UniParcProteomeFastaParser.java +++ b/core-parser/src/main/java/org/uniprot/core/parser/fasta/uniparc/UniParcProteomeFastaParser.java @@ -29,6 +29,9 @@ public static String toFasta(UniParcEntry entry) { for(UniParcCrossReference xref: entry.getUniParcCrossReferences()){ if(uniProtDatabases.contains(xref.getDatabase())){ uniProtXrefs.add(xref); + if(proteomeId == null && xref.hasProperties()){ + proteomeId = getProteomeId(xref.getProperties().get(0)); + } if(xref.isActive()){ hasActive = true; } @@ -51,6 +54,18 @@ public static String toFasta(UniParcEntry entry) { return sb.toString(); } + private static String getProteomeId(Property property) { + String result = null; + String[] sourcePropertyValues = property.getValue().split(","); + if(sourcePropertyValues.length == 1){ + String[] propertyValue = sourcePropertyValues[0].split(":"); + if(propertyValue.length > 1){ + result = propertyValue[1]; + } + } + return result; + } + private static StringBuilder getFastaHeader(List xrefs, boolean hasActive, String id, String proteomeId, boolean isSource) { Set proteinName = new LinkedHashSet<>(); Set geneNames = new LinkedHashSet<>();