Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor 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
schwede
openstructure
Commits
71cffd9a
Commit
71cffd9a
authored
9 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Also load InChI key into the compoundslib, ment to be machine readable
parent
dce93795
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/conop/src/compound.hh
+6
-0
6 additions, 0 deletions
modules/conop/src/compound.hh
modules/conop/src/compound_lib.cc
+6
-3
6 additions, 3 deletions
modules/conop/src/compound_lib.cc
modules/io/src/mol/chemdict_parser.cc
+2
-0
2 additions, 0 deletions
modules/io/src/mol/chemdict_parser.cc
with
14 additions
and
3 deletions
modules/conop/src/compound.hh
+
6
−
0
View file @
71cffd9a
...
...
@@ -148,6 +148,7 @@ public:
formula_
(),
name_
(),
inchi_
(),
inchi_key_
(),
atom_specs_
(),
bond_specs_
(),
chem_class_
(),
...
...
@@ -247,6 +248,10 @@ public:
const
String
&
GetInchi
()
{
return
inchi_
;
}
void
SetInchiKey
(
const
String
&
inchikey
)
{
inchi_key_
=
inchikey
;
}
const
String
&
GetInchiKey
()
{
return
inchi_key_
;
}
const
BondSpecList
&
GetBondSpecs
()
const
{
return
bond_specs_
;
}
...
...
@@ -275,6 +280,7 @@ private:
String
formula_
;
String
name_
;
String
inchi_
;
String
inchi_key_
;
AtomSpecList
atom_specs_
;
BondSpecList
bond_specs_
;
mol
::
ChemClass
chem_class_
;
...
...
This diff is collapsed.
Click to expand it.
modules/conop/src/compound_lib.cc
+
6
−
3
View file @
71cffd9a
...
...
@@ -50,7 +50,8 @@ const char* CREATE_CMD[]={
" pdb_initial TIMESTAMP, "
" pdb_modified TIMESTAMP, "
" name VARCHAR(256), "
" inchi_code TEXT "
" inchi_code TEXT, "
" inchi_key TEXT "
");"
,
" CREATE UNIQUE INDEX IF NOT EXISTS commpound_tlc_index ON chem_compounds "
" (tlc, dialect)"
,
...
...
@@ -86,8 +87,8 @@ const char* CREATE_CMD[]={
const
char
*
INSERT_COMPOUND_STATEMENT
=
"INSERT INTO chem_compounds "
" (tlc, olc, dialect, chem_class, chem_type, formula, pdb_initial, pdb_modified, name, inchi_code) "
" VALUES (?, ?, ?, ?, ?, ?, DATE(?), DATE(?), ?, ?)"
;
" (tlc, olc, dialect, chem_class, chem_type, formula, pdb_initial, pdb_modified, name, inchi_code
, inchi_key
) "
" VALUES (?, ?, ?, ?, ?, ?, DATE(?), DATE(?), ?,
?,
?)"
;
const
char
*
INSERT_ATOM_STATEMENT
=
"INSERT INTO atoms "
" (compound_id, name, alt_name, element, is_aromatic, stereo_conf, "
...
...
@@ -229,6 +230,8 @@ void CompoundLib::AddCompound(const CompoundPtr& compound)
compound
->
GetName
().
length
(),
NULL
);
sqlite3_bind_text
(
stmt
,
10
,
compound
->
GetInchi
().
c_str
(),
compound
->
GetInchi
().
length
(),
NULL
);
sqlite3_bind_text
(
stmt
,
11
,
compound
->
GetInchiKey
().
c_str
(),
compound
->
GetInchiKey
().
length
(),
NULL
);
}
else
{
LOG_ERROR
(
sqlite3_errmsg
(
conn_
));
sqlite3_finalize
(
stmt
);
...
...
This diff is collapsed.
Click to expand it.
modules/io/src/mol/chemdict_parser.cc
+
2
−
0
View file @
71cffd9a
...
...
@@ -83,6 +83,8 @@ void ChemdictParser::OnDataRow(const StarLoopDesc& header,
return
;
}
compound_
->
SetInchi
(
columns
[
indices_
[
DESC
]].
substr
(
6
).
str
());
}
else
if
(
columns
[
indices_
[
DESC_TYPE
]]
==
StringRef
(
"InChIKey"
,
8
))
{
compound_
->
SetInchiKey
(
columns
[
indices_
[
DESC
]].
str
());
}
}
}
...
...
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