Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
d2b358a4
Commit
d2b358a4
authored
Nov 09, 2021
by
Piotr Gawron
Browse files
Merge branch '1520-drug-suggested-list' into 'devel_16.0.x'
Resolve "Autocomplete does not work" See merge request
!1384
parents
016faf10
7c81e666
Pipeline
#49922
passed with stage
in 26 minutes and 4 seconds
Changes
3
Pipelines
15
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
d2b358a4
...
...
@@ -20,8 +20,10 @@ minerva (16.0.1) stable; urgency=medium
were
projects
with
a
lot
of
log
entries
(#
1588
)
*
Bug
fix
:
complex
target
of
chembl
compounds
(
like
ME
-
344
)
were
not
highligted
on
map
(#
1579
)
*
Bug
fix
:
chembl
drugs
targeting
RNA
(
like
BEVASIRANIB
)
prevented
providing
list
of
suggested
drug
queries
(#
1520
)
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Tue
,
2
Nov
2021
15
:
00
:
00
+
0200
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Tue
,
9
Nov
2021
15
:
00
:
00
+
0200
minerva
(
16.0.0
)
stable
;
urgency
=
medium
*
Backward
incompatibility
:
debian
package
cannot
be
upgraded
from
version
...
...
annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotator.java
View file @
d2b358a4
package
lcsb.mapviewer.annotation.services.annotators
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
lcsb.mapviewer.annotation.cache.GeneralCacheInterface
;
import
lcsb.mapviewer.annotation.cache.WebPageDownloader
;
import
lcsb.mapviewer.annotation.services.*
;
import
lcsb.mapviewer.annotation.services.ExternalServiceStatus
;
import
lcsb.mapviewer.annotation.services.ExternalServiceStatusType
;
import
lcsb.mapviewer.annotation.services.IExternalService
;
import
lcsb.mapviewer.annotation.services.WrongResponseCodeIOException
;
import
lcsb.mapviewer.common.exception.InvalidArgumentException
;
import
lcsb.mapviewer.common.exception.NotImplementedException
;
import
lcsb.mapviewer.model.ProjectLogEntryType
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.MiriamType
;
import
lcsb.mapviewer.model.map.species.*
;
import
lcsb.mapviewer.model.user.annotator.*
;
import
lcsb.mapviewer.model.map.species.Gene
;
import
lcsb.mapviewer.model.map.species.Protein
;
import
lcsb.mapviewer.model.map.species.Rna
;
import
lcsb.mapviewer.model.user.annotator.AnnotatorData
;
import
lcsb.mapviewer.model.user.annotator.AnnotatorInputParameter
;
import
lcsb.mapviewer.model.user.annotator.AnnotatorOutputParameter
;
import
lcsb.mapviewer.model.user.annotator.BioEntityField
;
/**
* This is a class that implements a backend to uniprot restfull API.
...
...
@@ -164,8 +177,8 @@ public class UniprotAnnotator extends ElementAnnotator implements IExternalServi
}
/**
* Returns URL to UniProt result containing mapped UniProtIds for submitted
TAIR
* entry.
* Returns URL to UniProt result containing mapped UniProtIds for submitted
*
TAIR
entry.
*
* @param tairId
* TAIR identifier
...
...
@@ -177,8 +190,8 @@ public class UniprotAnnotator extends ElementAnnotator implements IExternalServi
}
/**
* Parse uniprot webpage to find information about {@link MiriamType#ENTREZ}
and
* returns them.
* Parse uniprot webpage to find information about {@link MiriamType#ENTREZ}
*
and
returns them.
*
* @param pageContent
* uniprot info page
...
...
@@ -254,6 +267,13 @@ public class UniprotAnnotator extends ElementAnnotator implements IExternalServi
}
else
{
return
null
;
}
}
catch
(
WrongResponseCodeIOException
e
)
{
if
(
e
.
getResponseCode
()
==
HttpStatus
.
NOT_FOUND
.
value
())
{
logger
.
warn
(
"Unknown uniprot id: "
+
uniprot
.
getResource
());
return
null
;
}
else
{
throw
new
UniprotSearchException
(
"Problem with accessing uniprot webpage"
,
e
);
}
}
catch
(
IOException
e
)
{
throw
new
UniprotSearchException
(
"Problem with accessing uniprot webpage"
,
e
);
}
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java
View file @
d2b358a4
...
...
@@ -125,6 +125,11 @@ public class UniprotAnnotatorTest extends AnnotationTestFunctions {
uniprotAnnotator
.
uniProtToHgnc
(
new
MiriamData
(
MiriamType
.
WIKIPEDIA
,
"bla"
));
}
@Test
public
void
testUnknownUniprotId
()
throws
Exception
{
assertNull
(
uniprotAnnotator
.
uniProtToHgnc
(
new
MiriamData
(
MiriamType
.
UNIPROT
,
"bla"
)));
}
@Test
public
void
testAnnotate2
()
throws
Exception
{
Species
protein
=
new
GenericProtein
(
"id"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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