Skip to content

Commit fbe8519

Browse files
committed
Merge branch 'hotfix-1.31.10' into development
2 parents b56ebd6 + 00d7725 commit fbe8519

File tree

319 files changed

+10947
-2114
lines changed

Some content is hidden

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

319 files changed

+10947
-2114
lines changed

gemma-cli/src/main/config/bash_completion.d/gemma-cli

+10-10
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,16 @@ function __gemma_cli_complete() {
424424
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -f -- "$2")
425425
fi
426426
fi
427+
if [[ " $words " =~ ' ubic.gemma.core.apps.UpdateEe2AdCli ' ]]; then
428+
if ! [[ "$current_option" =~ (--since|-s) ]]; then
429+
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since -h -s" -- "$2")
430+
fi
431+
fi
432+
if [[ " $words " =~ ' updateEe2Ad ' ]]; then
433+
if ! [[ "$current_option" =~ (--since|-s) ]]; then
434+
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since -h -s" -- "$2")
435+
fi
436+
fi
427437
if [[ " $words " =~ ' ubic.gemma.core.apps.UpdateEE2CCli ' ]]; then
428438
if ! [[ "$current_option" =~ (--since|-s) ]]; then
429439
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since --truncate -h -s -truncate" -- "$2")
@@ -674,16 +684,6 @@ function __gemma_cli_complete() {
674684
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -f -- "$2")
675685
fi
676686
fi
677-
if [[ " $words " =~ ' ubic.gemma.core.apps.UpdateEe2AdCli ' ]]; then
678-
if ! [[ "$current_option" =~ (--since|-s) ]]; then
679-
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since -h -s" -- "$2")
680-
fi
681-
fi
682-
if [[ " $words " =~ ' updateEe2Ad ' ]]; then
683-
if ! [[ "$current_option" =~ (--since|-s) ]]; then
684-
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since -h -s" -- "$2")
685-
fi
686-
fi
687687
if [[ " $words " =~ ' ubic.gemma.core.apps.DatabaseViewGeneratorCLI ' ]]; then
688688
if ! [[ "$current_option" =~ (--limit|-l) ]]; then
689689
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--dataset --diffexpression --help --limit --tissue -d -h -l -t -x" -- "$2")

gemma-cli/src/main/config/bash_completion.d/gemma-cli-staging

+10-10
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,16 @@ function __gemma_cli_complete() {
424424
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -f -- "$2")
425425
fi
426426
fi
427+
if [[ " $words " =~ ' ubic.gemma.core.apps.UpdateEe2AdCli ' ]]; then
428+
if ! [[ "$current_option" =~ (--since|-s) ]]; then
429+
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since -h -s" -- "$2")
430+
fi
431+
fi
432+
if [[ " $words " =~ ' updateEe2Ad ' ]]; then
433+
if ! [[ "$current_option" =~ (--since|-s) ]]; then
434+
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since -h -s" -- "$2")
435+
fi
436+
fi
427437
if [[ " $words " =~ ' ubic.gemma.core.apps.UpdateEE2CCli ' ]]; then
428438
if ! [[ "$current_option" =~ (--since|-s) ]]; then
429439
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since --truncate -h -s -truncate" -- "$2")
@@ -674,16 +684,6 @@ function __gemma_cli_complete() {
674684
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -f -- "$2")
675685
fi
676686
fi
677-
if [[ " $words " =~ ' ubic.gemma.core.apps.UpdateEe2AdCli ' ]]; then
678-
if ! [[ "$current_option" =~ (--since|-s) ]]; then
679-
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since -h -s" -- "$2")
680-
fi
681-
fi
682-
if [[ " $words " =~ ' updateEe2Ad ' ]]; then
683-
if ! [[ "$current_option" =~ (--since|-s) ]]; then
684-
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--help --since -h -s" -- "$2")
685-
fi
686-
fi
687687
if [[ " $words " =~ ' ubic.gemma.core.apps.DatabaseViewGeneratorCLI ' ]]; then
688688
if ! [[ "$current_option" =~ (--limit|-l) ]]; then
689689
mapfile -t -O "${#COMPREPLY[@]}" COMPREPLY < <(compgen -W "--dataset --diffexpression --help --limit --tissue -d -h -l -t -x" -- "$2")

gemma-cli/src/main/config/fish/completions/gemma-cli-staging.fish

+14-14
Large diffs are not rendered by default.

gemma-cli/src/main/config/fish/completions/gemma-cli.fish

+14-14
Large diffs are not rendered by default.

gemma-cli/src/main/java/ubic/gemma/core/apps/ArrayDesignProbeMapperCli.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.springframework.beans.factory.annotation.Autowired;
88
import ubic.gemma.core.analysis.sequence.ProbeMapperConfig;
99
import ubic.gemma.core.config.Settings;
10+
import ubic.gemma.core.goldenpath.GoldenPathSequenceAnalysis;
1011
import ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignProbeMapperService;
1112
import ubic.gemma.core.util.AbstractCLI;
1213
import ubic.gemma.core.util.CLI;
@@ -299,7 +300,7 @@ boolean needToRun( Date skipIfLastRunLaterThan, ArrayDesign arrayDesign,
299300

300301
AbstractCLI.log.debug( "Re-Checking status of " + arrayDesign );
301302

302-
List<AuditEvent> allEvents = this.auditTrailService.getEvents( arrayDesign );
303+
List<AuditEvent> allEvents = this.auditEventService.getEvents( arrayDesign );
303304
AuditEvent lastSequenceAnalysis = null;
304305
AuditEvent lastRepeatMask = null;
305306
AuditEvent lastSequenceUpdate = null;
@@ -660,8 +661,11 @@ private void processProbes( ArrayDesign arrayDesign ) {
660661

661662
probe = compositeSequenceService.thaw( probe );
662663

663-
Map<String, Collection<BlatAssociation>> results = this.arrayDesignProbeMapperService
664-
.processCompositeSequence( this.config, taxon, null, probe );
664+
Map<String, Collection<BlatAssociation>> results;
665+
try ( GoldenPathSequenceAnalysis goldenPathDb = new GoldenPathSequenceAnalysis( taxon ) ) {
666+
results = this.arrayDesignProbeMapperService
667+
.processCompositeSequence( this.config, taxon, goldenPathDb, probe );
668+
}
665669

666670
for ( Collection<BlatAssociation> col : results.values() ) {
667671
for ( BlatAssociation association : col ) {

gemma-cli/src/main/java/ubic/gemma/core/apps/ArrayDesignSequenceManipulatingCli.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType;
3434
import ubic.gemma.model.expression.arrayDesign.ArrayDesign;
3535
import ubic.gemma.model.expression.arrayDesign.TechnologyType;
36+
import ubic.gemma.persistence.service.common.auditAndSecurity.AuditEventService;
3637
import ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailService;
3738
import ubic.gemma.persistence.service.expression.arrayDesign.ArrayDesignService;
3839

@@ -53,6 +54,8 @@ public abstract class ArrayDesignSequenceManipulatingCli extends AbstractAuthent
5354
private ArrayDesignService arrayDesignService;
5455
@Autowired
5556
protected AuditTrailService auditTrailService;
57+
@Autowired
58+
protected AuditEventService auditEventService;
5659

5760
private Collection<ArrayDesign> arrayDesignsToProcess = new HashSet<>();
5861

@@ -227,7 +230,7 @@ private List<AuditEvent> getEvents( ArrayDesign arrayDesign,
227230
Class<? extends ArrayDesignAnalysisEvent> eventClass ) {
228231
List<AuditEvent> events = new ArrayList<>();
229232

230-
for ( AuditEvent event : this.auditTrailService.getEvents( arrayDesign ) ) {
233+
for ( AuditEvent event : this.auditEventService.getEvents( arrayDesign ) ) {
231234
if ( event == null )
232235
continue;
233236
if ( eventClass == null || ( event.getEventType() != null && eventClass

gemma-cli/src/main/java/ubic/gemma/core/apps/GeeqCli.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ protected void doWork() throws Exception {
8888
ExpressionExperiment ee = ( ExpressionExperiment ) bioassay;
8989

9090
if ( !force && this.noNeedToRun( ee, GeeqEvent.class ) ) {
91-
AbstractCLI.log.debug( "Can't or don't need to run " + ee );
91+
AbstractCLI.log.info( "Can't or don't need to run " + ee );
92+
addErrorObject( ee, "Can't or don't need to run " + ee );
9293
continue;
9394
}
9495

9596
try {
9697
geeqService.calculateScore( ee, mode );
98+
refreshExpressionExperimentFromGemmaWeb( ee, false, true );
9799
addSuccessObject( ee );
98100
} catch ( Exception e ) {
99101
addErrorObject( ee, e );
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package ubic.gemma.core.apps;
2+
3+
import com.zaxxer.hikari.HikariDataSource;
4+
import org.apache.commons.cli.CommandLine;
5+
import org.apache.commons.cli.Options;
6+
import org.apache.commons.cli.ParseException;
7+
import org.springframework.beans.factory.annotation.Autowired;
8+
import org.springframework.beans.factory.annotation.Value;
9+
import org.springframework.context.annotation.Profile;
10+
import org.springframework.jdbc.datasource.init.CompositeDatabasePopulator;
11+
import org.springframework.jdbc.datasource.init.DatabasePopulatorUtils;
12+
import ubic.gemma.core.util.AbstractCLI;
13+
import ubic.gemma.persistence.hibernate.LocalSessionFactoryBean;
14+
import ubic.gemma.persistence.initialization.CreateDatabasePopulator;
15+
import ubic.gemma.persistence.initialization.DatabaseSchemaPopulator;
16+
import ubic.gemma.persistence.initialization.InitialDataPopulator;
17+
18+
import javax.annotation.Nullable;
19+
import javax.sql.DataSource;
20+
21+
import static ubic.gemma.persistence.initialization.BootstrappedDataSourceFactory.createBootstrappedDataSource;
22+
23+
/**
24+
* This is exclusively available for the test database.
25+
*/
26+
@Profile("testdb")
27+
public class InitializeDatabaseCli extends AbstractCLI {
28+
29+
@Autowired
30+
private DataSource dataSource;
31+
32+
@Autowired
33+
private LocalSessionFactoryBean factory;
34+
35+
@Value("${gemma.testdb.name}")
36+
private String databaseName;
37+
38+
@Nullable
39+
@Override
40+
public String getCommandName() {
41+
return "initializeDatabase";
42+
}
43+
44+
@Nullable
45+
@Override
46+
public String getShortDesc() {
47+
return "";
48+
}
49+
50+
@Override
51+
public CommandGroup getCommandGroup() {
52+
return CommandGroup.MISC;
53+
}
54+
55+
@Override
56+
protected void buildOptions( Options options ) {
57+
}
58+
59+
@Override
60+
protected void processOptions( CommandLine commandLine ) throws ParseException {
61+
}
62+
63+
@Override
64+
protected void doWork() throws Exception {
65+
String jdbcUrl;
66+
if ( dataSource instanceof HikariDataSource ) {
67+
jdbcUrl = ( ( HikariDataSource ) dataSource ).getJdbcUrl();
68+
} else {
69+
jdbcUrl = dataSource.toString();
70+
}
71+
promptConfirmationOrAbort( "The following data source will be initialized: " + jdbcUrl );
72+
try ( HikariDataSource bootstrappedDataSource = createBootstrappedDataSource( dataSource ) ) {
73+
CreateDatabasePopulator cdb = new CreateDatabasePopulator( databaseName );
74+
cdb.setDropIfExists( true );
75+
DatabasePopulatorUtils.execute( cdb, bootstrappedDataSource );
76+
}
77+
CompositeDatabasePopulator cdp = new CompositeDatabasePopulator();
78+
cdp.addPopulators(
79+
new DatabaseSchemaPopulator( factory, "mysql" ),
80+
new InitialDataPopulator( false ) );
81+
DatabasePopulatorUtils.execute( cdp, dataSource );
82+
}
83+
}

gemma-cli/src/main/java/ubic/gemma/core/apps/LoadSimpleExpressionDataCli.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private void loadExperiment( String configurationLine ) throws Exception {
239239
throw new IllegalArgumentException( "Field Missing Got[" + fields.length + "]: " + configurationLine );
240240
}
241241
for ( i = 0; i < fields.length; i++ )
242-
fields[i] = StringUtils.trim( fields[i] );
242+
fields[i] = StringUtils.strip( fields[i] );
243243

244244
SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
245245

gemma-cli/src/main/java/ubic/gemma/core/apps/RefreshExperimentCli.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ public String getCommandName() {
2727
@Nullable
2828
@Override
2929
public String getShortDesc() {
30-
return "Refresh the given experiments on the Gemma Website";
30+
return "Refresh the cache for experiments on the Gemma Website";
3131
}
3232

3333
@Override
3434
protected void buildOptions( Options options ) {
3535
super.buildOptions( options );
36-
options.addOption( "v", "refreshVectors", false, "Refresh raw and processed data vectors" );
37-
options.addOption( "r", "refreshReports", false, "Refresh experiment reports (i.e. batch information, diff ex. analyses, etc.)" );
36+
options.addOption( "v", "refreshVectors", false, "Refresh cache of raw and processed data vectors" );
37+
options.addOption( "r", "refreshReports", false, "Refresh cache of experiment reports (i.e. batch information, diff ex. analyses, etc.)" );
3838
addThreadsOption( options );
3939
}
4040

gemma-cli/src/main/java/ubic/gemma/core/apps/UpdateEe2AdCli.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public String getShortDesc() {
3333

3434
@Override
3535
public CommandGroup getCommandGroup() {
36-
return CommandGroup.PLATFORM;
36+
return CommandGroup.EXPERIMENT;
3737
}
3838

3939
@Override

gemma-cli/src/main/java/ubic/gemma/core/util/AbstractCLI.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@
3131
import javax.annotation.Nullable;
3232
import java.io.*;
3333
import java.nio.file.Files;
34-
import java.util.*;
35-
import java.util.concurrent.*;
34+
import java.util.Collection;
35+
import java.util.Date;
36+
import java.util.List;
37+
import java.util.TimeZone;
38+
import java.util.concurrent.ExecutorService;
39+
import java.util.concurrent.Executors;
40+
import java.util.concurrent.ThreadFactory;
41+
import java.util.concurrent.TimeUnit;
3642

3743
import static java.util.Objects.requireNonNull;
3844

@@ -371,7 +377,7 @@ private void buildStandardOptions( Options options ) {
371377
* purposes.
372378
*/
373379
private void processStandardOptions( CommandLine commandLine ) throws ParseException {
374-
if ( commandLine.hasOption( LIMITING_DATE_OPTION ) ^ commandLine.hasOption( AbstractCLI.AUTO_OPTION_NAME ) ) {
380+
if ( commandLine.hasOption( LIMITING_DATE_OPTION ) && commandLine.hasOption( AbstractCLI.AUTO_OPTION_NAME ) ) {
375381
throw new IllegalArgumentException( String.format( "Please only select one of -%s or -%s", LIMITING_DATE_OPTION, AUTO_OPTION_NAME ) );
376382
}
377383

gemma-cli/src/main/resources/ubic/gemma/applicationContext-component-scan.xml

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
</context:component-scan>
1717

1818
<!-- Non-standard CLI tools used to load data into Gemma database -->
19-
<context:component-scan base-package="ubic.gemma.core.loader"
19+
<context:component-scan base-package="ubic.gemma.core.loader.association.phenotype"
20+
name-generator="ubic.gemma.core.context.BeanNameGenerator"
21+
use-default-filters="false">
22+
<context:include-filter type="assignable" expression="ubic.gemma.core.util.CLI"/>
23+
<context:exclude-filter type="annotation" expression="ubic.gemma.core.context.TestComponent"/>
24+
</context:component-scan>
25+
<context:component-scan base-package="ubic.gemma.core.loader.entrez.pubmed"
2026
name-generator="ubic.gemma.core.context.BeanNameGenerator"
2127
use-default-filters="false">
2228
<context:include-filter type="assignable" expression="ubic.gemma.core.util.CLI"/>

gemma-cli/src/test/java/ubic/gemma/core/apps/ArrayDesignMergeCliTest.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
import org.springframework.test.context.TestExecutionListeners;
1313
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
1414
import ubic.gemma.core.analysis.report.ArrayDesignReportService;
15+
import ubic.gemma.core.context.TestComponent;
1516
import ubic.gemma.core.loader.expression.arrayDesign.ArrayDesignMergeService;
1617
import ubic.gemma.core.util.GemmaRestApiClient;
1718
import ubic.gemma.model.expression.arrayDesign.ArrayDesign;
19+
import ubic.gemma.persistence.service.common.auditAndSecurity.AuditEventService;
1820
import ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailService;
1921
import ubic.gemma.persistence.service.expression.arrayDesign.ArrayDesignService;
20-
import ubic.gemma.core.context.TestComponent;
2122

2223
import java.util.Arrays;
2324
import java.util.Collection;
@@ -49,6 +50,11 @@ public AuditTrailService auditTrailService() {
4950
return mock();
5051
}
5152

53+
@Bean
54+
public AuditEventService auditEventService() {
55+
return mock();
56+
}
57+
5258
@Bean
5359
public ArrayDesignMergeService arrayDesignMergeService() {
5460
return mock( ArrayDesignMergeService.class );

0 commit comments

Comments
 (0)