This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set DYNAMO_ROOT and WORKING_DIR | |
WORKING_DIR=${PWD} | |
DYNAMO_ROOT="/opt/dynamo/1.1.514" | |
# Add CUDA installation to LD_LIBRARY_PATH | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 | |
# Activate dynamo in the current shell environment | |
cd ${DYNAMO_ROOT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dipoles2vesicles(catalogue_name, distance_between_particles) | |
%%% to be run in the folder which holds your catalogue | |
%%% | |
%%% catalogue name - name of catalogue containing your dipoleSet models | |
%%% distance_between_particles - expected distance between particles in px | |
%%% (output points will be oversampled relative to this value) | |
%%% | |
%%% if you want to restart - !rm */*/*/*/*rawVesicle*.omd | |
p = [catalogue_name,'/tomograms/*/models/*.omd']; | |
model_files = dir(p); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import click | |
import starfile | |
import matplotlib.pyplot as plt | |
import mplstereonet | |
@click.command() | |
@click.option('--star_file', '-s', prompt='Input STAR file', type=click.Path(exists=True)) | |
def star_orientation_distribution(star_file): | |
star = starfile.read(star_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import click | |
@click.command() | |
@click.argument('resolution_angstroms', required=False) | |
@click.argument('angstroms_per_pixel', required=False) | |
@click.argument('box_size', required=False) | |
@click.option('-res', | |
'--resolution_angstroms', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import click | |
@click.command() | |
@click.argument('fourier_pixel_extent', required=False) | |
@click.argument('angstroms_per_pixel', required=False) | |
@click.argument('box_size', required=False) | |
@click.option('-fpix', | |
'--fourier_pixel_extent', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import click | |
import starfile | |
@click.command() | |
@click.option('--star_file', prompt='Input STAR file') | |
@click.option('--class_idx', type=int, prompt='Class number') | |
def class_select(star_file, class_idx): | |
star = starfile.read(star_file) | |
subset = star[star['rlnClassNumber']==class_idx] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dms2mod(markers_dms_file, model_file, image_file) | |
%%%%% Convert Dynamo markers (.dms files) into IMOD format model files (.mod) | |
%%%%% Requires MATLAB >= r2019a | |
%%%%% Requires Dynamo >= 1.1.478 | |
%%%%% Requires IMOD >= 4.10.37 | |
%%% Reading marker file | |
m = dread(markers_dms_file); | |
%%% Extract useful objects | |
markers = m.shapes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function table = vll2table(vll_file) | |
%%% Convert a vll file into a table and corresponding tomogram table-map file | |
% Read volume list file | |
volume_list = ptdb.volumelisttext2object(vll_file).volumes; | |
% Prepare output filenames | |
table_file_name = strrep(vll_file, '.vll', '.tbl'); | |
table_map_file_name = strrep(vll_file, '.vll', '_tablemap.doc'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def align(a, b): | |
""" | |
Find r such that r @ a = b when a and b are normalised vectors | |
:param a: normalised vector of length 3 | |
:param b: normalised vector of length 3 | |
:return: rotation matrix | |
""" | |
# cross product to find axis about which rotation should occur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def align_vectorised(a: np.ndarray, b: np.ndarray): | |
""" | |
Find array of rotation matrices r such that r @ a = b when a and b are arrays of normalised vectors | |
implementation designed to avoid trig calls | |
based on https://iquilezles.org/www/articles/noacos/noacos.htm | |
:param a: normalised vector(s) of length 3 | |
:param b: normalised vector(s) of length 3 | |
:return: rotation matrix | |
""" | |
# setup |
OlderNewer