FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
solventmapcreator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yusuf Hamied Department of Chemistry
Hunter Group
SSIPtools
SSIMPLEapps
solventmapcreator
Commits
3979d174
Commit
3979d174
authored
6 years ago
by
M.D. Driver
Browse files
Options
Downloads
Patches
Plain Diff
initial attempt at map merging to form FGIPs.
parent
5d27e4cd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+2
-1
2 additions, 1 deletion
setup.py
solventmapcreator/solvationcalculation/fgipmaker.py
+64
-0
64 additions, 0 deletions
solventmapcreator/solvationcalculation/fgipmaker.py
with
66 additions
and
1 deletion
setup.py
+
2
−
1
View file @
3979d174
...
...
@@ -8,5 +8,6 @@ setup(name='solventmapcreator',
author_email
=
'
mdd31@cam.ac.uk
'
,
license
=
'
TBD
'
,
packages
=
setuptools
.
find_packages
(),
package_data
=
{
'
test/resources
'
:[
'
test/resources
'
]},
package_data
=
{
'
test/resources
'
:[
'
test/resources
'
],
'
solvationcalculation/resources
'
:[
'
solvationcalculation/resources
'
]},
zip_safe
=
False
)
This diff is collapsed.
Click to expand it.
solventmapcreator/solvationcalculation/fgipmaker.py
0 → 100644
+
64
−
0
View file @
3979d174
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script for merging the molecules to the solvent map to create the functional
group interaction profile.
@author: mark
"""
import
logging
import
os
import
svgutils.transform
as
svgt
logging
.
basicConfig
()
LOGGER
=
logging
.
getLogger
(
__name__
)
LOGGER
.
setLevel
(
logging
.
WARN
)
FGIP_MOLECULES_FILENAME
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
resources/FGIPmolecules.svg
"
)
def
create_fgip_from_map
(
map_filename
):
"""
This creates a FGIP from the given solvent map.
"""
svg_figure
=
create_svgfigure
()
map_plot
=
get_svg_plot
(
map_filename
)
map_plot
.
moveto
(
0.0
,
150.0
,
scale
=
1.1
)
molecules_plot
=
get_molecules
()
append_svg_plots
(
svg_figure
,
map_plot
)
append_svg_plots
(
svg_figure
,
molecules_plot
)
output_filename
=
create_output_filename
(
map_filename
)
save_svg_figure
(
svg_figure
,
output_filename
)
def
save_svg_figure
(
svg_figure
,
filename
):
"""
This saves the figue to file.
"""
svg_figure
.
save
(
filename
)
def
create_output_filename
(
filename
,
suffix
=
"
_solv_map.svg
"
):
"""
This returns the output filename to be used.
"""
return
filename
.
replace
(
suffix
,
"
_FGIP.svg
"
)
def
append_svg_plots
(
svg_figure
,
svg_plot
):
"""
This appends the plot to the figure.
"""
svg_figure
.
append
(
svg_plot
)
def
get_molecules
():
"""
This gets the molecules.
"""
return
get_svg_plot
(
FGIP_MOLECULES_FILENAME
)
def
get_svg_plot
(
svg_filename
):
"""
This gets the plot elements.
"""
figure
=
svgt
.
fromfile
(
svg_filename
)
return
figure
.
getroot
()
def
create_svgfigure
():
"""
This creates SVG figure with default size.
"""
return
svgt
.
SVGFigure
(
width
=
"
725.05334pt
"
,
height
=
"
676.02484pt
"
)
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