Skip to content

Commit

Permalink
fix(acpype | prodrg): usage of box_distance and ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopr committed May 22, 2023
1 parent 1478e2c commit 97cb69f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "next build",
"vercel-build": "prisma generate && next build",
"dev": "next dev",
"dev": "next dev -p 3001",
"lint": "next lint",
"start": "next start -p 3001",
"prettier": "prettier --write --ignore-unknown .",
Expand Down
5 changes: 3 additions & 2 deletions apps/server/server/resources/generate/acpype.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def post(self):
commands = [
"#topology\n",
f"grep 'ATOM ' {filename}{ext} > Protein.pdb\n",
f'{gmx} pdb2gmx -f "Protein.pdb" -o "{filename}_livre.pdb" -p "{filename}_livre.top" -ff {args["force_field"]} -water {args["water_model"]} -ignh -missing\n\n',
f'{gmx} pdb2gmx -f "Protein.pdb" -o "{filename}_livre.pdb" -p "{filename}_livre.top" -ff {args["force_field"]} -water {args["water_model"]} {"-ignh -missing" if args["ignore"] else ""}\n\n',
"#break\n",
f'grep -h ATOM "{filename}_livre.pdb" "{filename_gro}{ext_gro}" | tee "{filename}_complx.pdb" > /dev/null\n',
f"cat {filename_itp}{ext_itp} | sed -n '/atomtypes/,/^ *$/{{/\n\n/d;p}}' > ligand_atomtypes.txt".encode(
Expand All @@ -93,7 +93,8 @@ def post(self):
f'\ncat {filename}_livre.top | sed \'/forcefield\.itp"/a\#include "{filename_itp}{ext_itp}"\' > {filename}1_complx.top\n',
f"cat {filename}1_complx.top | sed '/forcefield\.itp/r ligand_atomtypes.txt' > {filename}_complx.top\n",
f'echo "{acpype_molecule_type} 1" >> {filename}_complx.top\n\n',
f'{gmx} editconf -f "{filename}_complx.pdb" -c -d 1 -bt {args["box_type"]} -o "{filename}_complx.pdb"\n\n',
# Procceed with gmx commands
f'{gmx} editconf -f "{filename}_complx.pdb" -c -d {args["box_distance"]} -bt {args["box_type"]} -o "{filename}_complx.pdb"\n\n',
"#solvate\n",
f'{gmx} solvate -cp "{filename}_complx.pdb" -cs spc216.gro -p "{filename}_complx.top" -o "{filename}_complx_box.pdb"\n\n',
"#ions\n",
Expand Down
4 changes: 2 additions & 2 deletions apps/server/server/resources/generate/prodrg.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def post(self):
commands = [
"#topology\n",
f"grep 'ATOM ' \"{filename}{ext}\" > Protein.pdb\n",
f'{gmx} pdb2gmx -f "Protein.pdb" -o "{filename}_livre.gro" -p "{filename}_livre.top" -ff gromos53a6 -water {args["water_model"]} -ignh -missing\n\n',
f'{gmx} pdb2gmx -f "Protein.pdb" -o "{filename}_livre.gro" -p "{filename}_livre.top" -ff {args["force_field"]} -water {args["water_model"]} {"-ignh -missing" if args["ignore"] else ""}\n\n',
"#break\n",
# Make a copy of _livre.top to _complx.top
f'cp "{filename}_livre.top" "{filename}_complx.top"\n',
Expand All @@ -95,7 +95,7 @@ def post(self):
# Doing .gro needed modifications
f'IFS="" file_gro=$(cat "{filename_gro}{ext_gro}"); value_gro=$(echo ${{file_gro}} | awk \'NR==2{{print $1}}\'); file_gro=$(echo "${{file_gro}}" | awk \'NR>=3{{print}}\'); dir_lgro=$(echo {filename}_livre.gro); dir_complx_gro=$(echo {filename}_complx.gro); IFS="" file_lgro=$(cat ${{dir_lgro}}); last_line=$(echo "${{file_lgro}}" | tail -1); file_lgro=$(echo "${{file_lgro}}" | head -n -1); echo -n "" > $dir_complx_gro; echo "${{file_lgro}}" >> ${{dir_complx_gro}}; echo "${{file_gro}}" >> ${{dir_complx_gro}}; echo "${{last_line}}" >> ${{dir_complx_gro}}; file_complx_gro=$(cat ${{dir_complx_gro}}); value_complx_gro=$(echo ${{file_complx_gro}} | awk \'NR==2{{print $1}}\'); total=$(expr ${{value_gro}} + ${{value_complx_gro}}); echo "${{file_complx_gro}}" | awk -v var=${{total}} \'NR==2 {{$1=sprintf("%5d", var)}} {{print}}\' > ${{dir_complx_gro}}\n',
# Proceed with the GMX commands
f'{gmx} editconf -f "{filename}_complx.gro" -c -d 1 -bt {args["box_type"]} -o "{filename}_complx.gro"\n',
f'{gmx} editconf -f "{filename}_complx.gro" -c -d {args["box_distance"]} -bt {args["box_type"]} -o "{filename}_complx.gro"\n',
"#solvate\n",
f'{gmx} solvate -cp "{filename}_complx.gro" -cs spc216.gro -p "{filename}_complx.top" -o "{filename}_complx_box.gro"\n\n',
"#ions\n",
Expand Down
3 changes: 3 additions & 0 deletions docs/deploying.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Deploying

Visual Dynamics is deployable by a combination of Docker containers and PM2

0 comments on commit 97cb69f

Please sign in to comment.