Skip to content
Merged
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
4 changes: 3 additions & 1 deletion src/murfey/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,9 @@ def _register_bfactors(message: dict, _db=murfey_db, demo: bool = False):

if message["symmetry"] != relion_params.symmetry:
# Currently don't do anything with a symmetrised re-run of the refinement
logger.info(f"Recieved symmetrised structure of {message['symmetry']}")
logger.info(
f"Received symmetrised structure of {sanitise(message['symmetry'])}"
)
return True

if not feedback_params.hold_refine:
Expand Down
21 changes: 12 additions & 9 deletions src/murfey/server/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
MillingParameters,
PostInfo,
PreprocessingParametersTomo,
ProcessFile,
ProcessingJobParameters,
ProcessingParametersSPA,
ProcessingParametersTomo,
Expand All @@ -104,6 +103,7 @@
TiltInfo,
TiltSeriesGroupInfo,
TiltSeriesInfo,
TomoProcessFile,
Visit,
)
from murfey.util.processing_params import default_spa_parameters
Expand Down Expand Up @@ -1210,7 +1210,10 @@ async def request_spa_preprocessing(

@router.post("/visits/{visit_name}/{session_id}/tomography_preprocess")
async def request_tomography_preprocessing(
visit_name: str, session_id: MurfeySessionID, proc_file: ProcessFile, db=murfey_db
visit_name: str,
session_id: MurfeySessionID,
proc_file: TomoProcessFile,
db=murfey_db,
):
instrument_name = (
db.exec(select(Session).where(Session.id == session_id)).one().instrument_name
Expand Down Expand Up @@ -1260,15 +1263,15 @@ async def request_tomography_preprocessing(
if not mrc_out.parent.exists():
mrc_out.parent.mkdir(parents=True, exist_ok=True)

processing_job_parameters = db.exec(
select(TomographyProcessingParameters).where(
TomographyProcessingParameters.pj_id == data_collection[0][2].id
session_processing_parameters = db.exec(
select(SessionProcessingParameters).where(
SessionProcessingParameters.session_id == session_id
)
).all()
if processing_job_parameters:
proc_file.gain_ref = processing_job_parameters[0].gain_ref
proc_file.dose_per_frame = processing_job_parameters[0].dose_per_frame
proc_file.eer_fractionation_file = processing_job_parameters[
if session_processing_parameters:
proc_file.gain_ref = session_processing_parameters[0].gain_ref
proc_file.dose_per_frame = session_processing_parameters[0].dose_per_frame
proc_file.eer_fractionation_file = session_processing_parameters[
0
].eer_fractionation_file

Expand Down
4 changes: 2 additions & 2 deletions src/murfey/server/demo_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
GridSquareParameters,
PostInfo,
PreprocessingParametersTomo,
ProcessFile,
ProcessingJobParameters,
ProcessingParametersSPA,
ProcessingParametersTomo,
Expand All @@ -86,6 +85,7 @@
TiltInfo,
TiltSeriesGroupInfo,
TiltSeriesInfo,
TomoProcessFile,
Visit,
)
from murfey.util.processing_params import default_spa_parameters
Expand Down Expand Up @@ -1196,7 +1196,7 @@ def flush_tomography_processing(

@router.post("/visits/{visit_name}/{client_id}/tomography_preprocess")
async def request_tomography_preprocessing(
visit_name: str, client_id: int, proc_file: ProcessFile, db=murfey_db
visit_name: str, client_id: int, proc_file: TomoProcessFile, db=murfey_db
):
if not sanitise_path(Path(proc_file.path)).exists():
log.warning(
Expand Down
6 changes: 3 additions & 3 deletions src/murfey/util/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,13 @@ class Token(BaseModel):
"""


class ProcessFile(BaseModel): # Rename to TomoProcessFile
class TomoProcessFile(BaseModel):
path: str
description: str
tag: str
image_number: int
pixel_size: float
dose_per_frame: float
dose_per_frame: Optional[float]
frame_count: int
tilt_axis: Optional[float]
mc_uuid: Optional[int] = None
Expand Down Expand Up @@ -350,7 +350,7 @@ class CompletedTiltSeries(BaseModel):


class PreprocessingParametersTomo(BaseModel):
dose_per_frame: float
dose_per_frame: Optional[float]
frame_count: int
tilt_axis: float
gain_ref: Optional[str]
Expand Down