Skip to content
Closed
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: 2 additions & 1 deletion openfold3/core/data/pipelines/preprocessing/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""Preprocessing pipelines for template data ran before training/evaluation."""

import getpass
import logging
import multiprocessing as mp
import os
Expand Down Expand Up @@ -1602,7 +1603,7 @@ def _prepare_output_directories(self) -> "TemplatePreprocessorSettings":
)

self.output_directory = (
self.output_directory or Path(tempfile.gettempdir()) / "of3_template_data"
self.output_directory or Path(tempfile.gettempdir()) / f"of3-{getpass.getuser()}" / "template_data"
)
base = self.output_directory

Expand Down
3 changes: 2 additions & 1 deletion openfold3/core/data/tools/colabfold_msa_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import getpass
import json
import logging
import os
Expand Down Expand Up @@ -997,7 +998,7 @@ class MsaComputationSettings(BaseModel):
server_user_agent: str = "openfold"
server_url: Url = Url("https://api.colabfold.com")
save_mappings: bool = True
msa_output_directory: Path = Path(tempfile.gettempdir()) / "of3_colabfold_msas"
msa_output_directory: Path = Path(tempfile.gettempdir()) / f"of3-{getpass.getuser()}" / "colabfold_msas"
cleanup_msa_dir: bool = True

@model_validator(mode="after")
Expand Down
7 changes: 6 additions & 1 deletion openfold3/core/data/tools/jackhmmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@

"""Library to run Jackhmmer from Python."""

import getpass
import glob
import logging
import os
import subprocess
import tempfile
from collections.abc import Callable, Mapping, Sequence
from pathlib import Path
from concurrent import futures
from typing import Any
from urllib import request
Expand Down Expand Up @@ -203,7 +206,9 @@ def db_remote_chunk(db_idx):
return f"{self.database_path}.{db_idx}"

def db_local_chunk(db_idx):
return f"/tmp/ramdisk/{db_basename}.{db_idx}"
ramdisk_dir = Path(tempfile.gettempdir()) / f"of3-{getpass.getuser()}" / "ramdisk"
ramdisk_dir.mkdir(parents=True, exist_ok=True)
return str(ramdisk_dir / f"{db_basename}.{db_idx}")

# Remove existing files to prevent OOM
for f in glob.glob(db_local_chunk("[0-9]*")):
Expand Down