Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add empty correlation skeleton #322

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions api.raml
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,21 @@ securitySchemes:
application/json:
type: lib.DifferentialAbundanceStatsResponse

/correlationassaymetadata/visualizations:
displayName: Visualizations for discovering corrleations between assay data and sample metadata

/bipartitenetwork:
post:
description: Returns data required to create a volcanoplot from a differential abundance analysis.
body:
application/json:
type: lib.CorrelationAssayMetadataBipartitenetworkPostRequest
responses:
200:
body:
application/json:
type: lib.CorrelationAssayMetadataStatsResponse

/distributions/visualizations:
displayName: Visualizations for exploring distributions of data.

Expand Down
6 changes: 6 additions & 0 deletions schema/library.raml
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,12 @@ types:
overlayVariable:
type: VariableSpec
required: false
CorrelationAssayMetadataBipartitenetworkPostRequest:
type: DataPluginRequestBase
properties:
computeConfig: EmptyDataPluginSpec
config: EmptyDataPluginSpec
CorrelationAssayMetadataStatsResponse: DifferentialAbundanceStatsResponse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not know what the response will look like yet?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a plan but since it doesn't matter for the frontend stub i didn't add it yet

DifferentialAbundanceVolcanoplotPostRequest:
type: DataPluginRequestBase
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#%RAML 1.0 Library

types:

# Temporary until the backend is really ready
CorrelationAssayMetadataBipartitenetworkPostRequest:
type: DataPluginRequestBase
properties:
computeConfig: EmptyDataPluginSpec
config: EmptyDataPluginSpec

CorrelationAssayMetadataStatsResponse:
type: DifferentialAbundanceStatsResponse
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.veupathdb.service.eda.ds.plugin.alphadiv.AlphaDivScatterplotPlugin;
import org.veupathdb.service.eda.ds.plugin.abundance.AbundanceBoxplotPlugin;
import org.veupathdb.service.eda.ds.plugin.abundance.AbundanceScatterplotPlugin;
import org.veupathdb.service.eda.ds.plugin.correlationassaymetadata.CorrelationAssayMetadataBipartitenetworkPlugin;
import org.veupathdb.service.eda.ds.plugin.pass.BarplotPlugin;
import org.veupathdb.service.eda.ds.plugin.pass.BoxplotPlugin;
import org.veupathdb.service.eda.ds.plugin.pass.ContTablePlugin;
Expand Down Expand Up @@ -113,6 +114,10 @@ public class AppsMetadata {
"Find taxa or genes that are differentially abundant between two groups.",
List.of(MICROBIOME_PROJECT),
viz("volcanoplot", new DifferentialAbundanceVolcanoplotPlugin())),
app("correlationassaymetadata", "Correlation", "correlationassaymetadata",
"Discover taxa or genes correlated with metadata.",
List.of(MICROBIOME_PROJECT),
viz("bipartitenetwork", new CorrelationAssayMetadataBipartitenetworkPlugin())),
app("distributions", "Distributions", null,
"Plot simple distributions for any continuous variable, including metadata (e.g. age, height, etc.) or microbial assay results.",
List.of(MICROBIOME_PROJECT),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package org.veupathdb.service.eda.ds.plugin.correlationassaymetadata;

import org.gusdb.fgputil.validation.ValidationException;
import org.veupathdb.service.eda.common.client.spec.StreamSpec;
import org.veupathdb.service.eda.ds.metadata.AppsMetadata;
import org.veupathdb.service.eda.ds.core.AbstractPlugin;
import org.veupathdb.service.eda.generated.model.BoxplotPostRequest;
import org.veupathdb.service.eda.generated.model.BoxplotSpec;
// import org.veupathdb.service.eda.generated.model.CorrelationAssayMetadataComputeConfig;
import org.veupathdb.service.eda.generated.model.CorrelationAssayMetadataBipartitenetworkPostRequest;
import org.veupathdb.service.eda.generated.model.EmptyDataPluginSpec;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public class CorrelationAssayMetadataBipartitenetworkPlugin extends AbstractPlugin<CorrelationAssayMetadataBipartitenetworkPostRequest, EmptyDataPluginSpec, EmptyDataPluginSpec> {

@Override
public String getDisplayName() {
return "Bipartite network";
}

@Override
public String getDescription() {
return "Visualize the correlation between two sets of data";
}

@Override
public List<String> getProjects() {
return List.of(AppsMetadata.MICROBIOME_PROJECT);
}

@Override
protected ClassGroup getTypeParameterClasses() {
return new ClassGroup(CorrelationAssayMetadataBipartitenetworkPostRequest.class, EmptyDataPluginSpec.class, EmptyDataPluginSpec.class);
}

@Override
protected boolean computeGeneratesVars() {
return false;
}

@Override
protected void validateVisualizationSpec(EmptyDataPluginSpec pluginSpec) throws ValidationException {
// nothing to do here
}

@Override
protected List<StreamSpec> getRequestedStreams(EmptyDataPluginSpec pluginSpec) {
// this plugin only uses the stats result of the compute; no tabular data streams needed
return Collections.emptyList();
}

@Override
protected void writeResults(OutputStream out, Map<String, InputStream> dataStreams) throws IOException {
System.out.println("I'm writing results!");
// writeComputeStatsResponseToOutput(out);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.veupathdb.service.eda.ds.metadata.AppsMetadata;
import org.veupathdb.service.eda.ds.core.AbstractPlugin;
import org.veupathdb.service.eda.ds.plugin.differentialabundance.DifferentialAbundanceVolcanoplotPlugin;
import org.veupathdb.service.eda.ds.plugin.correlationassaymetadata.CorrelationAssayMetadataBipartitenetworkPlugin;
import org.veupathdb.service.eda.ds.plugin.betadiv.BetaDivScatterplotPlugin;
import org.veupathdb.service.eda.ds.plugin.alphadiv.AlphaDivBoxplotPlugin;
import org.veupathdb.service.eda.ds.plugin.alphadiv.AlphaDivScatterplotPlugin;
Expand Down Expand Up @@ -342,6 +343,13 @@ public PostAppsDifferentialabundanceVisualizationsVolcanoplotResponse postAppsDi
new DifferentialAbundanceStatsResponseStream(processRequest(new DifferentialAbundanceVolcanoplotPlugin(), entity))));
}

@DisableJackson
@Override
public PostAppsCorrelationassaymetadataVisualizationsBipartitenetworkResponse postAppsCorrelationassaymetadataVisualizationsBipartitenetwork(CorrelationAssayMetadataBipartitenetworkPostRequest entity) {
return wrapPlugin(() -> PostAppsCorrelationassaymetadataVisualizationsBipartitenetworkResponse.respond200WithApplicationJson(
new CorrelationAssayMetadataStatsResponseStream(processRequest(new CorrelationAssayMetadataBipartitenetworkPlugin(), entity))));
}

@DisableJackson
@Override
public PostAppsAbundanceVisualizationsBoxplotResponse postAppsAbundanceVisualizationsBoxplot(AbundanceBoxplotPostRequest entity) {
Expand Down