Skip to content

Commit 4a3213b

Browse files
authored
Merge pull request #5 from lcmd-epfl/dev
cell2mol as dependency, cif2cell as input, update visualization and instructions added
2 parents cd74ae4 + 874ed3b commit 4a3213b

File tree

111 files changed

+844
-141077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+844
-141077
lines changed

Dockerfile

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
FROM materialscloud/tools-barebone:1.3.0
22

3-
LABEL maintainer="Developer Name <developer.email@xxx.yy>"
3+
LABEL maintainer="Osvaldo Hernandez-Cuellar <osvaldo.hernandezcuellar@epfl.ch>, Liam O. Marsh <liam.marsh@epfl.ch>, and Ruben Laplaza <ruben.laplazasolanas@epfl.ch>"
44

55
# Python requirements
66
COPY ./requirements.txt /home/app/code/requirements.txt
7-
COPY ./cell2mol/requirements.txt /home/app/code/compute-requirements.txt
87
# Run this as sudo to replace the version of pip
98

10-
119
RUN pip3 install -U 'pip>=10' setuptools wheel
1210
# install packages as normal user (app, provided by passenger)
1311

@@ -18,9 +16,7 @@ USER app
1816
WORKDIR /home/app/code
1917
# Install pinned versions of packages
2018
COPY ./requirements.txt /home/app/code/requirements.txt
21-
COPY ./cell2mol/requirements.txt /home/app/code/compute-requirements.txt
2219
RUN pip3 install --user -r requirements.txt
23-
RUN pip3 install --user -r compute-requirements.txt
2420

2521
# Go back to root.
2622
# Also, it should remain as user root for startup
@@ -30,15 +26,13 @@ USER root
3026
COPY ./config.yaml /home/app/code/webservice/static/config.yaml
3127
COPY ./user_templates/ /home/app/code/webservice/templates/user_templates/
3228
COPY ./user_static/ /home/app/code/webservice/user_static/
33-
COPY ./cell2mol/ /home/app/code/webservice/cell2mol/
3429
COPY ./compute/ /home/app/code/webservice/compute/
3530
#Needed to allow only .cif file formats in the upload_structure_block
3631
COPY ./web_module.py /home/app/code/webservice/
37-
COPY ./base.html /home/app/code/webservice/templates/
32+
COPY ./base_templates/* /home/app/code/webservice/templates/
3833

3934
# If you put any static file (CSS, JS, images),
4035
#create this folder and put them here
41-
# COPY ./user_static/ /home/app/code/webservice/user_static/
4236

4337
###
4438
# Copy any additional files needed into /home/app/code/webservice/
@@ -47,9 +41,4 @@ COPY ./base.html /home/app/code/webservice/templates/
4741
# Set proper permissions on files just copied
4842
RUN chown -R app:app /home/app/code/webservice/
4943

50-
USER app
51-
WORKDIR /home/app/code/webservice/cell2mol/
52-
RUN python3 ./setup.py build
53-
USER root
54-
5544

base.html renamed to base_templates/base.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<div id='container'>
2+
3+
24
<div id='maintitle'>
35
{% block pagetitle %}
46
<h1 style="text-align: center;">{{ config["page_title"] }}</h1>
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
2+
3+
4+
<h2><a name="tool"></a>Upload your structure</h2>
5+
<div style="margin-left: 20px; margin-right: 20px">
6+
<form action="compute/process_structure/" enctype="multipart/form-data" method="post">
7+
<div class='alert alert-info'>
8+
<div class='row'>
9+
<div class='col-xs-12 col-sm-6'>
10+
<label for="file">Upload a crystal structure:</label>
11+
</div>
12+
<div class="col-xs-12 col-sm-6">
13+
<input type="file" name="structurefile" size="100">
14+
</div>
15+
</div>
16+
<div class='row'>
17+
<div class='col-sm-6'>
18+
<label for="fileformatSelect">Select here the file format:</label>
19+
</div>
20+
<div class='col-sm-6'>
21+
<select name="fileformat" id="fileformatSelect" onchange="formatInfo();" autocomplete="off">
22+
<option disabled selected value> -- select an option -- </option>
23+
{# First put the formats the user specified, if existing #}
24+
{% for parser_name in config.get('upload_structure_block_order', []) %}
25+
{% if parser_name in upload_structure_block_known_formats %}
26+
<option value="{{ parser_name }}">{{ upload_structure_block_known_formats[parser_name] }}</option>
27+
{% endif %}
28+
{% endfor %}
29+
30+
{# Then put any remaining format #}
31+
{% for parser_name in upload_structure_block_known_formats %}
32+
{% if parser_name not in config.get('upload_structure_block_order', []) %}
33+
<option value="{{ parser_name }}">{{ upload_structure_block_known_formats[parser_name] }}</option>
34+
{% endif %}
35+
{% endfor %}
36+
</select>
37+
</div>
38+
</div>
39+
<div class="row col-sm-12" style="margin-top:10px; margin-bottom:-10px;">
40+
<div id="cifImportantInfo" class="alert alert-warning" hidden>
41+
<i> <ul style="padding-left: 10px;">
42+
<li>
43+
cell2mol web interface incorporates cif2cell v2.0.0 instead of v1.2.10
44+
</li>
45+
<li>
46+
To reproduce results reported on
47+
<a href="https://doi.org/10.1038/s41524-022-00874-9 " target="_blank">doi: 10.1038/s41524-022-00874-9 </a>,
48+
please use the cif2cell v1.2.10 output as input file with the <i>.info</i> extension.
49+
</li>
50+
</i></ul>
51+
</div>
52+
<div id="infoImportantInfo" class="alert alert-warning" hidden>
53+
<i> <ul style="padding-left: 10px;">
54+
<li>
55+
Please use use the flag <code>--cartesian</code> when generating the input file with cif2cell, and make sure
56+
it has the <i>.info</i> file extension.
57+
</li>
58+
<li>
59+
To reproduce results reported on
60+
<a href="https://doi.org/10.1038/s41524-022-00874-9 " target="_blank">doi: 10.1038/s41524-022-00874-9 </a>,
61+
please use cif2cell v1.2.10
62+
</li>
63+
</i></ul>
64+
</div>
65+
</div>
66+
<div id="xyzFormatFields" class="row" style="display: none">
67+
<div class='col-sm-6'>Cell vectors (&#x212B;)</div>
68+
<div class='col-sm-6'>
69+
<div class='row'>
70+
<div class='col-xs-2'>A</div>
71+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecAx"></div>
72+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecAy"></div>
73+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecAz"></div>
74+
</div>
75+
<div class='row'>
76+
<div class='col-xs-2'>B</div>
77+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecBx"></div>
78+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecBy"></div>
79+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecBz"></div>
80+
</div>
81+
<div class='row'>
82+
<div class='col-xs-2'>C</div>
83+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecCx"></div>
84+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecCy"></div>
85+
<div class='col-xs-3'><input type="number" step="any" class="form-control" name="xyzCellVecCz"></div>
86+
</div>
87+
</div>
88+
</div>
89+
{% if include_pages['upload_structure_additional_content'] is not none %}
90+
{% include include_pages['upload_structure_additional_content'] %}
91+
{% endif %}
92+
{% block structure_additional_content %}{% endblock %}
93+
<div class='row' style="text-align:center">
94+
<br/>
95+
<input type="submit" value="Calculate my structure" class="btn btn-default">
96+
</div>
97+
</div>
98+
</form>
99+
</div>
100+
101+
<script>
102+
function formatInfo() {
103+
var inputFileFormat = document.getElementById("fileformatSelect").value;
104+
if (inputFileFormat == "cif") {
105+
document.getElementById("cifImportantInfo").style.display="block";
106+
document.getElementById("infoImportantInfo").style.display="none";
107+
} else if (inputFileFormat == "info") {
108+
document.getElementById("cifImportantInfo").style.display="none";
109+
document.getElementById("infoImportantInfo").style.display="block";
110+
} else {
111+
document.getElementById("cifImportantInfo").style.display="none";
112+
document.getElementById("infoImportantInfo").style.display="none";
113+
}
114+
}
115+
</script>

cell2mol/.docker/Dockerfile

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)