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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
7f7932ef
Commit
7f7932ef
authored
Jul 5, 2012
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
move some code into a function
parent
85b90ae9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/molck/main.cc
+28
-21
28 additions, 21 deletions
tools/molck/main.cc
with
28 additions
and
21 deletions
tools/molck/main.cc
+
28
−
21
View file @
7f7932ef
...
...
@@ -38,25 +38,14 @@ EntityHandle load_x(const String& file, const IOProfile& profile)
}
}
void
usage
()
// load compound library, exiting if it could not be found...
CompoundLibPtr
load_compound_lib
()
{
std
::
cerr
<<
"usage: molck file1.pdb [file2.pdb [...]]"
<<
std
::
endl
;
exit
(
0
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
2
)
{
usage
();
if
(
fs
::
exists
(
"compounds.chemlib"
))
{
return
CompoundLib
::
Load
(
"compounds.chemlib"
);
}
IOProfile
prof
;
String
rm
;
String
color
;
bool
colored
=
false
;
char
result
[
1024
];
CompoundLibPtr
lib
=
CompoundLib
::
Load
(
"compounds.chemlib"
);
CompoundLibPtr
lib
;
String
exe_path
;
#if defined(__APPLE__)
uint32_t
size
=
1023
;
...
...
@@ -83,12 +72,32 @@ int main(int argc, char *argv[])
String
share_path_string
=
share_path
.
file_string
();
#endif
lib
=
CompoundLib
::
Load
(
share_path_string
);
return
CompoundLib
::
Load
(
share_path_string
);
}
if
(
!
lib
)
{
std
::
cerr
<<
"Could not load compounds.chemlib"
<<
std
::
endl
;
exit
(
-
1
);
}
return
CompoundLibPtr
();
}
void
usage
()
{
std
::
cerr
<<
"usage: molck file1.pdb [file2.pdb [...]]"
<<
std
::
endl
;
exit
(
0
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
2
)
{
usage
();
}
IOProfile
prof
;
String
rm
;
String
color
;
bool
colored
=
false
;
CompoundLibPtr
lib
=
load_compound_lib
();
bool
rm_unk_atoms
=
false
;
bool
rm_hyd_atoms
=
false
;
bool
rm_non_std
=
false
;
...
...
@@ -117,7 +126,7 @@ int main(int argc, char *argv[])
options
(
desc
).
positional
(
p
).
run
(),
vm
);
}
catch
(
std
::
exception
&
e
)
{
std
::
c
out
<<
e
.
what
()
<<
std
::
endl
;
std
::
c
err
<<
e
.
what
()
<<
std
::
endl
;
usage
();
exit
(
-
1
);
}
...
...
@@ -199,8 +208,6 @@ int main(int argc, char *argv[])
continue
;
}
ResidueHandle
dest_res
=
new_edi
.
AppendResidue
(
new_chain
,
OneLetterCodeToResidueName
(
compound
->
GetOneLetterCode
()),
r
->
GetNumber
());
std
::
cout
<<
" I am here"
<<
std
::
endl
;
CopyResidue
(
*
r
,
dest_res
,
new_edi
,
lib
);
}
}
...
...
@@ -212,7 +219,7 @@ int main(int argc, char *argv[])
DiagEngine
diags
;
Checker
checker
(
lib
,
ent
,
diags
);
if
(
rm_zero_occ_atoms
)
{
std
::
cerr
<<
"removing zero occupancy
atoms
"
<<
std
::
endl
;
std
::
cerr
<<
"removing
atoms with
zero occupancy"
<<
std
::
endl
;
int
zremoved
=
0
;
AtomHandleList
zero_atoms
=
checker
.
GetZeroOccupancy
();
for
(
AtomHandleList
::
const_iterator
i
=
zero_atoms
.
begin
(),
e
=
zero_atoms
.
end
();
i
!=
e
;
++
i
)
{
...
...
...
...
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
sign in
to comment