Skip to content

Commit

Permalink
Merge branch 'main' into 2023_05_CHANGES
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoGonzales committed Oct 25, 2023
2 parents 6f3632e + 918491f commit e87570f
Show file tree
Hide file tree
Showing 23 changed files with 518 additions and 146 deletions.
21 changes: 7 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ core:settings:
- 'wget --no-cache --no-cookies -O ${MAVEN_SETTINGS} "${URL_MAVEN_SETTINGS}"'
script:
- if [ ! -f ${MAVEN_SETTINGS} ];
then echo "CI settings missing";
then echo "CI settings file missing";
fi
artifacts:
when: always
expire_in: 2 days
paths:
- ./${MAVEN_SETTINGS}
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "main"'
- when: manual
allow_failure: true

Expand All @@ -59,7 +59,7 @@ core:test:
junit:
- ./*/target/surefire-reports/TEST-*.xml
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "main"'
- when: manual
allow_failure: true

Expand All @@ -76,7 +76,7 @@ core:sonar:
- ./target
- ./*/target
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "main"'
- when: manual
allow_failure: true

Expand All @@ -87,18 +87,11 @@ core:deploy:
- core:settings
- core:sonar
only:
- master

#after_script:
# - 'pwd'
# - 'ls -al'
# - 'ls -al */'
# - 'ls -al */*/'
# - 'ls -al */*/*/'
- main

store:downstream:
stage: bridge
trigger: uniprot/deployment/mirror-uniprot-store
trigger: uniprot/deployment/uniprot-store
when: on_success
only:
- master
- main
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ public List<UniProtDatabaseDetail> getDBTypesByCategory(UniProtDatabaseCategory
.collect(Collectors.toList());
}

public List<UniProtDatabaseDetail> getInternalDatabaseDetails() {
return UniProtDatabaseTypes.INSTANCE.getAllDbTypes().stream()
.filter(dbDetail -> "internal".equals(dbDetail.getType()))
.collect(Collectors.toList());
}

private void init() {

String source =
Expand All @@ -72,6 +78,7 @@ private void init() {

String linkedReason = item.optString("linkedReason", null);
String idMappingName = item.optString("idMappingName", null);
String type = item.optString("type", null);

List<UniProtDatabaseAttribute> attributes = new ArrayList<>();
List<Property> properties = item.getProperties("attributes");
Expand All @@ -97,7 +104,8 @@ private void init() {
attributes,
isImplicit,
linkedReason,
idMappingName);
idMappingName,
type);
types.add(xdbType);
});
typeMap =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@
"name": "TAIR",
"displayName": "TAIR",
"category": "ORG",
"uriLink": "https://www.arabidopsis.org/servlets/TairObject?accession=%id",
"uriLink": "https://www.arabidopsis.org/servlets/TairObject?type=locus&name=%id",
"attributes": [
{
"name": "GeneName",
Expand Down Expand Up @@ -1904,5 +1904,54 @@
"displayName": "AlphaFoldDB",
"category": "3DS",
"uriLink": "https://alphafold.ebi.ac.uk/entry/%id"
}
},
{
"name": "eMIND",
"displayName": "eMIND",
"category": "MISC",
"uriLink": "https://research.bioinformatics.udel.edu/itextmine/integrate/doc/emind/medline/%id",
"type": "internal"
},
{
"name":"PGenN",
"displayName":"PGenN",
"category":"MISC",
"uriLink":"https://research.bioinformatics.udel.edu/itextmine/pgenn/doc/pgenn/medline/%id",
"type":"internal"
},
{
"name":"Alzforum",
"displayName":"Alzforum",
"category":"GVD",
"uriLink":"https://www.alzforum.org/node/%id",
"type":"internal"
},
{
"name":"GeneRIF",
"displayName":"GeneRIF",
"category":"SEQ",
"uriLink":"https://www.ncbi.nlm.nih.gov/gene?Db=gene&Cmd=DetailsSearch&Term=%id",
"type":"internal"
},
{
"name":"IC4R",
"displayName":"IC4R",
"category":"ORG",
"uriLink":"http://ic4r.org/osGene/%id",
"type":"internal"
},
{
"name":"ORCID",
"displayName":"ORCID",
"category":"MISC",
"uriLink":"https://orcid.org/%id",
"type":"internal"
},
{
"name":"PubTator",
"displayName":"PubTator",
"category":"MISC",
"uriLink":"https://www.ncbi.nlm.nih.gov/research/pubtator/?query=%id",
"type":"internal"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void testFailedValidation() {
opType.getAttributes(),
false,
null,
null,
null);

// validate, the category should mismatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void testProteomesType() {

@Test
void testDatabaseFieldSize() {
verifyGroupSize(UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(SEQUENCE_DATABASES), 6);
verifyGroupSize(UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(SEQUENCE_DATABASES), 7);
verifyGroupSize(
UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(D3_STRUCTURE_DATABASES), 12);
verifyGroupSize(
Expand All @@ -301,7 +301,7 @@ void testDatabaseFieldSize() {
13);
verifyGroupSize(UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(PTM_DATABASES), 10);
verifyGroupSize(
UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(GENERIC_VARIATION_DATABASES), 5);
UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(GENERIC_VARIATION_DATABASES), 6);
verifyGroupSize(UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(D2_GEL_DATABASES), 7);
verifyGroupSize(
UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(PROTEOMIC_DATABASES), 12);
Expand All @@ -314,13 +314,13 @@ void testDatabaseFieldSize() {
15);
verifyGroupSize(
UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(ORGANISM_SPECIFIC_DATABASES),
40);
41);
verifyGroupSize(
UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(PHYLOGENOMIC_DATABASES), 9);
verifyGroupSize(
UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(ENZYME_AND_PATHWAY_DATABASES),
10);
verifyGroupSize(UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(MISCELLANEOUS), 11);
verifyGroupSize(UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(MISCELLANEOUS), 15);
verifyGroupSize(
UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(GENE_EXPRESSION_DATABASES), 5);
verifyGroupSize(
Expand All @@ -331,6 +331,14 @@ void testDatabaseFieldSize() {
verifyGroupSize(UniProtDatabaseTypes.INSTANCE.getDBTypesByCategory(PROTEOMES_DATABASES), 1);
}

@Test
void testInternalCrossRefs() {
List<UniProtDatabaseDetail> internalCrossRefs =
UniProtDatabaseTypes.INSTANCE.getInternalDatabaseDetails();

assertEquals(7, internalCrossRefs.size());
}

private void verifyGroupSize(List<UniProtDatabaseDetail> dbTypesByCategory, int size) {
assertEquals(size, dbTypesByCategory.size());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class UniProtDatabaseDetail implements Serializable {

private static final long serialVersionUID = 8751881513996820892L;

private static final UniProtDatabaseAttribute DEFAULT_ATTRIBUTE =
public static final UniProtDatabaseAttribute DEFAULT_ATTRIBUTE =
new UniProtDatabaseAttribute("Description", "description", null);
private String name;
private String displayName;
Expand All @@ -20,6 +20,7 @@ public class UniProtDatabaseDetail implements Serializable {
private boolean implicit = false;
private String linkedReason = null;
private String idMappingName;
private String type;

UniProtDatabaseDetail() {
this.attributes = new ArrayList<>();
Expand All @@ -35,6 +36,28 @@ public UniProtDatabaseDetail(
boolean implicit,
String linkedReason,
String idMappingName) {
this(
name,
displayName,
category,
uriLink,
attributes,
implicit,
linkedReason,
idMappingName,
null);
}

public UniProtDatabaseDetail(
String name,
String displayName,
UniProtDatabaseCategory category,
String uriLink,
List<UniProtDatabaseAttribute> attributes,
boolean implicit,
String linkedReason,
String idMappingName,
String type) {
super();
this.name = name;
this.displayName = displayName;
Expand All @@ -47,6 +70,7 @@ public UniProtDatabaseDetail(
if ((attributes != null) && !attributes.isEmpty()) this.attributes.addAll(attributes);
else this.attributes.add(DEFAULT_ATTRIBUTE);
this.idMappingName = idMappingName;
this.type = type;
}

public String getName() {
Expand Down Expand Up @@ -81,6 +105,10 @@ public String getIdMappingName() {
return idMappingName;
}

public String getType() {
return this.type;
}

@Override
public int hashCode() {
return Objects.hash(
Expand All @@ -91,7 +119,8 @@ public int hashCode() {
this.uriLink,
this.implicit,
this.linkedReason,
this.idMappingName);
this.idMappingName,
this.type);
}

@Override
Expand All @@ -109,6 +138,7 @@ public boolean equals(Object obj) {
&& Objects.equals(this.uriLink, other.uriLink)
&& Objects.equals(this.implicit, other.implicit)
&& Objects.equals(this.linkedReason, other.linkedReason)
&& Objects.equals(this.idMappingName, other.idMappingName);
&& Objects.equals(this.idMappingName, other.idMappingName)
&& Objects.equals(this.type, other.type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum GenomeAssemblySource implements EnumDisplay {
ENSEMBLPROTISTS("EnsemblProtists"),
ENSEMBLMETAZOA("EnsemblMetazoa"),
ENSEMBL("Ensembl"),
REFSEQ("Refseq"),
REFSEQ("RefSeq"),
WORMBASE("WormBase");

private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ public interface ProteomeEntry extends Serializable {
GenomeAnnotation getGenomeAnnotation();

List<ExclusionReason> getExclusionReasons();

ProteomeStatistics getProteomeStatistics();
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class ProteomeEntryBuilder implements Builder<ProteomeEntry> {
private GenomeAnnotation genomeAnnotation;
private List<ExclusionReason> exclusionReasons = new ArrayList<>();
private Integer proteinCount;
private ProteomeStatistics proteomeStatistics;

@Override
public @Nonnull ProteomeEntry build() {
Expand All @@ -59,7 +60,8 @@ public class ProteomeEntryBuilder implements Builder<ProteomeEntry> {
genomeAssembly,
genomeAnnotation,
exclusionReasons,
proteinCount);
proteinCount,
proteomeStatistics);
}

public static @Nonnull ProteomeEntryBuilder from(@Nonnull ProteomeEntry instance) {
Expand All @@ -84,7 +86,8 @@ public class ProteomeEntryBuilder implements Builder<ProteomeEntry> {
.genomeAssembly(instance.getGenomeAssembly())
.genomeAnnotation(instance.getGenomeAnnotation())
.exclusionReasonsSet(instance.getExclusionReasons())
.proteinCount(instance.getProteinCount());
.proteinCount(instance.getProteinCount())
.proteomeStatistics(instance.getProteomeStatistics());
}

public @Nonnull ProteomeEntryBuilder proteomeId(ProteomeId id) {
Expand Down Expand Up @@ -225,4 +228,9 @@ public class ProteomeEntryBuilder implements Builder<ProteomeEntry> {
Utils.addOrIgnoreNull(exclusionReason, exclusionReasons);
return this;
}

public @Nonnull ProteomeEntryBuilder proteomeStatistics(ProteomeStatistics proteomeStatistics) {
this.proteomeStatistics = proteomeStatistics;
return this;
}
}
Loading

0 comments on commit e87570f

Please sign in to comment.