Skip to content

Commit

Permalink
Merge branch 'release-1.29.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Dec 5, 2022
2 parents 9781080 + 52bb5e2 commit 47bbafe
Show file tree
Hide file tree
Showing 518 changed files with 6,145 additions and 5,625 deletions.
5 changes: 5 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Gemma code repository

If you are looking for the public instance of Gemma, you can either access it through the
[Gemma Website](https://gemma.msl.ubc.ca/), or check out our [RESTful API](https://gemma.msl.ubc.ca/resources/restapidocs/).
This repository is for the Gemma software system.

If you are looking to access the genomics data in Gemma, please see the
[Gemma Website](https://gemma.msl.ubc.ca/), the Bioconductor package [Gemma.R](https://doi.org/doi:10.18129/B9.bioc.gemma.R), or our [RESTful API](https://gemma.msl.ubc.ca/resources/restapidocs/).

Please see the end-user documentation at our [GitHub Pages](https://pavlidislab.github.io/Gemma/) for more information
on how to use Gemma and related tools, and to credits and contact information.
Expand Down
81 changes: 81 additions & 0 deletions gemma-cli/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>gemma</artifactId>
<groupId>gemma</groupId>
<version>1.29.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gemma-cli</artifactId>
<name>Gemma CLI</name>
<description>Module containing the Gemma CLI.</description>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<repositoryName>lib</repositoryName>
<repositoryLayout>flat</repositoryLayout>
<copyConfigurationDirectory>true</copyConfigurationDirectory>
<platforms>
<platform>unix</platform>
</platforms>
<programs>
<program>
<id>gemma-cli</id>
<mainClass>ubic.gemma.core.apps.GemmaCLI</mainClass>
</program>
</programs>
<!-- this allows Log4j 2 to lookup for Log4j 1.2 configuration -->
<extraJvmArguments>-Dlog4j1.compatibility=true -Djava.awt.headless=true</extraJvmArguments>
<!-- Gemma CLI extensions can be dropped in that folder -->
<endorsedDir>contrib</endorsedDir>
</configuration>
<executions>
<execution>
<id>make-appassembly</id>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<descriptors>
<descriptor>src/assembly/appassembler.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>gemma</groupId>
<artifactId>gemma-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>gemma</groupId>
<artifactId>gemma-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
</dependencies>
</project>
File renamed without changes.
5 changes: 5 additions & 0 deletions gemma-cli/src/main/java/ubic/gemma/contrib/apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Gemma Contrib Apps

This package can be used by other Java packages to include CLIs.

Standard applications reside in `ubic.pavlab.gemma.core.apps`.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ protected boolean requireLogin() {
* See 'configure' for how the other options are handled. (non-Javadoc)
*
* @see AbstractCLI#processOptions(CommandLine)
* @param commandLine
*/
@Override
protected void processOptions( CommandLine commandLine ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ protected void doWork() throws Exception {
}

/**
* @param taxon
* @return
*/
private String[] chooseBLASTdbs( Taxon taxon ) {
String[] databases = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ public String getShortDesc() {
/**
* Test whether two sequences are effectively equal (ignore the ID)
*
* @param one
* @param that
* @return
*/
private boolean equals( BioSequence one, BioSequence that ) {

Expand All @@ -241,7 +238,6 @@ private boolean equals( BioSequence one, BioSequence that ) {
}

/**
* @param bioSequences
*/
private void processSequences( Collection<BioSequence> bioSequences ) {
// ///////////////////////////////
Expand Down Expand Up @@ -324,8 +320,6 @@ private void processSequences( Collection<BioSequence> bioSequences ) {
}

/**
* @param keeper
* @param toRemove
*/
private void switchAndDeleteExtra( BioSequence keeper, BioSequence toRemove ) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,7 @@ private void proactivelyBlacklistExperiments( ExternalDatabase geo ) throws Exce
}

/**
* @param geo
* @param gbs
* @param blacklistedEntityDao
* @param candidates
* @return number of actually blacklisted experiments in this batch.
* @throws InterruptedException
*/
private int fetchAndBlacklist( ExternalDatabase geo, GeoBrowser gbs, BlacklistedEntityService blacklistedEntityDao, Collection<String> candidates )
throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package ubic.gemma.core.apps;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ubic.gemma.core.util.AbstractCLI;
import ubic.gemma.core.util.AbstractSpringAwareCLI;
import ubic.gemma.model.common.description.ExternalDatabase;
import ubic.gemma.persistence.service.common.description.ExternalDatabaseService;

import java.net.URL;
import java.util.Date;

import static java.util.Objects.requireNonNull;

@Component
public class ExternalDatabaseUpdaterCli extends AbstractSpringAwareCLI {

private static final String NAME_OPTION = "n",
DESCRIPTION_OPTION = "d",
RELEASE_OPTION = "release",
RELEASE_NOTE_OPTION = "releaseNote",
RELEASE_VERSION_OPTION = "releaseVersion",
RELEASE_URL_OPTION = "releaseUrl",
LAST_UPDATED_OPTION = "lastUpdated";

@Autowired
private ExternalDatabaseService externalDatabaseService;

private String name;
private String description;
private boolean release;
private String releaseNote;
private String releaseVersion;
private URL releaseUrl;
private Date lastUpdated;

@Override
public String getCommandName() {
return "updateExternalDatabase";
}

@Override
public GemmaCLI.CommandGroup getCommandGroup() {
return GemmaCLI.CommandGroup.SYSTEM;
}

@Override
protected boolean requireLogin() {
return true;
}

@Override
protected void buildOptions( Options options ) {
options.addOption( Option.builder( NAME_OPTION )
.longOpt( "name" )
.hasArg()
.optionalArg( false )
.desc( "External database name" ).build() );
options.addOption( DESCRIPTION_OPTION, "description", true, "New description" );
options.addOption( RELEASE_OPTION, "release", false, "Update the release (only affects last modified moment))" );
options.addOption( RELEASE_VERSION_OPTION, "release-version", true, "Release version" );
options.addOption( Option.builder( RELEASE_URL_OPTION )
.longOpt( "release-url" )
.hasArg()
.desc( "Release URL (optional)" )
.type( URL.class ).build() );
options.addOption( RELEASE_NOTE_OPTION, "release-note", true, "Note to include in the audit event related to the new release" );
options.addOption( Option.builder( LAST_UPDATED_OPTION )
.longOpt( "last-updated" )
.hasArg()
.desc( "Moment the release was performed if known, otherwise the current time will be used." )
.type( Date.class ).build() );
}

@Override
protected void processOptions( CommandLine commandLine ) throws Exception {
name = commandLine.getOptionValue( NAME_OPTION );
description = commandLine.getOptionValue( DESCRIPTION_OPTION );
release = commandLine.hasOption( RELEASE_OPTION );
releaseNote = commandLine.getOptionValue( RELEASE_NOTE_OPTION );
releaseVersion = commandLine.getOptionValue( RELEASE_VERSION_OPTION );
releaseUrl = ( URL ) commandLine.getParsedOptionValue( RELEASE_URL_OPTION );
lastUpdated = ( Date ) commandLine.getParsedOptionValue( LAST_UPDATED_OPTION );
if ( lastUpdated == null ) {
lastUpdated = new Date();
}
}

@Override
protected void doWork() throws Exception {
ExternalDatabase ed = requireNonNull( externalDatabaseService.findByNameWithAuditTrail( name ),
String.format( "No database with name %s.", name ) );
if ( description != null ) {
ed.setDescription( description );
}
if ( release || releaseVersion != null ) {
if ( releaseVersion != null ) {
AbstractCLI.log.info( String.format( "Updating %s release version to %s.", name, releaseVersion ) );
externalDatabaseService.updateReleaseDetails( ed, releaseVersion, releaseUrl, releaseNote, lastUpdated );
} else {
AbstractCLI.log.info( String.format( "Updating %s last updated moment to %s.", name, lastUpdated ) );
externalDatabaseService.updateReleaseLastUpdated( ed, releaseNote, lastUpdated );
}
} else {
AbstractCLI.log.info( String.format( "Updating %s. Use the --release flag to update last updated or release infos.", name ) );
externalDatabaseService.update( ed ); /* only update description, etc. */
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public String getShortDesc() {

/**
* This method is called at the end of processCommandLine
* @param commandLine
*/
@Override
protected void processOptions( CommandLine commandLine ) {
Expand Down
Loading

0 comments on commit 47bbafe

Please sign in to comment.