Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ glucosepane/
logs/
homosapiens*
homo_sapiens*/
.DS_Store
*.o
contact_map
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"numpy==1.25",
"vermouth==0.9.1",
"numpy>=1.26",
"vermouth==0.9.6",
"pandas==2.2.2",
"biopython==1.84",
"scikit-learn",
Expand Down
11 changes: 5 additions & 6 deletions src/colbuilder/colbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No
ctx.exit()


from colbuilder.core.sequence.main_sequence import build_sequence
from colbuilder.core.geometry.main_geometry import build_geometry_anywhere
from colbuilder.core.topology.main_topology import build_topology


def configure_loggers():
"""Configure external loggers to prevent duplicated output."""
problematic_loggers = [
Expand Down Expand Up @@ -203,6 +198,7 @@ async def run_sequence_generation(config: ColbuilderConfig) -> Tuple[Optional[Pa
"""
try:
LOG.subsection("Generating Sequence")
from colbuilder.core.sequence.main_sequence import build_sequence
return await build_sequence(config)
except Exception as e:
LOG.error(f"Sequence generation failed: {str(e)}")
Expand Down Expand Up @@ -234,6 +230,7 @@ async def run_geometry_generation(
"""
try:
LOG.subsection("Building Geometry or Mixing")
from colbuilder.core.geometry.main_geometry import build_geometry_anywhere

current_file_manager = file_manager or FileManager(config)

Expand Down Expand Up @@ -324,6 +321,8 @@ async def run_topology_generation(
TopologyGenerationError: If topology generation fails
"""
try:
from colbuilder.core.topology.main_topology import build_topology

if file_manager is None:
file_manager = FileManager(config)

Expand Down Expand Up @@ -1157,4 +1156,4 @@ def main(**kwargs: Any) -> int:


if __name__ == "__main__":
sys.exit(main())
sys.exit(main())
9 changes: 8 additions & 1 deletion src/colbuilder/core/topology/amber.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import os
import re
import shutil
from pathlib import Path
import asyncio
Expand Down Expand Up @@ -902,14 +903,20 @@ def write_itp(

output_file = itp_file.parent / str(itp_file.name).replace("top", "itp")

# pdb2gmx -merge all writes a single moleculetype. Older GROMACS
# versions name it "Protein_chain_A"; newer versions (>=2023) write
# just "Protein". Match either so the topology body is copied
# regardless of GROMACS version.
molname_re = re.compile(r'^\s*Protein(?:_chain_\w+)?\s+\d+\s*$')

with open(output_file, 'w') as f:
write = False
for line in itp_model:
if 'Include water topology' in line:
break
if write:
f.write(line)
elif 'Protein_chain_A' in line:
elif molname_re.match(line):
f.write('[ moleculetype ]\n')
f.write(f'{molecule_name} 3\n')
write = True
Expand Down
Loading