1- RED = \033[0;31m
2- GREEN = \033[0;32m
3- YELLOW = \033[0;33m
4- BLUE = \033[0;34m
5- RESET = \033[0m
6- # ---------------------------------------------------------------------
1+ BASE_MK := $(shell echo $(PWD ) | sed -E 's|(.* example) .*|\1/base.mk|')
72
8- IMAGE = ghcr.io/lbt-cnrs/biospring
9- PDB2SPN = pdb2spn
10- BIOSPRING = biospring
11- MARTINIZE = martinize2
3+ # Inclure base.mk si trouvé
4+ ifneq ($(wildcard $(BASE_MK ) ) ,)
5+ include $(BASE_MK )
6+ # $(info Included: $(BASE_MK))
7+ endif
128
13- BS_DATA_DIR = /biospring/share/biospring/data
14- FORCEFIELD_DIR = $(BS_DATA_DIR ) /martini/forcefield
15- REDUCERULES_DIR = $(BS_DATA_DIR ) /martini/reducerules
16-
17- # PDB2SPN INPUTS
18- FF = $(FORCEFIELD_DIR ) /martini_octanol.ff
19- GRP = $(REDUCERULES_DIR ) /martini.grp
9+ # RAW PDB INPUT
2010RAW_PDB = ../model_in_membrane.pdb
2111
22- # PDB2SPN OUTPUTS
23- CDL = model.cdl
24- PDB = model.pdb
25- NC = model.nc # USED AS BIOSPRING INPUT
26-
27- # BIOSPRING INPUT PARAMETERS
28- MSP = param.msp
29-
30- # MARTINIZE TOOL
31- # INPUT: model_in_membrane.pdb (1BXW.pdb positioned in the membrane)
32- # OUTPUT: pdb2spn_input_cg.pdb (PDB2SPN INPUT)
33- martinize :
34- @echo " Copy PDB input for Martinize"
35- cp $(RAW_PDB ) .
36- @echo " Run Martinize"
37- docker run --rm -v $(PWD ) :/data $(IMAGE ) \
38- $(MARTINIZE) -f model_in_membrane.pdb \
39- -x pdb2spn_input_cg.pdb \
40- -ff martini30b32 \
41- -resid input \
42- -ignh
43- rm $(notdir $(RAW_PDB))
44-
45- # PDB2SPN TOOL
46- # INPUT: pdb2spn_input_cg.pdb (Martinize output, CG PDB file)
47- # OUTPUT:
48- # - model.cdl: Readable NetCDF file of the structure, used to verify the
49- # structure informations
50- #
51- # - model.nc: Binary NetCDF file of the structure, used as BIOSPRING input
52- # and as input structure for visualization tools like UnityMol
53- # (in "BioSpring" version of UnityMol - March 2025)
54- #
55- # - model.pdb: PDB file of the structure, used as input structure for
56- # visualization tools (like UnityMol or VMD) and to determine the
57- # insertion vector particle pair (see doc/MSP_Options.md)
58- pdb2spn :
59- @echo " Run pdb2spn"
60- docker run --rm --init -v $(PWD ) :/data $(IMAGE ) \
61- $(PDB2SPN ) -s pdb2spn_input_cg.pdb \
62- -o ${CDL} ${NC} $(PDB ) \
63- --ff $(FF ) \
64- --grp $(GRP ) \
65- --cutoff 5.0 \
66- --stiffness 30.0
67-
68-
69- clean :
70- rm -f \# * #
71- rm -f pdb2spn_input_cg.pdb
72- rm -f model.cdl model.nc model.pdb
73-
74- pause :
75- @read -p " Press enter to continue..." key
76-
77- # Run the docker image in interactive mode if you need to run the tools manually
78- interactive :
79- docker run --rm -it -v $(PWD ) :/data $(IMAGE )
12+ # PDB2SPN INPUTS
13+ FF = $(BS_DATA_DIR ) /martini/forcefield/martini_octanol.ff
14+ GRP = $(BS_DATA_DIR ) /martini/reducerules/martini.grp
15+ CUTOFF = 5.0
16+ STIFFNESS = 30.0
8017
8118# Prepare the input files for the simulation
8219prep : martinize pause pdb2spn
8320
84- # Run the BioSpring simulation
85- # NOTE: The option --sasa-classifier biospring is important to use IMPALA
86- # to at least compute once the particles surface areas. Otherwire you'll
87- # have a warning message like "!! WARNING: freesasa_classifier_radius:
88- # radius not found fo res: ARG name: RBB"
89- #
90- # NOTE2: By launching biospring, all the parameters used are displayed in the
91- # terminal. You can modify the parameters in the MSP file as you wish
92- # and restart biospring or tune certain parameters from UnityMol during
93- # an interactive simulation (for example IMPALA scale or Input Force, or
94- # even viscosity).
95- run :
96- @echo " Run BioSpring"
97- docker run --network host --rm --init -v $(PWD ) :/data $(IMAGE ) \
98- $(BIOSPRING ) -s $(NC ) \
99- -c $(MSP ) \
100- --wait --port 3000 \
101- --sasa-classifier biospring
102-
103- expose_data :
104- @echo " Host machine: $( GREEN) $( shell hostname) $( RESET) "
105- @echo " On the client side, you can retrive the data with the following command:"
106- @echo " \n $( GREEN) make get_data HOSTNAME=$( shell hostname) $( RESET) \n"
107- @docker run --network host --rm --init -v $(PWD ) :/data $(IMAGE ) python -m http.server 4000 --directory /data
108-
109- get_data :
110- @if [ -z " $( HOSTNAME) " ]; then \
111- echo " $( RED) Usage: make get_data HOSTNAME=<hostname>$( RESET) " ; \
112- exit 1; \
113- fi
114-
115- @echo "$(GREEN)Retrieving data from http://$(HOSTNAME):4000/model.* ...$(RESET)"
116- @wget -q -r -np -nH --accept-regex='model.*' http://$(HOSTNAME):4000/
117- @rm index.html
118-
21+ # ------------------------------------------------------------------------------
22+ # Usage: run the command make usage
23+ # ------------------------------------------------------------------------------
0 commit comments