Skip to content

Commit

Permalink
Fix unit test that did not add the source field to its synthetic test…
Browse files Browse the repository at this point in the history
… data.
  • Loading branch information
khituras committed Sep 20, 2024
1 parent 4cd3d4b commit 4443019
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
16 changes: 9 additions & 7 deletions gepi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Purpose of this software

The core of GePI is a web application for the user-friendly retrieval of descriptions of biomolecular interactions from the scientific literature, [PubMed](https://pubmed.ncbi.nlm.nih.gov/) (PM) and the [PubMed Central](https://www.ncbi.nlm.nih.gov/pmc/) (PMC) [open access subset](https://www.ncbi.nlm.nih.gov/pmc/tools/openftlist/). To this end, [JCoRe](https://github.com/JULIELab/jcore-base) pipeline components are used to form a number of [UIMA](https://uima.apache.org/) pipelines for the processing of PM and PMC in order to extract the interactions.
The core of GePI (**Ge**ne and **P**rotein **I**nteractions) is a web application for the user-friendly retrieval of descriptions of biomolecular interactions from the scientific literature, [PubMed](https://pubmed.ncbi.nlm.nih.gov/) (PM) and the [PubMed Central](https://www.ncbi.nlm.nih.gov/pmc/) (PMC) [open access subset](https://www.ncbi.nlm.nih.gov/pmc/tools/openftlist/). To this end, [JCoRe](https://github.com/JULIELab/jcore-base) pipeline components are used to form a number of [UIMA](https://uima.apache.org/) pipelines for the processing of PM and PMC in order to extract the interactions.

The GePI web application is available at https://gepi.coling.uni-jena.de/.

## Reference for this work

Expand Down Expand Up @@ -72,8 +74,8 @@ The `production` stage expects that the complete GePI project has been built in
Run the following commands to create a `development` container:

```bash
DOCKER_BUILDKIT=1 docker build -t gepi-dev:1.0.2 --target development .
docker run -dp 8080:8080 -v {/path/to/gepi/directory}:/var/gepi/dev -e GEPI_CONFIGURATION=<path to config file> --name gepi-dev gepi-dev:1.0.2
DOCKER_BUILDKIT=1 docker build -t gepi-dev:1.0.3-SNAPSHOT --target development .
docker run -dp 8080:8080 -v {/path/to/gepi/directory}:/var/gepi/dev -e GEPI_CONFIGURATION=<path to config file> --name gepi-dev gepi-dev:1.0.3-SNAPSHOT
```

The first command builds an image of the `development` stage. This will also build the `dependencies` stage where all the Java dependencies of the GePI application are downloaded and cached. This will take a while on the first execution but should be faster afterwards thanks to caching.
Expand All @@ -91,8 +93,8 @@ To run the `production` container, run

```bash
mvn clean package --projects gepi-webapp --also-make
DOCKER_BUILDKIT=1 docker build -t gepi:1.0.2 --target production .
docker run -dp 8080:8080 --name gepi gepi:1.0.2
DOCKER_BUILDKIT=1 docker build -t gepi:1.0.3-SNAPSHOT --target production .
docker run -dp 8080:8080 --name gepi gepi:1.0.3-SNAPSHOT
```

These commands
Expand Down Expand Up @@ -121,7 +123,7 @@ gepi.neo4j.bolt.url=bolt://<host>:<port>

A production environment has a few requirements that are of lesser importance during development. This section explains requirements and solutions that may come up during GePI deployment with the Docker container. While detailed explanations come below, the full Docker `run` command we use for deployment looks like the following:
```
docker run -dp 80:8080 -p 443:8443 -v /host/path/to/certificate.p12:/var/lib/jetty/etc/keystore.p12 -v /host/path/to/configuration.properties:/gepi-webapp-configuration.properties --add-host=host.docker.internal:host-gateway --name gepi -e GEPI_CONFIGURATION=/gepi-webapp-configuration.properties gepi:1.0.2 jetty.sslContext.keyStorePassword=<changeit>
docker run -dp 80:8080 -p 443:8443 -v /host/path/to/certificate.p12:/var/lib/jetty/etc/keystore.p12 -v /host/path/to/configuration.properties:/gepi-webapp-configuration.properties --add-host=host.docker.internal:host-gateway --name gepi -e GEPI_CONFIGURATION=/gepi-webapp-configuration.properties gepi:1.0.3-SNAPSHOT jetty.sslContext.keyStorePassword=<changeit>
```
Alternatively, the `docker-compose-webapp.yml` file can be used with a few additions.

Expand Down Expand Up @@ -159,5 +161,5 @@ Update the new version number in the following places:
* set `PRODUCTION_MODE` to true for releases
* the Docker image version in the `docker-compose.yml`
* the DB version in `gene-database.xml` in the `gepi-concept-database` module
* in execute `python ../../jcore-misc/jcore-scripts/createMetaDescriptors.py -c -i -r manual -v 1.0 gepi-indexing/gepi-indexing-base` given that `jcore-misc` has been cloned to the same directory as GePI
* execute `python ../../jcore-misc/jcore-scripts/createMetaDescriptors.py -c -i -r manual -v 1.0 gepi-indexing/gepi-indexing-base` given that `jcore-misc` has been cloned to the same base directory as GePI
* this updates the description file for the use with the JCoRe pipeline builder
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import java.util.Optional;
import java.util.stream.Stream;

import static de.julielab.gepi.core.retrieval.services.EventRetrievalService.FIELD_EVENT_ARG_TOP_HOMOLOGY_IDS;
import static de.julielab.gepi.core.retrieval.services.EventRetrievalService.FIELD_NUM_ARGUMENTS;
import static de.julielab.gepi.core.retrieval.services.EventRetrievalService.*;
import static org.assertj.core.api.Assertions.assertThat;

public class EventResponseProcessingServiceTest {
Expand All @@ -33,7 +32,7 @@ public void highlightMerging() {
private IElasticServerResponse getESResponseWithHighlighting(Map<String, List<String>> sentenceHighlights) {
final IElasticServerResponse response = Mockito.mock(IElasticServerResponse.class, inv -> null);

Mockito.when(response.getDocumentResults()).thenReturn(Stream.of(getSearchServerDocument(Map.of(EventRetrievalService.FIELD_PMID, "1234", EventRetrievalService.FIELD_EVENT_ARG_CONCEPT_IDS, List.of("tid007", "tid006"),FIELD_EVENT_ARG_TOP_HOMOLOGY_IDS, List.of("atid1", "atid2"), FIELD_NUM_ARGUMENTS, 1), sentenceHighlights)));
Mockito.when(response.getDocumentResults()).thenReturn(Stream.of(getSearchServerDocument(Map.of(EventRetrievalService.FIELD_PMID, "1234", EventRetrievalService.FIELD_EVENT_ARG_CONCEPT_IDS, List.of("tid007", "tid006"),FIELD_EVENT_ARG_TOP_HOMOLOGY_IDS, List.of("atid1", "atid2"), FIELD_NUM_ARGUMENTS, 1, FIELD_SOURCE, "pubmed"), sentenceHighlights)));
Mockito.when(response.getNumFound()).thenReturn(1L);
return response;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#The port number is automatically set in de.julielab.gepi.core.retrieval.services.EventRetrievalServiceIntegrationTest
#Fri Sep 20 11:59:19 CEST 2024
#Fri Sep 20 14:10:17 CEST 2024
elasticquery.sockettimeout=-1
elasticquery.url=localhost
elasticquery.clustername=gepi_testcluster
elasticquery.port=56176
elasticquery.port=56736
gepi.documents.index.name=gepi_testindex

0 comments on commit 4443019

Please sign in to comment.