Commit b6030c5c authored by Jorge Navarro Muñoz's avatar Jorge Navarro Muñoz

Small bugfix + prepare for Docker update

- Fixes #1 (thanks @suare012!)
- Updates dockerfiles
- Adds environment.yml for easier conda installation
parent c1003168
......@@ -2,32 +2,31 @@ FROM conda/miniconda3
RUN apt-get update && apt-get install -y git wget
RUN conda create --name bigscape
#RUN source activate bigscape
RUN [ "/bin/bash", "-c","source activate bigscape"]
RUN conda install -y \
numpy \
scipy \
scikit-learn
RUN conda install -c bioconda hmmer biopython fasttree
RUN conda install -c anaconda networkx
SHELL ["/bin/bash", "-c"]
WORKDIR /usr/src
## Cloning BiG-SCAPE
RUN git clone https://git.wur.nl/medema-group/BiG-SCAPE.git
## geting Pfam
RUN wget ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam31.0/Pfam-A.hmm.gz
#ftp://ftp.ebi.ac.uk/pub/databases/Pfam/current_release/Pfam-A.hmm.gz.
RUN gunzip Pfam-A.hmm.gz && hmmpress Pfam-A.hmm && mv Pfam-A.* /usr/src/BiG-SCAPE/.
# Cloning BiG-SCAPE
RUN git clone https://git.wur.nl/medema-group/BiG-SCAPE.git
RUN chmod +x /usr/src/BiG-SCAPE/*py
RUN chmod 777 /home
# Create conda environment
RUN conda env create -f /usr/src/BiG-SCAPE/environment.yml
RUN echo "source activate bigscape" > ~/.bashrc
ENV PATH /usr/local/envs/bigscape/bin:$PATH
ENV PATH /usr/src/BiG-SCAPE:$PATH
RUN cd BiG-SCAPE \
&& wget ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam32.0/Pfam-A.hmm.gz \
&& gunzip Pfam-A.hmm.gz \
&& source activate bigscape \
&& hmmpress Pfam-A.hmm \
&& chmod +x /usr/src/BiG-SCAPE/*py \
&& chmod a+w /usr/src/BiG-SCAPE/domains_color_file.tsv \
&& chmod 777 /home
USER 1000:1000
RUN mkdir /home/input /home/output
WORKDIR /home
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENTRYPOINT ["bigscape.py"]
CMD ["--help"]
......@@ -1922,7 +1922,7 @@ def clusterJsonBatch(bgcs, pathBase, className, matrix, pos_alignments, cutoffs=
with open(os.path.join(module_html_path, "bs_data.js"), "w") as bs_data_js:
bs_data_js.write("var bs_data={};\n".format(json.dumps(bs_data, indent=4, separators=(',', ':'), sort_keys=True)))
bs_data_js.write("dataLoaded('bs_data');\n")
shutil.copy(os.path.join(os.path.realpath(os.path.dirname(__file__)), "html_template", "index_html"), os.path.join(module_html_path, "index.html"))
shutil.copy(os.path.join(os.path.dirname(os.path.realpath(__file__)), "html_template", "index_html"), os.path.join(module_html_path, "index.html"))
## Write bgc_networks.js
with open(os.path.join(module_html_path, "bs_networks.js"), "w") as bs_networks_js:
......@@ -2101,7 +2101,7 @@ def CMD_parser():
domain_whitelist.txt file", default=False,
action="store_true")
parser.add_argument("--version", action="version", version="%(prog)s 20190604")
parser.add_argument("--version", action="version", version="%(prog)s 20191011")
return parser.parse_args()
......@@ -2846,7 +2846,7 @@ if __name__=="__main__":
create_directory(network_files_folder, "Network Files", False)
# copy html templates
dir_util.copy_tree(os.path.join(os.path.realpath(os.path.dirname(__file__)), "html_template", "output"), output_folder)
dir_util.copy_tree(os.path.join(os.path.dirname(os.path.realpath(__file__)), "html_template", "output"), output_folder)
# make a new run folder in the html output & copy the overview_html
network_html_folder = os.path.join(output_folder, "html_content", "networks", run_name)
......@@ -2855,7 +2855,7 @@ if __name__=="__main__":
for cutoff in cutoff_list:
network_html_folder_cutoff = "{}_c{:.2f}".format(network_html_folder, cutoff)
create_directory(network_html_folder_cutoff, "Network HTML Files", False)
shutil.copy(os.path.join(os.path.realpath(os.path.dirname(__file__)), "html_template", "overview_html"), os.path.join(network_html_folder_cutoff, "overview.html"))
shutil.copy(os.path.join(os.path.dirname(os.path.realpath(__file__)), "html_template", "overview_html"), os.path.join(network_html_folder_cutoff, "overview.html"))
rundata_networks_per_run[network_html_folder_cutoff] = []
html_subs_per_run[network_html_folder_cutoff] = []
......
name: bigscape
channels:
- bioconda
dependencies:
- python=3.6
- hmmer
- biopython
- fasttree
- numpy
- scipy
- networkx
- scikit-learn=0.19.1
......@@ -5,8 +5,8 @@ if [[ $# -eq 0 || $1 == "-h" || $1 == "--help" ]]; then
--detach=false \
--rm \
--user=$(id -u):$(id -g) \
docker-registry.wur.nl/medema-group/big-scape \
$@
docker-registry.wur.nl/medema-group/big-scape:20191010 \
$@
else
set -o errexit
set -o nounset
......@@ -44,14 +44,14 @@ else
#if [ ${INPUT_FILE} ${OUTPUT_FILE} ]; then
if [ ! -z ${INPUT_FILE} ] && [ ! -z ${OUTPUT_FILE} ]; then
echo bigscape is running now
echo Running BiG-SCAPE
docker run \
--volume ${INPUT_DIR}:${CONTAINER_SRC_DIR}:ro \
--volume ${OUTPUT_DIR}:${CONTAINER_DST_DIR}:rw \
--detach=false \
--rm \
--user=$(id -u):$(id -g) \
docker-registry.wur.nl/medema-group/big-scape\
docker-registry.wur.nl/medema-group/big-scape:20191010 \
-i ${CONTAINER_SRC_DIR}/${INPUT_FILE} \
-o ${CONTAINER_DST_DIR}/${OUTPUT_FILE}\
$@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment