Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.0 beamshiftnaming #94

Open
wants to merge 20 commits into
base: 0.4.0-beam-shift
Choose a base branch
from
Open

Conversation

elainehoml
Copy link
Contributor

@elainehoml elainehoml commented Apr 6, 2023

Deprecating old files

  • Deprecated lots of old files which are no longer used, including the demo dataset which is not used in testing anymore

Mdocs renaming

  • Arbitrary micrograph names are renamed to a common convention using mdocs metadata using utils.rename.
  • The new filenaming convention is <proj-name>_<tomogram-number>_<tilt-number>_<tilt-angle>.<ext>. This makes the filenaming system compatible with Warp.
  • There is now the option to update the dates in the mdocs to yy-mmm-dd rather than dd-mmm-yyyy to follow the Warp convention.

MagicGUI

  • Experimental way of getting processes to run through pressing the MagicGUI callback button rather than exiting the GUI. This means that users can cancel the process by exiting the GUI, which is useful for o2r.previewer where the processing happens straight after parameter collection rather than having a separate run step.
  • Original function can still be called with regular arguments programmatically even if the magicgui is not used.
  • Applied to utils.rename.rename_all and previewer.run_previewer.
  • This is done by using a magicgui decorator before the function that does the work, e.g., in utils.rename.rename_all:
@magicgui(
    call_button="Rename files",
    layout="vertical",
    mdocs_directory={
        "widget_type": "FileEdit",
        "label": "Directory where mdocs are stored*",
        "mode": "d",
    },
    micrograph_directory={
        "widget_type": "FileEdit",
        "label": "Directory where raw micrographs are stored*",
        "mode": "d",
    },
    update_dates_for_warp={"label": "Convert mdoc dates to yy-mmm-dd for Warp?"},
    message={
        "widget_type": "Label",
        "label": """
        Renames micrographs and creates new mdocs based on the file naming convention
        <project_name>_<tomogram_number>_<tilt_number>_<tilt_angle>.<ext>
        where each unique mdoc gets its own tomogram number starting from 001.
    """,
    },
)
def rename_all(
    mdocs_directory: Path,
    micrograph_directory: Path,
    update_dates_for_warp=False,
    message: str = "",
):
  • The new entrypoint to show the magicgui is a separate function which calls the above with .run(show=True), e.g.,
def rename_all_with_mgui():
    rename_all.show(run=True)

AreTomo in Previewer

  • Now uses AreTomo mode 2 with automatic stack creation with IMOD
  • Some small changes made in align.py and aretomo.py without a full rewrite - this will be necessary soon! Mostly to get the filenaming system to suit the new <tilt_number> system, i.e. accept Position_001_001_0.00.mrc rather than Position_001_1_0.00.mrc.

Previewer early stops

  • First stage of previewer checks that IMOD, MotionCor2, and AreTomo are available before proceeding.
  • Also checks that a GPU is available, using same code as from MotionCor2 but I had to copy it out because the _get_gpu_nvidia_smi function was inside the motioncor object rather than exposed... should probably think about putting this out somewhere else that is more accessible

Ot2Rec Report

  • Adds version numbers and path to executables for Ot2Rec, MotionCor2 and AreTomo.

@elainehoml elainehoml self-assigned this Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant