Skip to content

Commit

Permalink
Merge pull request #418 from Rothamsted/master
Browse files Browse the repository at this point in the history
MB and KHP latest
  • Loading branch information
AjitPS authored Apr 14, 2021
2 parents 97c99ce + 9e532f4 commit 7ce4d90
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 159 deletions.
179 changes: 62 additions & 117 deletions datasets/wheat-beta/client/sampleQuery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,85 +4,51 @@
<name>Example 1</name>
<description>Grain colour</description>
<term>color OR flavon* OR proanthocyanidin</term>
<gene>TraesCS1D02G351600</gene>
<gene>TraesCS1D02G276300</gene>
<gene>TraesCS2A02G527700</gene>
<gene>TraesCS2A02G025700</gene>
<gene>TraesCS2B02G558400</gene>
<gene>TraesCS2B02G038700</gene>
<gene>TraesCS2D02G530600</gene>
<gene>TraesCS2D02G493400</gene>
<gene>TraesCS3A02G464900</gene>
<gene>TraesCS3A02G226600</gene>
<gene>TraesCS3B02G006100</gene>
<gene>TraesCSU02G046300</gene>
<gene>TraesCSU02G043000</gene>
<gene>TraesCS3B02G280700</gene>
<gene>TraesCS1B02G420400</gene>
<gene>TraesCS3B02G510700</gene>
<gene>TraesCSU02G159400</gene>
<gene>TraesCS3B02G006600</gene>
<gene>TraesCS3B02G257900</gene>
<gene>TraesCS3B02G277600</gene>
<gene>TraesCS3B02G007400</gene>
<gene>TraesCS3B02G006500</gene>
<gene>TraesCS3A02G007300</gene>
<gene>TraesCS3B02G006300</gene>
<gene>TraesCS3B02G010500</gene>
<gene>TraesCS3D02G224600</gene>
<gene>TraesCSU02G140100</gene>
<gene>TraesCS3D02G463200</gene>
<gene>TraesCS3D02G468500</gene>
<gene>TraesCS3D02G468400</gene>
<gene>TraesCSU02G040800</gene>
<gene>TraesCS4A02G206800</gene>
<gene>TraesCS4A02G085900</gene>
<gene>TraesCS6A02G369700</gene>
<gene>TraesCS6B02G406400</gene>
<gene>TraesCS6B02G405900</gene>
<gene>TraesCSU02G069200</gene>
<gene>TRAESCS3D02G468400</gene>
<gene>TRAESCS2B02G038700</gene>
<gene>TRAESCS2A02G025700</gene>
<gene>TRAESCS2A02G527700</gene>
<gene>TRAESCS2D02G530600</gene>
<gene>TRAESCS2B02G558400</gene>
<gene>TRAESCS3B02G257900</gene>
<gene>TRAESCS3A02G226600</gene>
<gene>TRAESCS3D02G224600</gene>
<gene>TRAESCS2D02G493400</gene>
<gene>TRAESCS6A02G369700</gene>
<gene>TRAESCS6B02G406400</gene>
<gene>TRAESCS6B02G405900</gene>
<gene>TRAESCS3B02G280700</gene>
<gene>TRAESCS4A02G085900</gene>
<gene>TRAESCS3B02G006300</gene>
<gene>TRAESCS3B02G007400</gene>
<gene>TRAESCS4A02G206800</gene>
<gene>TRAESCS3B02G006100</gene>
<gene>TRAESCS3A02G464900</gene>
</query>
<query>
<name>Example 2</name>
<description>Pre-harvest sprouting</description>
<term>"seed germination" OR "seed dormancy"</term>
<gene>TraesCS1D02G351600</gene>
<gene>TraesCS1D02G276300</gene>
<gene>TraesCS2A02G527700</gene>
<gene>TraesCS2A02G025700</gene>
<gene>TraesCS2B02G558400</gene>
<gene>TraesCS2B02G038700</gene>
<gene>TraesCS2D02G530600</gene>
<gene>TraesCS2D02G493400</gene>
<gene>TraesCS3A02G464900</gene>
<gene>TraesCS3A02G226600</gene>
<gene>TraesCS3B02G006100</gene>
<gene>TraesCSU02G046300</gene>
<gene>TraesCSU02G043000</gene>
<gene>TraesCS3B02G280700</gene>
<gene>TraesCS1B02G420400</gene>
<gene>TraesCS3B02G510700</gene>
<gene>TraesCSU02G159400</gene>
<gene>TraesCS3B02G006600</gene>
<gene>TraesCS3B02G257900</gene>
<gene>TraesCS3B02G277600</gene>
<gene>TraesCS3B02G007400</gene>
<gene>TraesCS3B02G006500</gene>
<gene>TraesCS3A02G007300</gene>
<gene>TraesCS3B02G006300</gene>
<gene>TraesCS3B02G010500</gene>
<gene>TraesCS3D02G224600</gene>
<gene>TraesCSU02G140100</gene>
<gene>TraesCS3D02G463200</gene>
<gene>TraesCS3D02G468500</gene>
<gene>TraesCS3D02G468400</gene>
<gene>TraesCSU02G040800</gene>
<gene>TraesCS4A02G206800</gene>
<gene>TraesCS4A02G085900</gene>
<gene>TraesCS6A02G369700</gene>
<gene>TraesCS6B02G406400</gene>
<gene>TraesCS6B02G405900</gene>
<gene>TraesCSU02G069200</gene>
<gene>TRAESCS3D02G468400</gene>
<gene>TRAESCS2B02G038700</gene>
<gene>TRAESCS2A02G025700</gene>
<gene>TRAESCS2A02G527700</gene>
<gene>TRAESCS2D02G530600</gene>
<gene>TRAESCS2B02G558400</gene>
<gene>TRAESCS3B02G257900</gene>
<gene>TRAESCS3A02G226600</gene>
<gene>TRAESCS3D02G224600</gene>
<gene>TRAESCS2D02G493400</gene>
<gene>TRAESCS6A02G369700</gene>
<gene>TRAESCS6B02G406400</gene>
<gene>TRAESCS6B02G405900</gene>
<gene>TRAESCS3B02G280700</gene>
<gene>TRAESCS4A02G085900</gene>
<gene>TRAESCS3B02G006300</gene>
<gene>TRAESCS3B02G007400</gene>
<gene>TRAESCS4A02G206800</gene>
<gene>TRAESCS3B02G006100</gene>
<gene>TRAESCS3A02G464900</gene>
</query>
<query>
<name>Example 3</name>
Expand All @@ -105,46 +71,21 @@
<name>Example 4</name>
<description>Rust response</description>
<term>rust OR response OR disease</term>
<gene>TraesCS1B02G343700</gene>
<gene>TraesCS1B02G343800</gene>
<gene>TraesCS1B02G343900</gene>
<gene>TraesCS1D02G156800</gene>
<gene>TraesCS2A02G157900</gene>
<gene>TraesCS2A02G395200</gene>
<gene>TraesCS2B02G183200</gene>
<gene>TraesCS2B02G184100</gene>
<gene>TraesCS2B02G184100</gene>
<gene>TraesCS2B02G184100</gene>
<gene>TraesCS2B02G184100</gene>
<gene>TraesCS2D02G009700</gene>
<gene>TraesCS2D02G010700</gene>
<gene>TraesCS2D02G165200</gene>
<gene>TraesCS3B02G381600</gene>
<gene>TraesCS4A02G456300</gene>
<gene>TraesCS5B02G241800</gene>
<gene>TraesCS5B02G337300</gene>
<gene>TraesCS5B02G347900</gene>
<gene>TraesCS5D02G559100</gene>
<gene>TraesCS5D02G560600</gene>
<gene>TraesCS5D02G560900</gene>
<gene>TraesCS5D02G560900</gene>
<gene>TraesCS5D02G560900</gene>
<gene>TraesCS6A02G416300</gene>
<gene>TraesCS6A02G417500</gene>
<gene>TraesCS6A02G417600</gene>
<gene>TraesCS6A02G419100</gene>
<gene>TraesCS6B02G462300</gene>
<gene>TraesCS6B02G468200</gene>
<gene>TraesCS6B02G470800</gene>
<gene>TraesCS6B02G471500</gene>
<gene>TraesCS6B02G471700</gene>
<gene>TraesCS6B02G473000</gene>
<gene>TraesCS6B02G473300</gene>
<gene>TraesCS6D02G398300</gene>
<gene>TraesCS6D02G401700</gene>
<gene>TraesCS6D02G405600</gene>
<gene>TraesCS6D02G405600</gene>
<gene>TraesCS7A02G033100</gene>
<gene>TRAESCS5B02G337300</gene>
<gene>TRAESCS6D02G405600</gene>
<gene>TRAESCS6A02G417600</gene>
<gene>TRAESCS5D02G560900</gene>
<gene>TRAESCS2A02G395200</gene>
<gene>TRAESCS2D02G010700</gene>
<gene>TRAESCS6A02G416300</gene>
<gene>TRAESCS5B02G241800</gene>
<gene>TRAESCS2B02G183200</gene>
<gene>TRAESCS5D02G560600</gene>
<gene>TRAESCS6D02G401700</gene>
<gene>TRAESCS1B02G343800</gene>
<gene>TRAESCS6B02G462300</gene>
<gene>TRAESCS7A02G033100</gene>
<gene>TRAESCS4A02G456300</gene>
</query>
<query>
<name>Example 5</name>
Expand All @@ -155,9 +96,13 @@
<chromosome>5A</chromosome>
<start>580000000</start>
<end>590000000</end>
<label>QTL</label>
<label>QTL1</label>
</region>
<gene>ADA2A</gene>
<gene>BPM5</gene>
<region>
<chromosome>2D</chromosome>
<start>280000000</start>
<end>310000000</end>
<label>QTL2</label>
</region>
</query>
</sampleQueries>
4 changes: 2 additions & 2 deletions rres/dockerhub-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ EOT
echo -e "--- Stopping, cleaning and updating Docker\n"
docker stop wheat-ci || true
docker rm wheat-ci || true
#docker system prune --all --force
#docker pull knetminer/knetminer
docker system prune --all --force
docker pull knetminer/knetminer

echo -e "--- Cleaning Knetminer dataset directory\n"
./cleanup-volume.sh --all "$dataset_dir"
Expand Down
29 changes: 17 additions & 12 deletions server-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@
the server-datasource-api module.
</description>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>ga.properties</include>
</includes>
</resource>
</resources>
</build>

<dependencies>
<dependency>
<groupId>org.springframework</groupId>
Expand Down Expand Up @@ -100,4 +88,21 @@
<artifactId>javax.annotation-api</artifactId>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>ga.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
</resources>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ protected final ResponseEntity<Object> handleExceptionInternal (
* status code if present. Else, let {@link #handleExceptionInternal(Exception, Object, HttpHeaders, HttpStatus, WebRequest)}
* to set a generic {@link HttpStatus#INTERNAL_SERVER_ERROR}.
*
* TODO: NotReadyException requires {@link HttpStatus#SERVICE_UNAVAILABLE}, including this exception here requires
* jutils dependency.
*
*/
@ExceptionHandler
@SuppressWarnings ( "unchecked" )
Expand All @@ -85,7 +88,7 @@ protected final ResponseEntity<Object> handleExceptionInternal (
return (ResponseEntity<KnetminerExceptionResponse>) (ResponseEntity<?>)
this.handleExceptionInternal ( ex, null, new HttpHeaders (), status, request );
}

/**
* Takes the status code from {@link ResponseStatusException#getStatus() code}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ private void init ()
var ondexServiceProvider = OndexServiceProvider.getInstance ();
var dataService = ondexServiceProvider.getDataService ();

// this is quick and can be done in advance, so that we have what we need to be able to start answering the
// URLs
// this pre-loads some properties in advance, so that we have what we need (ie, data source name) to be able
// to start answering the API URLs
// This is also quick enough to be done synchronously.
dataService.loadOptions ( configXmlPath );
var dsName = dataService.getDataSourceName ();
if ( dsName == null ) throw new IllegalArgumentException (
Expand Down Expand Up @@ -202,29 +203,25 @@ private <T extends KeywordResponse> T _keyword(T response, KnetminerRequest requ
genes.addAll(geneMap.keySet());
log.info("Number of genes: " + genes.size());

if (userGenes != null) {
/* use this (Set<ONDEXConcept> userGenes) in place of the genes ArrayList<ONDEXConcept> genes. */
// genes= new ArrayList<ONDEXConcept> (userGenes);

/* filter scored results (ArrayList<ONDEXConcept> genes) to only retain sorted genes (by KnetScore)
from user gene list (Set<ONDEXConcept> userGenes) */
if (userGenes != null)
{
// Filter by user-provided list
Iterator<ONDEXConcept> itr = genes.iterator();
while (itr.hasNext()) {
ONDEXConcept gene = itr.next();
if (!userGenes.contains(gene)) {
itr.remove();
}
}

/* also, add any missing genes from user list (Set<ONDEXConcept> userGenes) that weren't already in the scored results
(ArrayList<ONDEXConcept> genes) due to no evidences */

// And re-add missing user-genes (which possibly, didn't score well)
for (ONDEXConcept userGene : userGenes) {
if (!genes.contains(userGene)) {
genes.add(userGene);
geneMap.put(userGene, 0.0); // Ensure the gene is placed into the HashMap
geneMap.put(userGene, 0.0);
}
}
log.info("Using user gene list... genes: " + genes.size());
log.info("Using user gene list, genes: " + genes.size());
}
if (response.getClass().equals(QtlResponse.class)) {
log.info("QTL response...");
Expand Down
Loading

0 comments on commit 7ce4d90

Please sign in to comment.