Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
c6d1c13f
Commit
c6d1c13f
authored
5 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
add unit test for smi2sdf utils function
parent
edb1b918
No related branches found
No related tags found
1 merge request
!13
Master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ippisite/ippidb/tests.py
+25
-1
25 additions, 1 deletion
ippisite/ippidb/tests.py
with
25 additions
and
1 deletion
ippisite/ippidb/tests.py
+
25
−
1
View file @
c6d1c13f
...
...
@@ -26,7 +26,7 @@ from .models import (
PcaBiplotData
,
)
from
.models
import
DrugBankCompound
,
Protein
from
.utils
import
FingerPrinter
,
mol2smi
,
smi2mol
,
smi2inchi
,
smi2inchikey
from
.utils
import
FingerPrinter
,
mol2smi
,
smi2mol
,
smi2inchi
,
smi2inchikey
,
smi2sdf
class
MolSmiTestCase
(
TestCase
):
...
...
@@ -918,6 +918,30 @@ class TestConvertSMILESToIUPAC(TestCase):
)
class
TestConvertSMILESToSDF
(
TestCase
):
"""
Test converting a smiles to SDF using openbabel
"""
def
test_valid
(
self
):
smiles_to_sdfs
=
{
"
C
"
:
[
"
1
"
,
"
OpenBabel04142011372D
"
,
""
,
"
1 0 0 0 0 0 0 0 0 0999 V2000
"
,
"
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
"
,
"
M END
"
,
"
$$$$
"
,
]
}
for
smiles
,
expected_lines
in
smiles_to_sdfs
.
items
():
result
=
smi2sdf
({
1
:
smiles
})
result_lines
=
result
.
split
(
"
\n
"
)
for
line_idx
in
[
0
,
2
,
3
,
4
,
5
,
6
]:
self
.
assertEqual
(
result_lines
[
line_idx
],
expected_lines
[
line_idx
])
class
DuplicateGeneNameTestCase
(
TestCase
):
def
test_works
(
self
):
models
.
Protein
.
objects
.
get_or_create
(
uniprot_id
=
"
P12497
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment