Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iBB
API
geneinfoservice
Commits
060b25d3
Commit
060b25d3
authored
Jun 07, 2020
by
tim.tucholski
Browse files
Added support for multiple ID requests, fixed pom.xml
parent
bfe24052
Changes
2
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
060b25d3
...
...
@@ -3,7 +3,7 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
de.unigoettingen.ibeetlebase.api.core
</groupId>
<artifactId>
geneinfoservice
_new
</artifactId>
<artifactId>
geneinfoservice
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<properties>
<compiler-plugin.version>
3.8.1
</compiler-plugin.version>
...
...
src/main/java/de/unigoettingen/ibeetlebase/api/GeneinfoResource.java
View file @
060b25d3
package
de.unigoettingen.ibeetlebase.api
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
io.quarkus.runtime.Quarkus
;
...
...
@@ -11,6 +13,7 @@ import javax.ws.rs.GET;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.QueryParam
;
import
javax.ws.rs.core.MediaType
;
import
org.eclipse.microprofile.metrics.annotation.Metered
;
import
de.unigoettingen.ibeetlebase.api.core.FlyBase
;
...
...
@@ -64,6 +67,27 @@ public class GeneinfoResource implements QuarkusApplication {
return
tb
.
retrieve
(
tc
);
}
/**
* Accepts multiple comma-separated gene IDs and returns the resulting gene information.
* @param ids The list of IDs
* @return Gene information for each queried ID
*/
@GET
@Metered
@Path
(
VERSION_STRING
+
"/gene"
)
public
List
<
Gene
>
getInfo
(
@QueryParam
(
"ids"
)
final
String
ids
)
{
List
<
Gene
>
result_list
=
new
ArrayList
<
Gene
>();
for
(
String
id
:
ids
.
split
(
","
))
{
if
(
checkTCID
(
id
))
{
result_list
.
add
(
tb
.
retrieve
(
id
));
}
else
if
(
checkFBgnID
(
id
))
{
result_list
.
add
(
fb
.
retrieve
(
id
));
}
}
return
result_list
;
}
/**
* Checks if a FlyBase gene identifier (FBgn) is in the right format
* @param fbgn The Flybase gene identifier to be checked
...
...
@@ -89,7 +113,7 @@ public class GeneinfoResource implements QuarkusApplication {
*/
@GET
@Metered
@Path
(
VERSION_STRING
+
"/flybase/
all
"
)
@Path
(
VERSION_STRING
+
"/flybase/
identifiers
"
)
public
Map
<
String
,
String
>
getAllFlybaseIDs
(
@PathParam
(
"dataversion"
)
final
String
dataversion
)
{
return
fb
.
getAllIDs
();
}
...
...
@@ -101,7 +125,7 @@ public class GeneinfoResource implements QuarkusApplication {
*/
@GET
@Metered
@Path
(
VERSION_STRING
+
"/tribolium/
all
"
)
@Path
(
VERSION_STRING
+
"/tribolium/
identifiers
"
)
public
Map
<
String
,
String
>
getAllTriboliumIDs
(
@PathParam
(
"dataversion"
)
final
String
dataversion
)
{
return
tb
.
getAllIDs
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment