Skip to content

Commit 8f5a130

Browse files
committed
Merge branch 'master'
2 parents 24f699f + a780ea8 commit 8f5a130

File tree

8 files changed

+50
-26
lines changed

8 files changed

+50
-26
lines changed

docs/changelog.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ Changelog
44

55
**Legend**: :fa:`star,text-success` New feature, :fa:`plus-square,text-primary` Improvement, :fa:`bug,text-danger` Bug fix
66

7+
v0.6.5 (4/6/2024)
8+
******************
9+
10+
:fa:`plus-square,text-primary` Update format of logger messages to more clearly show the nextPYP version and resources assigned to each job.
11+
12+
:fa:`plus-square,text-primary` Use same tilt-axis angle convention for aligning tilt-series using IMOD and AreTomo2.
13+
14+
:fa:`bug,text-danger` Prevent error during tilt-series alignment with AreTomo2 when number of patches = 1.
15+
16+
:fa:`bug,text-danger` Fix bug in command line interface that ocurred when launching constrained refinement.
17+
18+
:fa:`bug,text-danger` Fix bug that was causing the server startup routines to be called during the CLI processing of the configuration file.
19+
20+
:fa:`bug,text-danger` Fix bug that ocurred when retrieving metadata from mdoc files.
21+
22+
:fa:`bug,text-danger` Fix bug when trying to retrieve tilt-series metadata from failed runs.
23+
24+
:fa:`bug,text-danger` Fix conflicts with library paths when running external executables.
25+
726
v0.6.4 (3/24/2024)
827
******************
928

nextpyp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# It is shown directly to the user in micromon's user interface.
44
# To the extent that is feasible, it should follow Semantic Versioning conventions:
55
# https://semver.org/
6-
version = "0.6.4"
6+
version = "0.6.5"

src/pyp/align/core.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4176,7 +4176,7 @@ def align_movie_super(parameters, name, suffix, isfirst = False):
41764176
# patch tracking
41774177
patches_x = parameters["movie_motioncor_patch_x"] if "movie_motioncor_patch_x" in parameters else 1
41784178
patches_y = parameters["movie_motioncor_patch_y"] if "movie_motioncor_patch_y" in parameters else 1
4179-
if patches_x > 1 or patches_y > 0:
4179+
if patches_x + patches_y > 2:
41804180
patches = f" -Patch {parameters['movie_motioncor_patch_x']} {parameters['movie_motioncor_patch_y']}"
41814181
if parameters.get("movie_motioncor_patch_overlap"):
41824182
patches += f" {parameters['movie_motioncor_patch_overlap']}"
@@ -5021,8 +5021,11 @@ def align_tilt_series(name, parameters, rotation=0):
50215021
tilt_offset_option = "1" if parameters['tomo_ali_aretomo_measure_tiltoff'] else f"1 {parameters['tomo_ali_aretomo_tiltoff']}"
50225022

50235023
# local motion by giving the number of patches
5024-
if parameters.get("tomo_ali_patches_x") and parameters.get("tomo_ali_patches_y"):
5025-
patches = f" -Patch {parameters['tomo_ali_patches_x']} {parameters['tomo_ali_patches_y']}"
5024+
# patch tracking
5025+
patches_x = parameters["tomo_ali_patches_x"] if "tomo_ali_patches_x" in parameters else 1
5026+
patches_y = parameters["tomo_ali_patches_y"] if "tomo_ali_patches_y" in parameters else 1
5027+
if patches_x + patches_y > 2:
5028+
patches = f" -Patch {patches_x} {patches_y}"
50265029
else:
50275030
patches = ""
50285031

@@ -5193,7 +5196,7 @@ def align_tilt_series(name, parameters, rotation=0):
51935196
-AngFile {name}.rawtlt \
51945197
-VolZ {thickness} \
51955198
-OutBin {binning_tomo} \
5196-
-TiltAxis {parameters['scope_tilt_axis']} \
5199+
-TiltAxis {rotation} \
51975200
-DarkTol {parameters['tomo_ali_aretomo_dark_tol']} \
51985201
-AlignZ {specimen_thickness} \
51995202
{reconstruct_option} \

src/pyp/preprocess/core.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,22 @@ def read_tilt_series(
142142
aligned_tilts = []
143143

144144
data_path = Path(resolve_path(parameters["data_path"])).parent
145-
mdoc_path = Path(resolve_path(parameters["data_path_mdoc"])).parent if "data_path_mdoc" in parameters else Path()
145+
mdoc_path = Path(resolve_path(parameters["data_path_mdoc"])).parent if "data_path_mdoc" in parameters and parameters["data_path_mdoc"] != None else None
146146
project_raw_path = Path(filename).parent
147147

148148
name = os.path.basename(filename)
149-
mdocs = list(mdoc_path.glob(f"{name}.mdoc")) + list(mdoc_path.glob(f"{name}.mrc.mdoc"))
149+
mdoc_pattern = "*.mdoc"
150+
151+
mdocs = []
152+
if mdoc_path is not None:
153+
mdoc_pattern = Path(resolve_path(parameters["data_path_mdoc"])).name
154+
mdocs = list(mdoc_path.glob(str(mdoc_pattern)))
155+
mdocs = [str(file) for file in mdocs if str(file.name).replace(".mrc", "").replace(".mdoc", "") == name]
156+
150157
if len(mdocs) == 0:
151158
# get the mdoc files from the path of raw data if it couldn't find them in mdoc path
152-
mdocs = list(data_path.glob(f"{name}.mdoc")) + list(mdoc_path.glob(f"{name}.mrc.mdoc"))
159+
mdocs = list(data_path.glob(mdoc_pattern))
160+
mdocs = [str(file) for file in mdocs if str(file.name).replace(".mrc", "").replace(".mdoc", "") == name]
153161

154162
# escape special character in case it contains [
155163
filename = glob.escape(filename)
@@ -610,7 +618,7 @@ def read_tilt_series(
610618
if metadata.get("drift"):
611619
for i in metadata["drift"]:
612620
drift_metadata["drift"][i] = metadata["drift"][i].to_numpy()[:,-2:]
613-
elif metadata.get("web").get("drift"):
621+
elif metadata.get("web") and metadata.get("web").get("drift"):
614622
for i in metadata.get("web")["drift"]:
615623
drift_metadata["drift"][i] = metadata.get("web")["drift"][i]
616624
else:

src/pyp/streampyp/jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def submit_commands(
129129
cmdlist.append(
130130
"export csp_local_merge=csp_local_merge; {0} --stacks_files stacks.txt --par_files pars.txt --ordering_file ordering.txt --project_path_file project_dir.txt --output_basename $OUTPUT_BASENAME --path '{1}/$OUTPUT_BASENAME'\n".format(
131131
run_pyp(command="pyp", script=True, cpus=threads),
132-
Path(get_pyp_configuration()["pyp"]["scratch"]),
132+
Path(os.environ["PYP_SCRATCH"]),
133133
),
134134
)
135135

src/pyp/system/project_params.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,16 @@ def create_micrographs_list(parameters):
249249

250250
# look for mdoc files in mdoc folder
251251
mdocs = list()
252-
if "data_path_mdoc" in parameters and parameters["data_path_mdoc"] != None and Path(resolve_path(parameters["data_path_mdoc"])).exists:
253-
mdoc_folder = Path(resolve_path(parameters["data_path_mdoc"])).parent
254-
mdocs = list(mdoc_folder.glob("*.mdoc"))
252+
mdoc_pattern = "*.mdoc"
253+
if "data_path_mdoc" in parameters and parameters["data_path_mdoc"] != None:
254+
mdoc_folder = parameters["data_path_mdoc"].parent
255+
mdoc_pattern = parameters["data_path_mdoc"].name
256+
mdocs = list(mdoc_folder.glob(str(mdoc_pattern)))
255257
# if none found, look in raw data folder
256258
if len(mdocs) == 0:
257259
data_path = Path(resolve_path(parameters["data_path"]))
258260
data_folder = data_path.parent
259-
mdocs = list(data_folder.glob("*.mdoc"))
261+
mdocs = list(data_folder.glob(mdoc_pattern))
260262

261263
if parameters["data_mode"] == "tomo":
262264
if not parameters["movie_mdoc"] and len(parameters["movie_pattern"]) > 0 and len(glob.glob("raw/*" + movie_extension)) > 0:

src/pyp/system/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def phenix_load_command():
4444
def get_slurm_path():
4545
return "/opt/slurm/bin/"
4646

47-
4847
def get_imod_path():
49-
return "/opt/IMOD".format(os.environ["PYP_DIR"])
48+
return "/opt/IMOD"
49+
# return "export LD_LIBRARY_PATH=/opt/IMOD/qtlib:/opt/IMOD/lib:$LD_LIBRARY_PATH /opt/IMOD"
5050

5151
def cuda_path_prefix(command):
5252
config = get_pyp_configuration()

src/pyp_main.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ def tomo_swarm(project_path, filename, debug = False, keep = False, skip = False
13351335
os.chdir(project_path)
13361336

13371337
parameters = project_params.load_pyp_parameters()
1338-
1338+
13391339
# get file name
13401340
name = os.path.basename(filename)
13411341

@@ -3230,9 +3230,7 @@ def clear_scratch(scratch,timeout=60):
32303230
)
32313231
else:
32323232
logger.info(
3233-
"Job {} (v{}) launching on {} using {} task(s) {}".format(
3234-
jobid, version, socket.gethostname(), mpi_tasks, memory
3235-
)
3233+
f"nextPYP v{version} launching job {jobid} on {socket.gethostname()} using {mpi_tasks} task(s) {memory}"
32363234
)
32373235

32383236
config = get_pyp_configuration()
@@ -3269,12 +3267,6 @@ def clear_scratch(scratch,timeout=60):
32693267
# TODO: switch to pyp.system.utils.get_imod_path()
32703268
os.environ["IMAGICDIR"] = "/usr/bin"
32713269
os.environ["IMOD_DIR"] = get_imod_path()
3272-
if "LD_LIBRARY_PATH" in os.environ:
3273-
os.environ["LD_LIBRARY_PATH"] = "{0}/qtlib:{0}/lib:{1}".format(
3274-
get_imod_path(), os.environ["LD_LIBRARY_PATH"]
3275-
)
3276-
else:
3277-
os.environ["LD_LIBRARY_PATH"] = "{0}/qtlib:{0}/lib".format(get_imod_path())
32783270

32793271
os.environ["LD_LIBRARY_PATH"] = "{0}:{1}".format(
32803272
os.environ["LD_LIBRARY_PATH"], '/usr/local/pkgs/fftw-3.3.10-nompi_hf0379b8_106/lib/'

0 commit comments

Comments
 (0)