Skip to content

Commit

Permalink
add appVersion to service calls for Jbrowse
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrestel committed Oct 2, 2024
1 parent ce523f3 commit cd5bdee
Showing 1 changed file with 74 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,32 @@ public Response getJbrowseFeatures(@PathParam("refseq_name") String refseqName,
@GET
@Path("dnaseq/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseDNASeqTracks(@PathParam("organismAbbrev") String organismAbbrev) throws IOException {
public Response getJbrowseDNASeqTracks(@PathParam("organismAbbrev") String organismAbbrev,
@DefaultValue("1") @QueryParam("appVersion") String appVersion) throws IOException {

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
String buildNumber = getWdkModel().getBuildNumber();
String webservicesDir = getWdkModel().getProperties().get("WEBSERVICEMIRROR");

List<String> command = new ArrayList<String>();
command.add(gusHome + "/bin/jbrowseDNASeqTracks");
command.add(organismAbbrev);
command.add(projectId);
command.add(buildNumber);
command.add(webservicesDir);
command.add(appVersion);

return responseFromCommand(command);
}

@GET
@Path("rnaseqJunctions/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseRNASeqJunctionTracks(@PathParam("organismAbbrev") String organismAbbrev, @DefaultValue("0") @QueryParam("isApollo") String isApollo) throws IOException {
public Response getJbrowseRNASeqJunctionTracks(@PathParam("organismAbbrev") String organismAbbrev,
@DefaultValue("0") @QueryParam("isApollo") String isApollo,
@DefaultValue("1") @QueryParam("appVersion") String appVersion
) throws IOException {

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
Expand All @@ -91,6 +100,7 @@ public Response getJbrowseRNASeqJunctionTracks(@PathParam("organismAbbrev") Stri
command.add(organismAbbrev);
command.add(projectId);
command.add(isApollo);
command.add(appVersion);

return responseFromCommand(command);
}
Expand All @@ -99,7 +109,9 @@ public Response getJbrowseRNASeqJunctionTracks(@PathParam("organismAbbrev") Stri
@GET
@Path("{tracks}/{publicOrganismAbbrev}/aa/trackList.json")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseAaTracks(@PathParam("publicOrganismAbbrev") String publicOrganismAbbrev, @PathParam("tracks") String tracks) throws IOException {
public Response getJbrowseAaTracks(@PathParam("publicOrganismAbbrev") String publicOrganismAbbrev,
@DefaultValue("1") @QueryParam("appVersion") String appVersion,
@PathParam("tracks") String tracks) throws IOException {

//NOTE: this service call is public facing so we use the publicOrganismAbbrev here

Expand All @@ -113,14 +125,17 @@ public Response getJbrowseAaTracks(@PathParam("publicOrganismAbbrev") String pub
command.add(projectId);
command.add(String.valueOf(isPbrowse));
command.add(tracks);
command.add(appVersion);

return responseFromCommand(command);
}

@GET
@Path("{tracks}/{publicOrganismAbbrev}/trackList.json")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseTracks(@PathParam("publicOrganismAbbrev") String publicOrganismAbbrev, @PathParam("tracks") String tracks) throws IOException {
public Response getJbrowseTracks(@PathParam("publicOrganismAbbrev") String publicOrganismAbbrev,
@DefaultValue("1") @QueryParam("appVersion") String appVersion,
@PathParam("tracks") String tracks) throws IOException {

//NOTE: this service call is public facing so we use the publicOrganismAbbrev here

Expand All @@ -135,14 +150,16 @@ public Response getJbrowseTracks(@PathParam("publicOrganismAbbrev") String publi
command.add(projectId);
command.add(String.valueOf(isPbrowse));
command.add(tracks);

command.add(appVersion);
return responseFromCommand(command);
}

@GET
@Path("organismSpecific/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseOrganismSpecificTracks(@PathParam("organismAbbrev") String organismAbbrev, @DefaultValue("0") @QueryParam("isApollo") String isApollo) throws IOException {
public Response getJbrowseOrganismSpecificTracks(@PathParam("organismAbbrev") String organismAbbrev,
@DefaultValue("1") @QueryParam("appVersion") String appVersion,
@DefaultValue("0") @QueryParam("isApollo") String isApollo) throws IOException {

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
Expand All @@ -157,14 +174,15 @@ public Response getJbrowseOrganismSpecificTracks(@PathParam("organismAbbrev") St
command.add(isApollo);
command.add(buildNumber);
command.add(webservicesDir);

command.add(appVersion);
return responseFromCommand(command);
}

@GET
@Path("organismSpecificPbrowse/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseOrganismSpecificPbrowseTracks(@PathParam("organismAbbrev") String organismAbbrev) throws IOException {
public Response getJbrowseOrganismSpecificPbrowseTracks(@PathParam("organismAbbrev") String organismAbbrev,
@DefaultValue("1") @QueryParam("appVersion") String appVersion,) throws IOException {

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
Expand All @@ -173,7 +191,7 @@ public Response getJbrowseOrganismSpecificPbrowseTracks(@PathParam("organismAbbr
command.add(gusHome + "/bin/jbrowseOrganismSpecificPbrowseTracks");
command.add(organismAbbrev);
command.add(projectId);

command.add(appVersion);
return responseFromCommand(command);
}

Expand All @@ -195,7 +213,8 @@ public Response getOrganismList() throws IOException {
@GET
@Path("rnaseq/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseRNASeqTracks(@PathParam("organismAbbrev") String organismAbbrev) throws IOException {
public Response getJbrowseRNASeqTracks(@PathParam("organismAbbrev") String organismAbbrev,
@DefaultValue("1") @QueryParam("appVersion") String appVersion) throws IOException {

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
Expand All @@ -209,14 +228,15 @@ public Response getJbrowseRNASeqTracks(@PathParam("organismAbbrev") String organ
command.add(buildNumber);
command.add(webservicesDir);
command.add("RNASeq");

command.add(appVersion);
return responseFromCommand(command);
}

@GET
@Path("chipseq/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseChIPSeqTracks(@PathParam("organismAbbrev") String organismAbbrev) throws IOException {
public Response getJbrowseChIPSeqTracks(@PathParam("organismAbbrev") String organismAbbrev,
@DefaultValue("1") @QueryParam("appVersion") String appVersion) throws IOException {

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
Expand All @@ -230,7 +250,7 @@ public Response getJbrowseChIPSeqTracks(@PathParam("organismAbbrev") String orga
command.add(buildNumber);
command.add(webservicesDir);
command.add("ChIPSeq");

command.add(appVersion);
return responseFromCommand(command);
}

Expand Down Expand Up @@ -278,46 +298,52 @@ private static String checkPath(String fileSystemPath) {
return fileSystemPath;
}

@GET
@Path("seq/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseRefSeqs(@PathParam("organismAbbrev") String organismAbbrev ) throws IOException {

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
// THIS SHOULD BE REPLACED BY INDEXED FASTA IN WEBSERVICES
// @GET
// @Path("seq/{organismAbbrev}")
// @Produces(MediaType.APPLICATION_JSON)
// public Response getJbrowseRefSeqs(@PathParam("organismAbbrev") String organismAbbrev ) throws IOException {

List<String> command = new ArrayList<String>();
command.add(gusHome + "/bin/jbrowseRefSeqs");
command.add(gusHome);
command.add(projectId);
command.add(organismAbbrev);
command.add("genomic");
// String gusHome = getWdkModel().getGusHome();
// String projectId = getWdkModel().getProjectId();

return responseFromCommand(command);
}
// List<String> command = new ArrayList<String>();
// command.add(gusHome + "/bin/jbrowseRefSeqs");
// command.add(gusHome);
// command.add(projectId);
// command.add(organismAbbrev);
// command.add("genomic");

@GET
@Path("aaseq/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseAaRefSeqs(@PathParam("organismAbbrev") String organismAbbrev ) throws IOException {
// return responseFromCommand(command);
// }

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
// THIS SHOULD BE REPLACED BY INDEXED FASTA IN WEBSERVICES
// @GET
// @Path("aaseq/{organismAbbrev}")
// @Produces(MediaType.APPLICATION_JSON)
// public Response getJbrowseAaRefSeqs(@PathParam("organismAbbrev") String organismAbbrev ) throws IOException {

List<String> command = new ArrayList<String>();
command.add(gusHome + "/bin/jbrowseRefSeqs");
command.add(gusHome);
command.add(projectId);
command.add(organismAbbrev);
command.add("protein");
// String gusHome = getWdkModel().getGusHome();
// String projectId = getWdkModel().getProjectId();

return responseFromCommand(command);
}
// List<String> command = new ArrayList<String>();
// command.add(gusHome + "/bin/jbrowseRefSeqs");
// command.add(gusHome);
// command.add(projectId);
// command.add(organismAbbrev);
// command.add("protein");

// return responseFromCommand(command);
// }

@GET
@Path("names/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseNames(@PathParam("organismAbbrev") String organismAbbrev, @QueryParam("equals") String eq, @QueryParam("startswith") String startsWith) throws IOException {
public Response getJbrowseNames(@PathParam("organismAbbrev") String organismAbbrev,
@QueryParam("equals") String eq,
@DefaultValue("1") @QueryParam("appVersion") String appVersion,
@QueryParam("startswith") String startsWith) throws IOException {

if ((startsWith == null || startsWith.isBlank()) && (eq == null || eq.isBlank())) {
throw new BadRequestException("Request must include one of the following query parameters: ['startswith', 'equals']");
Expand All @@ -341,15 +367,18 @@ public Response getJbrowseNames(@PathParam("organismAbbrev") String organismAbbr
command.add(organismAbbrev);
command.add("genomic");
command.add(String.valueOf(isPartial));
command.add(appVersion);
command.add(sourceId);

return responseFromCommand(command);
}

@GET
@Path("aanames/{organismAbbrev}")
@Produces(MediaType.APPLICATION_JSON)
public Response getJbrowseAaNames(@PathParam("organismAbbrev") String organismAbbrev, @QueryParam("equals") String eq, @QueryParam("startswith") String startsWith) throws IOException {
public Response getJbrowseAaNames(@PathParam("organismAbbrev") String organismAbbrev,
@QueryParam("equals") String eq,
@DefaultValue("1") @QueryParam("appVersion") String appVersion,
@QueryParam("startswith") String startsWith) throws IOException {

String gusHome = getWdkModel().getGusHome();
String projectId = getWdkModel().getProjectId();
Expand All @@ -369,6 +398,7 @@ public Response getJbrowseAaNames(@PathParam("organismAbbrev") String organismAb
command.add(organismAbbrev);
command.add("protein");
command.add(String.valueOf(isPartial));
command.add(appVersion);
command.add(sourceId);

return responseFromCommand(command);
Expand Down

0 comments on commit cd5bdee

Please sign in to comment.