Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoGonzales committed Dec 6, 2024
1 parent 606d6ef commit 47003db
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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<UniParcCrossReference> xrefs, boolean hasActive, String id, String proteomeId, boolean isSource) {
Set<String> proteinName = new LinkedHashSet<>();
Set<String> geneNames = new LinkedHashSet<>();
Expand Down

0 comments on commit 47003db

Please sign in to comment.