Skip to content

Commit 2cb88e0

Browse files
committed
Merge branch 'hotfix-1.27.12'
2 parents 92fff7e + 4c349ec commit 2cb88e0

File tree

76 files changed

+896
-694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+896
-694
lines changed

gemma-core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>gemma</artifactId>
55
<groupId>gemma</groupId>
6-
<version>1.27.11</version>
6+
<version>1.27.12</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>gemma-core</artifactId>

gemma-core/src/main/java/ubic/gemma/core/analysis/service/ExpressionAnalysisResultSetFileServiceImpl.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ private String formatFactorValue( FactorValue factorValue ) {
9292
}
9393

9494
private String formatMeasurement( Measurement measurement ) {
95-
return measurement.getValue() + measurement.getUnit().getUnitNameCV();
95+
return measurement.getValue()
96+
+ ( measurement.getUnit() != null ? measurement.getUnit().getUnitNameCV() : "" );
9697
}
9798

9899
private String formatCharacteristics( Collection<Characteristic> characteristics ) {

gemma-core/src/main/java/ubic/gemma/core/annotation/reference/BibliographicReferenceService.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package ubic.gemma.core.annotation.reference;
2020

2121
import org.springframework.security.access.annotation.Secured;
22+
import ubic.gemma.core.search.SearchException;
2223
import ubic.gemma.model.common.description.BibliographicReference;
2324
import ubic.gemma.model.common.description.BibliographicReferenceValueObject;
2425
import ubic.gemma.model.common.description.DatabaseEntry;
@@ -123,9 +124,9 @@ Map<BibliographicReference, Collection<ExpressionExperiment>> getRelatedExperime
123124
@Secured({ "GROUP_ADMIN" })
124125
BibliographicReference refresh( String pubMedId );
125126

126-
List<BibliographicReferenceValueObject> search( SearchSettingsValueObject settings );
127+
List<BibliographicReferenceValueObject> search( SearchSettingsValueObject settings ) throws SearchException;
127128

128-
List<BibliographicReferenceValueObject> search( String query );
129+
List<BibliographicReferenceValueObject> search( String query ) throws SearchException;
129130

130131
BibliographicReference thaw( BibliographicReference bibliographicReference );
131132

gemma-core/src/main/java/ubic/gemma/core/annotation/reference/BibliographicReferenceServiceImpl.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.springframework.stereotype.Service;
2020
import org.springframework.transaction.annotation.Transactional;
2121
import ubic.gemma.core.loader.entrez.pubmed.PubMedXMLFetcher;
22+
import ubic.gemma.core.search.SearchException;
2223
import ubic.gemma.core.search.SearchService;
2324
import ubic.gemma.model.association.phenotype.PhenotypeAssociation;
2425
import ubic.gemma.model.common.description.BibliographicReference;
@@ -227,7 +228,7 @@ public BibliographicReference refresh( String pubMedId ) {
227228

228229
@Override
229230
@Transactional(readOnly = true)
230-
public List<BibliographicReferenceValueObject> search( SearchSettingsValueObject settings ) {
231+
public List<BibliographicReferenceValueObject> search( SearchSettingsValueObject settings ) throws SearchException {
231232
SearchSettings ss = SearchSettings.bibliographicReferenceSearch( settings.getQuery() );
232233

233234
//noinspection unchecked
@@ -265,7 +266,7 @@ public List<BibliographicReferenceValueObject> search( SearchSettingsValueObject
265266

266267
@Override
267268
@Transactional(readOnly = true)
268-
public List<BibliographicReferenceValueObject> search( String query ) {
269+
public List<BibliographicReferenceValueObject> search( String query ) throws SearchException {
269270
//noinspection unchecked
270271
List<BibliographicReference> resultEntities = searchService
271272
.search( SearchSettings.bibliographicReferenceSearch( query ), BibliographicReference.class );

gemma-core/src/main/java/ubic/gemma/core/apps/ExpressionExperimentManipulatingCLI.java

+9-7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.apache.commons.lang3.StringUtils;
2525
import ubic.gemma.core.apps.GemmaCLI.CommandGroup;
2626
import ubic.gemma.core.genome.gene.service.GeneService;
27+
import ubic.gemma.core.search.SearchException;
2728
import ubic.gemma.core.search.SearchResult;
2829
import ubic.gemma.core.search.SearchService;
2930
import ubic.gemma.core.util.AbstractCLI;
@@ -42,10 +43,7 @@
4243
import ubic.gemma.persistence.service.genome.taxon.TaxonService;
4344

4445
import java.io.IOException;
45-
import java.util.Collection;
46-
import java.util.Collections;
47-
import java.util.HashSet;
48-
import java.util.Set;
46+
import java.util.*;
4947
import java.util.stream.Collectors;
5048

5149
/**
@@ -184,7 +182,11 @@ protected void processOptions( CommandLine commandLine ) {
184182
}
185183
} else if ( commandLine.hasOption( 'q' ) ) {
186184
AbstractCLI.log.info( "Processing all experiments that match query " + commandLine.getOptionValue( 'q' ) );
187-
this.expressionExperiments = this.findExpressionExperimentsByQuery( commandLine.getOptionValue( 'q' ) );
185+
try {
186+
this.expressionExperiments = this.findExpressionExperimentsByQuery( commandLine.getOptionValue( 'q' ) );
187+
} catch ( SearchException e ) {
188+
log.error( "Failed to retrieve EEs for the passed query via -q.", e );
189+
}
188190
} else if ( taxon != null ) {
189191
if ( !commandLine.hasOption( "dataFile" ) ) {
190192
AbstractCLI.log.info( "Processing all experiments for " + taxon.getCommonName() );
@@ -305,7 +307,7 @@ private void experimentsFromEeSet( String optionValue ) {
305307
/**
306308
* Use the search engine to locate expression experiments.
307309
*/
308-
private Set<BioAssaySet> findExpressionExperimentsByQuery( String query ) {
310+
private Set<BioAssaySet> findExpressionExperimentsByQuery( String query ) throws SearchException {
309311
Set<BioAssaySet> ees = new HashSet<>();
310312

311313
// explicitly support one case
@@ -319,7 +321,7 @@ private Set<BioAssaySet> findExpressionExperimentsByQuery( String query ) {
319321
return ees;
320322
}
321323

322-
Collection<SearchResult> eeSearchResults = searchService
324+
List<SearchResult<?>> eeSearchResults = searchService
323325
.search( SearchSettings.expressionExperimentSearch( query ) ).get( ExpressionExperiment.class );
324326

325327
// Filter out all the ee that are not of correct taxon

gemma-core/src/main/java/ubic/gemma/core/association/phenotype/PhenotypeAssociationManagerService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import org.springframework.security.access.annotation.Secured;
1818
import ubic.basecode.ontology.model.OntologyTerm;
19+
import ubic.gemma.core.search.SearchException;
1920
import ubic.gemma.model.association.phenotype.PhenotypeAssociation;
2021
import ubic.gemma.model.common.description.BibliographicReferenceValueObject;
2122
import ubic.gemma.model.common.description.ExternalDatabaseValueObject;
@@ -147,7 +148,7 @@ Collection<EvidenceValueObject<? extends PhenotypeAssociation>> findEvidenceByGe
147148
* @param taxonId can be null to not constrain by taxon
148149
* @return list of Genes
149150
*/
150-
List<GeneEvidenceValueObject> findGenesWithEvidence( String query, Long taxonId );
151+
List<GeneEvidenceValueObject> findGenesWithEvidence( String query, Long taxonId ) throws SearchException;
151152

152153
/**
153154
* Load an evidence

gemma-core/src/main/java/ubic/gemma/core/association/phenotype/PhenotypeAssociationManagerServiceImpl.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import ubic.gemma.core.loader.entrez.pubmed.PubMedXMLFetcher;
3939
import ubic.gemma.core.loader.genome.gene.ncbi.homology.HomologeneService;
4040
import ubic.gemma.core.ontology.OntologyService;
41+
import ubic.gemma.core.search.SearchException;
4142
import ubic.gemma.core.search.SearchResult;
4243
import ubic.gemma.core.search.SearchService;
4344
import ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysis;
@@ -407,7 +408,7 @@ public Map<GeneValueObject, OntologyTerm> findGenesForPhenotype( String phenotyp
407408

408409
@Override
409410
@Transactional(readOnly = true)
410-
public List<GeneEvidenceValueObject> findGenesWithEvidence( String query, Long taxonId ) {
411+
public List<GeneEvidenceValueObject> findGenesWithEvidence( String query, Long taxonId ) throws SearchException {
411412

412413
if ( query == null || query.length() == 0 ) {
413414
throw new IllegalArgumentException( "No search query provided" );
@@ -421,7 +422,7 @@ public List<GeneEvidenceValueObject> findGenesWithEvidence( String query, Long t
421422
taxon = this.taxonService.load( taxonId );
422423
}
423424
SearchSettings settings = SearchSettings.geneSearch( newQuery, taxon );
424-
List<SearchResult> geneSearchResults = this.searchService.search( settings ).get( Gene.class );
425+
List<SearchResult<?>> geneSearchResults = this.searchService.search( settings ).get( Gene.class );
425426

426427
Collection<Gene> genes = new HashSet<>();
427428
if ( geneSearchResults == null || geneSearchResults.isEmpty() ) {

gemma-core/src/main/java/ubic/gemma/core/expression/experiment/service/ExpressionExperimentSearchService.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package ubic.gemma.core.expression.experiment.service;
1616

1717
import org.springframework.security.access.annotation.Secured;
18+
import ubic.gemma.core.search.SearchException;
1819
import ubic.gemma.core.search.SearchResultDisplayObject;
1920
import ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject;
2021

@@ -31,14 +32,14 @@ public interface ExpressionExperimentSearchService {
3132
* @return Collection of expression experiment entity objects
3233
*/
3334
@Secured({ "IS_AUTHENTICATED_ANONYMOUSLY", "AFTER_ACL_VALUE_OBJECT_COLLECTION_READ" })
34-
Collection<ExpressionExperimentValueObject> searchExpressionExperiments( String query );
35+
Collection<ExpressionExperimentValueObject> searchExpressionExperiments( String query ) throws SearchException;
3536

3637
/**
3738
* @param value the term values
3839
* @return Collection of expression experiment VOs for EEs that are associated with all the given terms.
3940
*/
4041
@Secured({ "IS_AUTHENTICATED_ANONYMOUSLY", "AFTER_ACL_VALUE_OBJECT_COLLECTION_READ" })
41-
Collection<ExpressionExperimentValueObject> searchExpressionExperiments( List<String> value );
42+
Collection<ExpressionExperimentValueObject> searchExpressionExperiments( List<String> value ) throws SearchException;
4243

4344
/**
4445
* does not include session bound sets
@@ -47,7 +48,7 @@ public interface ExpressionExperimentSearchService {
4748
* @param taxonId if the search should not be limited by taxon, pass in null
4849
* @return Collection of SearchResultDisplayObjects
4950
*/
50-
List<SearchResultDisplayObject> searchExperimentsAndExperimentGroups( String query, Long taxonId );
51+
List<SearchResultDisplayObject> searchExperimentsAndExperimentGroups( String query, Long taxonId ) throws SearchException;
5152

5253
List<SearchResultDisplayObject> getAllTaxonExperimentGroup( Long taxonId );
5354

gemma-core/src/main/java/ubic/gemma/core/expression/experiment/service/ExpressionExperimentSearchServiceImpl.java

+13-10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.apache.commons.logging.LogFactory;
2626
import org.springframework.beans.factory.annotation.Autowired;
2727
import org.springframework.stereotype.Component;
28+
import ubic.gemma.core.search.SearchException;
2829
import ubic.gemma.core.search.SearchResult;
2930
import ubic.gemma.core.search.SearchResultDisplayObject;
3031
import ubic.gemma.core.search.SearchService;
@@ -43,6 +44,7 @@
4344
import ubic.gemma.persistence.util.EntityUtils;
4445

4546
import java.util.*;
47+
import java.util.stream.Collectors;
4648

4749
/**
4850
* Handles searching for experiments and experiment sets
@@ -79,10 +81,10 @@ public ExpressionExperimentSearchServiceImpl( ExpressionExperimentSetService exp
7981
}
8082

8183
@Override
82-
public Collection<ExpressionExperimentValueObject> searchExpressionExperiments( String query ) {
84+
public Collection<ExpressionExperimentValueObject> searchExpressionExperiments( String query ) throws SearchException {
8385

8486
SearchSettings settings = SearchSettings.expressionExperimentSearch( query );
85-
List<SearchResult> experimentSearchResults = searchService.search( settings ).get( ExpressionExperiment.class );
87+
List<SearchResult<?>> experimentSearchResults = searchService.search( settings ).get( ExpressionExperiment.class );
8688

8789
if ( experimentSearchResults == null || experimentSearchResults.isEmpty() ) {
8890
ExpressionExperimentSearchServiceImpl.log.info( "No experiments for search: " + query );
@@ -91,15 +93,16 @@ public Collection<ExpressionExperimentValueObject> searchExpressionExperiments(
9193

9294
ExpressionExperimentSearchServiceImpl.log
9395
.info( "Experiment search: " + query + ", " + experimentSearchResults.size() + " found" );
96+
List<Long> eeIds = experimentSearchResults.stream().map( SearchResult::getResultId ).collect( Collectors.toList() );
9497
Collection<ExpressionExperimentValueObject> experimentValueObjects = expressionExperimentService
95-
.loadValueObjectsByIds( EntityUtils.getIds( experimentSearchResults ), true );
98+
.loadValueObjectsByIds( eeIds, true );
9699
ExpressionExperimentSearchServiceImpl.log
97100
.info( "Experiment search: " + experimentValueObjects.size() + " value objects returned." );
98101
return experimentValueObjects;
99102
}
100103

101104
@Override
102-
public Collection<ExpressionExperimentValueObject> searchExpressionExperiments( List<String> query ) {
105+
public Collection<ExpressionExperimentValueObject> searchExpressionExperiments( List<String> query ) throws SearchException {
103106

104107
Set<ExpressionExperimentValueObject> all = new HashSet<>();
105108
Set<ExpressionExperimentValueObject> prev = null;
@@ -119,7 +122,7 @@ public Collection<ExpressionExperimentValueObject> searchExpressionExperiments(
119122
}
120123

121124
@Override
122-
public List<SearchResultDisplayObject> searchExperimentsAndExperimentGroups( String query, Long taxonId ) {
125+
public List<SearchResultDisplayObject> searchExperimentsAndExperimentGroups( String query, Long taxonId ) throws SearchException {
123126

124127
List<SearchResultDisplayObject> displayResults = new LinkedList<>();
125128

@@ -129,7 +132,7 @@ public List<SearchResultDisplayObject> searchExperimentsAndExperimentGroups( Str
129132
return this.searchExperimentsAndExperimentGroupBlankQuery( taxonId );
130133
}
131134

132-
Map<Class<?>, List<SearchResult>> results = this.initialSearch( query, taxonId );
135+
Map<Class<?>, List<SearchResult<?>>> results = this.initialSearch( query, taxonId );
133136

134137
List<SearchResultDisplayObject> experimentSets = this.getExpressionExperimentSetResults( results );
135138
List<SearchResultDisplayObject> experiments = this.getExpressionExperimentResults( results );
@@ -250,9 +253,9 @@ public List<SearchResultDisplayObject> getAllTaxonExperimentGroup( Long taxonId
250253
}
251254

252255
private List<SearchResultDisplayObject> getExpressionExperimentResults(
253-
Map<Class<?>, List<SearchResult>> results ) {
256+
Map<Class<?>, List<SearchResult<?>>> results ) {
254257
// get all expressionExperiment results and convert result object into a value object
255-
List<SearchResult> srEEs = results.get( ExpressionExperiment.class );
258+
List<SearchResult<?>> srEEs = results.get( ExpressionExperiment.class );
256259
if ( srEEs == null ) {
257260
srEEs = new ArrayList<>();
258261
}
@@ -271,7 +274,7 @@ private List<SearchResultDisplayObject> getExpressionExperimentResults(
271274
}
272275

273276
private List<SearchResultDisplayObject> getExpressionExperimentSetResults(
274-
Map<Class<?>, List<SearchResult>> results ) {
277+
Map<Class<?>, List<SearchResult<?>>> results ) {
275278
List<SearchResultDisplayObject> experimentSets = new ArrayList<>();
276279

277280
if ( results.get( ExpressionExperimentSet.class ) != null ) {
@@ -291,7 +294,7 @@ private List<SearchResultDisplayObject> getExpressionExperimentSetResults(
291294
return experimentSets;
292295
}
293296

294-
private Map<Class<?>, List<SearchResult>> initialSearch( String query, Long taxonId ) {
297+
private Map<Class<?>, List<SearchResult<?>>> initialSearch( String query, Long taxonId ) throws SearchException {
295298
SearchSettings settings = SearchSettings.builder()
296299
.query( query )
297300
.resultType( ExpressionExperiment.class )

gemma-core/src/main/java/ubic/gemma/core/genome/gene/service/GeneSearchService.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package ubic.gemma.core.genome.gene.service;
2020

21+
import ubic.gemma.core.search.SearchException;
2122
import ubic.gemma.core.search.SearchResultDisplayObject;
2223
import ubic.gemma.model.genome.Gene;
2324
import ubic.gemma.model.genome.Taxon;
@@ -46,7 +47,7 @@ public interface GeneSearchService {
4647

4748
Collection<Gene> getGOGroupGenes( String goQuery, Taxon taxon );
4849

49-
Collection<SearchResultDisplayObject> searchGenesAndGeneGroups( String query, Long taxonId );
50+
Collection<SearchResultDisplayObject> searchGenesAndGeneGroups( String query, Long taxonId ) throws SearchException;
5051

5152
/**
5253
* Search for multiple genes at once. This attempts to limit the number of genes per query to only one.
@@ -56,7 +57,7 @@ public interface GeneSearchService {
5657
* @return collection of gene value objects
5758
* @throws IOException when there are IO problems
5859
*/
59-
Collection<GeneValueObject> searchMultipleGenes( String query, Long taxonId ) throws IOException;
60+
Collection<GeneValueObject> searchMultipleGenes( String query, Long taxonId ) throws IOException, SearchException;
6061

6162
/**
6263
* Search for multiple genes at once. This attempts to limit the number of genes per query to only one.
@@ -65,6 +66,6 @@ public interface GeneSearchService {
6566
* @param taxonId taxon id
6667
* @return query with match. Null values means nothing was found for that key (query)
6768
*/
68-
Map<String, GeneValueObject> searchMultipleGenesGetMap( Collection<String> query, Long taxonId );
69+
Map<String, GeneValueObject> searchMultipleGenesGetMap( Collection<String> query, Long taxonId ) throws SearchException;
6970

7071
}

gemma-core/src/main/java/ubic/gemma/core/genome/gene/service/GeneSearchServiceImpl.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
import org.springframework.stereotype.Service;
3030
import ubic.gemma.core.genome.gene.*;
3131
import ubic.gemma.core.ontology.providers.GeneOntologyService;
32-
import ubic.gemma.core.search.GeneSetSearch;
33-
import ubic.gemma.core.search.SearchResult;
34-
import ubic.gemma.core.search.SearchResultDisplayObject;
35-
import ubic.gemma.core.search.SearchService;
32+
import ubic.gemma.core.search.*;
3633
import ubic.gemma.model.common.search.SearchSettings;
3734
import ubic.gemma.model.genome.Gene;
3835
import ubic.gemma.model.genome.Taxon;
@@ -132,7 +129,7 @@ public Collection<Gene> getGOGroupGenes( String goQuery, Taxon taxon ) {
132129
}
133130

134131
@Override
135-
public Collection<SearchResultDisplayObject> searchGenesAndGeneGroups( String query, Long taxonId ) {
132+
public Collection<SearchResultDisplayObject> searchGenesAndGeneGroups( String query, Long taxonId ) throws SearchException {
136133
Taxon taxon = null;
137134
String taxonName = "";
138135
if ( taxonId != null ) {
@@ -170,7 +167,7 @@ public Collection<SearchResultDisplayObject> searchGenesAndGeneGroups( String qu
170167

171168
GeneSearchServiceImpl.log.debug( "getting results from searchService for " + query );
172169

173-
Map<Class<?>, List<SearchResult>> results = searchService.speedSearch( settings );
170+
Map<Class<?>, List<SearchResult<?>>> results = searchService.speedSearch( settings );
174171

175172
List<SearchResult> geneSetSearchResults = new ArrayList<>();
176173
List<SearchResult> geneSearchResults = new ArrayList<>();
@@ -306,7 +303,7 @@ public Collection<SearchResultDisplayObject> searchGenesAndGeneGroups( String qu
306303
}
307304

308305
@Override
309-
public Collection<GeneValueObject> searchMultipleGenes( String query, Long taxonId ) throws IOException {
306+
public Collection<GeneValueObject> searchMultipleGenes( String query, Long taxonId ) throws IOException, SearchException {
310307

311308
BufferedReader reader = new BufferedReader( new StringReader( query ) );
312309
String line;
@@ -326,7 +323,7 @@ public Collection<GeneValueObject> searchMultipleGenes( String query, Long taxon
326323
}
327324

328325
@Override
329-
public Map<String, GeneValueObject> searchMultipleGenesGetMap( Collection<String> query, Long taxonId ) {
326+
public Map<String, GeneValueObject> searchMultipleGenesGetMap( Collection<String> query, Long taxonId ) throws SearchException {
330327
Taxon taxon = taxonService.load( taxonId );
331328

332329
if ( taxon == null )
@@ -356,7 +353,7 @@ public Map<String, GeneValueObject> searchMultipleGenesGetMap( Collection<String
356353

357354
// searching one gene at a time is a bit slow; we do a quick search for symbols.
358355
SearchSettings settings = SearchSettings.geneSearch( line, taxon );
359-
List<SearchResult> geneSearchResults = searchService.speedSearch( settings ).get( Gene.class );
356+
List<SearchResult<?>> geneSearchResults = searchService.speedSearch( settings ).get( Gene.class );
360357

361358
if ( geneSearchResults == null || geneSearchResults.isEmpty() ) {
362359
// an empty set is an indication of no results.

0 commit comments

Comments
 (0)