Skip to content

Commit

Permalink
[Bugfix] Update codebase to latest web core (#134)
Browse files Browse the repository at this point in the history
* Remove unused stubbing

* Add back experiment design as a field to Experiment

* Add null check
  • Loading branch information
ke4 authored Apr 9, 2024
1 parent 514950c commit ea4ce65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public abstract class Experiment<R extends ReportsGeneExpression> implements Ser
private final Species species;
private final ImmutableMap<String, R> id2ExpressedSamples;
private final ImmutableSet<String> experimentalFactorHeaders;
protected final ExperimentDesign experimentDesign;
private final ImmutableSet<String> pubMedIds;
private final ImmutableSet<String> dois;
private final String displayName;
Expand All @@ -44,7 +45,7 @@ public abstract class Experiment<R extends ReportsGeneExpression> implements Ser
private final ImmutableSet<String> alternativeViewDescriptions;
private final ExperimentDisplayDefaults experimentDisplayDefaults;
private final boolean isPrivate;
private String accessKey;
private final String accessKey;

public Experiment(
@NotNull ExperimentType type,
Expand Down Expand Up @@ -84,6 +85,7 @@ public Experiment(
this.lastUpdate = lastUpdate;
this.species = species;
this.technologyType = ImmutableSet.copyOf(technologyType);
this.experimentDesign = experimentDesign;
this.pubMedIds = pubMedIds.stream().sorted().collect(toImmutableSet());
this.dois = dois.stream().sorted().collect(toImmutableSet());
this.displayName = isBlank(displayName) ? accession : displayName;
Expand Down Expand Up @@ -122,6 +124,11 @@ public ExperimentType getType() {
return type;
}

@NotNull
public ExperimentDesign getExperimentDesign() {
return experimentDesign;
}

@NotNull
public ImmutableSet<String> getExperimentalFactorHeaders() {
return experimentalFactorHeaders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private AnalyticsSchemaField(String fieldName) {


public static AnalyticsSchemaField asAnalyticsSchemaField(BioentityPropertyName bioentityPropertyName) {
return bioentityPropertyName.isKeyword ?
return bioentityPropertyName != null && bioentityPropertyName.isKeyword ?
new AnalyticsSchemaField(String.format("keyword_%s", bioentityPropertyName.name)) :
IDENTIFIER_SEARCH;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.common.collect.ImmutableList;
import org.hamcrest.Matchers;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
import uk.ac.ebi.atlas.controllers.ResourceNotFoundException;
import uk.ac.ebi.atlas.model.download.ExternallyAvailableContent;
Expand Down

0 comments on commit ea4ce65

Please sign in to comment.