Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
f78a495d
Commit
f78a495d
authored
Jun 13, 2019
by
Piotr Gawron
Browse files
search by target didn't work if target was annotated automatically
parent
89c320bf
Changes
6
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
f78a495d
...
...
@@ -22,6 +22,8 @@ minerva (14.0.0~alpha.0) unstable; urgency=low
with
SBML
standard
(#
831
)
*
Bug
fix
:
MiRNA
targets
are
limited
only
to
the
organism
associated
with
the
map
(#
66
)
*
Bug
fix
:
Search
drug
by
target
element
did
not
return
values
when
this
element
was
annotated
automatically
(#
216
)
--
Sascha
Herzinger
<
sascha
.
herzinger
@
uni
.
lu
>
Wed
,
22
May
2019
10
:
30
:
00
+
0200
...
...
annotation/src/main/java/lcsb/mapviewer/annotation/services/DrugbankHTMLParser.java
View file @
f78a495d
...
...
@@ -621,12 +621,13 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi
}
@Override
public
List
<
Drug
>
getDrugListByTarget
(
MiriamData
target
MiriamData
,
Collection
<
MiriamData
>
organisms
)
public
List
<
Drug
>
getDrugListByTarget
(
MiriamData
target
,
Collection
<
MiriamData
>
organisms
)
throws
DrugSearchException
{
List
<
Drug
>
result
=
new
ArrayList
<>();
if
(
target
MiriamData
==
null
)
{
if
(
target
==
null
)
{
return
result
;
}
MiriamData
targetMiriamData
=
new
MiriamData
(
target
.
getDataType
(),
target
.
getResource
());
if
(!(
MiriamType
.
HGNC_SYMBOL
.
equals
(
targetMiriamData
.
getDataType
())))
{
throw
new
InvalidArgumentException
(
"Only "
+
MiriamType
.
HGNC_SYMBOL
+
" type is accepted"
);
}
...
...
@@ -747,10 +748,13 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi
* the target and we need to filter it out (here is an example for TF targets:
* https://www.drugbank.ca/unearth/q?utf8=%E2%9C%93&searcher=targets&query=TF)
*
* @param page - target webpage content
* @param hgncTarget - HGNC identifier that should match the target
* @param page
* - target webpage content
* @param hgncTarget
* - HGNC identifier that should match the target
* @return
* @throws UniprotSearchException - when there is problem with translating HGNC<->uniprot
* @throws UniprotSearchException
* - when there is problem with translating HGNC<->uniprot
*/
boolean
targetPageMatchTarget
(
String
page
,
MiriamData
hgncTarget
)
throws
UniprotSearchException
{
int
protienLinkPosition
=
page
.
indexOf
(
"/polypeptides/"
);
...
...
annotation/src/main/java/lcsb/mapviewer/annotation/services/MiRNAParser.java
View file @
f78a495d
...
...
@@ -470,8 +470,8 @@ public class MiRNAParser extends CachableInterface implements IExternalService {
* the parameter.
*
* @param targetsMiriam
* targets that should be targeted by resulting mir
r
nas
* @return list of mirnas that target elements identified by paramter
* targets that should be targeted by resulting mirnas
* @return list of mirnas that target elements identified by param
e
ter
* @throws MiRNASearchException
* thrown when there is a problem with accessing mirna database
*/
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/ChemicalParserTest.java
View file @
f78a495d
...
...
@@ -273,6 +273,23 @@ public class ChemicalParserTest extends AnnotationTestFunctions {
}
}
@Test
public
void
testGetByTargetWithAnnotator
()
throws
Exception
{
try
{
MiriamData
target
=
new
MiriamData
(
MiriamType
.
HGNC_SYMBOL
,
"GCH1"
,
String
.
class
);
List
<
MiriamData
>
targets
=
new
ArrayList
<>();
targets
.
add
(
target
);
List
<
Chemical
>
list
=
chemicalParser
.
getChemicalListByTarget
(
targets
,
dystoniaDisease
);
assertNotNull
(
list
);
assertFalse
(
list
.
isEmpty
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
e
;
}
}
@Test
public
void
testGetByInvalidTarget
()
throws
Exception
{
try
{
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/DrugbankHTMLParserTest.java
View file @
f78a495d
...
...
@@ -238,6 +238,19 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
}
}
@Test
public
void
testFindDrugByHgncTargetWithAnnotatorAssigned
()
throws
Exception
{
try
{
List
<
Drug
>
drugs
=
drugBankHTMLParser
.
getDrugListByTarget
(
new
MiriamData
(
MiriamType
.
HGNC_SYMBOL
,
"SIRT3"
,
String
.
class
));
assertNotNull
(
drugs
);
assertTrue
(
"At least 1 drug was expected"
,
drugs
.
size
()
>=
1
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
e
;
}
}
@Test
public
void
testTargetPageMatchTargetForTFProtein
()
throws
Exception
{
try
{
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/MiRNAParserTest.java
View file @
f78a495d
...
...
@@ -159,6 +159,31 @@ public class MiRNAParserTest extends AnnotationTestFunctions {
}
}
@Test
public
void
testFindByTargetWithAnnotator
()
throws
Exception
{
try
{
Set
<
MiriamData
>
targets
=
new
HashSet
<>();
MiriamData
hgncTarget
=
new
MiriamData
(
MiriamType
.
HGNC_SYMBOL
,
"PLAG1"
,
String
.
class
);
targets
.
add
(
hgncTarget
);
List
<
MiRNA
>
listFromDB
=
miRNAParser
.
getMiRnaListByTargets
(
targets
);
assertTrue
(
listFromDB
.
size
()
>
0
);
hgncTarget
.
setAnnotator
(
null
);
for
(
MiRNA
miRNA
:
listFromDB
)
{
boolean
found
=
false
;
for
(
Target
targt
:
miRNA
.
getTargets
())
{
if
(
targt
.
getGenes
().
contains
(
hgncTarget
))
{
found
=
true
;
}
}
assertTrue
(
found
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
e
;
}
}
@Test
(
timeout
=
50000
)
public
void
testCachableInterfaceInvalidateMiRNA
()
throws
Exception
{
try
{
...
...
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