Documented functions with links to source

Program to optimize segmentrefine3d reconstruction by varying refinement parameters systematically on a grid

class segrefine3dgrid.SegRefine3dGridPar[source]

Class to initiate default dictionary with input parameters including help and range values and status dictionary

Methods

add_custom_refinement_strategy_as_relative

define_input_output_segmentrefine3d

define_parameters_and_their_properties

define_program_states

define_segmentrefine3d_parameters

get_angular_restraint_title

get_parameters_to_be_varied

get_restraint_phrase

get_translation_range_phrase

get_translational_range_title

set_3dctf_correction_intensity_option

set_3dctf_correction_option

set_amp_corr_out_of_plane_range

set_bin_cutff_enforce_pitch_even_phi

set_choose_out_of_plane_amp_corr

set_enforce_even_phi_distribution

set_enforce_pitch_even_phi

set_frame_averaging_size

set_frame_motion_correction

set_fsc_based_filter_option

set_halfset_refinement_option

set_halfset_start

set_helical_continuity_option

set_helical_symmetry_parameters

set_high_resolution_aim

set_high_resolution_angular_restraint

set_high_resolution_trans_range

set_image_size_to_be_aligned

set_inp_refinement_stack

set_iteration_count

set_local_averaging_size

set_low_resolution_aim

set_low_resolution_angular_restraint

set_low_resolution_trans_range

set_max_resolution_trans_range

set_maximum_resolution_aim

set_maximum_resolution_angular_restraint

set_medium_resolution_aim

set_medium_resolution_angular_restraint

set_medium_resolution_trans_range

set_reference_volume

set_reference_volume_option

set_refine_helical_symmetry

set_refinement_strategy

set_refinement_strategy_options

set_relatives_and_level

set_release_cycle_even_phi

set_resolution_aim_choice

set_volume_prefix_refined_structure

define_parameters_and_their_properties()[source]
define_program_states()[source]
get_parameters_to_be_varied()[source]
class segrefine3dgrid.SegRefine3dGridSetup(parset=None)[source]

Methods

add_grid_point_to_parameter_dictionary(…)

>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid

extrapolate_second_order_to_end_of_box(…)

>>> from spring.segment3d.refine.sr3d_main import SegmentRefine3d

generate_file_name_for_grid_search(…)

>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid

sort_data_and_discard_duplicates(x, y)

define_alignment_parameters

define_all_segmentrefine3d_parameters

define_filter_parameters

define_helical_symmetry_parameters

define_input_output_iteration

define_mpi_parameters

define_reconstruction_parameters

define_refinement_strategy_options

define_selection_parameters

fill_in_excluded_quantities_by_interpolation

generate_segmentrefine3d_parameters_while_removing_grid_parameters

get_all_helices_from_last_refinement_cycle

get_all_segments_from_refinement_cycle

get_avg_helix_shift_x_and_y_and_avg_inplane_angles

get_cut_coordinates_named_tuple

get_helices_coordinates_required_for_unbending_from_database

get_helix_coordinates_named_tuple

get_picked_segment_coordinates

get_ref_session_and_last_cycle

get_segment_ids_from_helix

get_segments_from_helix

make_unbending_named_tuple

prepare_unique_updated_stack_name

setup_alignment_related_parameters

setup_filter_related_parameters

setup_non_refinement_selection_criteria

setup_parameters_for_each_grid_point

setup_refinement_selection_criteria

setup_symmetry_related_parameters

unbend_window_and_mask_input_stack

generate_segmentrefine3d_parameters_while_removing_grid_parameters(parameters)[source]
setup_non_refinement_selection_criteria(each_grid_point, parameters, index, one_of_both_parameters)[source]
setup_refinement_selection_criteria(each_grid_point, parameters, index, one_of_both_parameters)[source]
add_grid_point_to_parameter_dictionary(first_param, second_param, each_grid_point, parameters)[source]
>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid
>>> s = SegRefine3dGrid()
>>> r_p = 'helical_rise_or_pitch'
>>> params = SegRefine3dGridPar().parameters
>>> s.add_grid_point_to_parameter_dictionary('b-factor', r_p, [-111, 1.111], params) 
OrderedDict([('Image input stack refinement', 'protein_stack.hdf'), 
('Output volume name', 'recvol.hdf'), 
('First parameter', 'helical_rise_or_pitch'), ('Second parameter', 
'helical_rotation_or_number_of_units_per_turn'), 
('Lower and upper limit first parameter', (1.4, 1.9)), 
('Lower and upper limit second parameter', (22.0, 24.0)), 
('First and second parameter increment', (0.1, 0.3)), 
('Subgrid option', False), ('Part and number of subgrids', (1, 3)), 
('Grid continue option', False), ('Grid database', 'grid.db'), 
('Diagnostic plot prefix', 'diagnostic_plot.pdf'), 
('Number of iterations', 20), ('Reference structure option', False), 
('Reference volume', 'reference_vol.hdf'), ('spring.db file', 
'spring.db'), ('Continue refinement option', False), 
('refinement.db file', 'refinement.db'), ('Assemble refinement strategy', 
True), ('LR - Low resolution aim', True), 
('LR - azimuthal and out-of-plane search restraint in degrees', 
(180.0, 180.0)), ('LR - X and Y translation range in Angstrom', 
(50, 23)), ('MR - Medium resolution aim', True), 
('MR - azimuthal and out-of-plane search restraint in degrees', 
(180.0, 180.0)), ('MR - X and Y translation range in Angstrom', 
(21, 10)), ('HR - High resolution aim', True), 
('HR - azimuthal and out-of-plane search restraint in degrees', 
(20.0, 20.0)), ('HR - X and Y translation range in Angstrom', 
(14, 7)), ('MaxR - Maximum resolution aim', True), 
('MaxR - azimuthal and out-of-plane search restraint in degrees', 
(2.0, 2.0)), ('MaxR - X and Y translation range in Angstrom', 
(7, 3.5)), ('Absolute X and Y translation limit in Angstrom', 
(100, 100)), ('Frame motion correction', False), 
('Frame average window size', 3),  ('Frame local averaging distance', 700), 
('Independent half-set refinement', False), 
('Half-set refinement start', 'medium'), ('High-pass filter option', False), 
('Low-pass filter option', True), 
('High and low-pass filter cutoffs in 1/Angstrom', 
(0.001, 0.09)), ('B-Factor', -111), ('Custom filter option', 
False), ('Custom-built filter file', 'filter_function.dat'), 
('Automatic FSC filter', True), ('Filter layer-lines option', False), 
('Micrographs select option', False), ('Include or exclude micrographs', 
'include'), ('Micrographs list', '1-9, 11, 13'), ('Helices select option', 
False), ('Include or exclude helices', 'include'), ('Helices list', 
'1-9, 11, 13'), ('Segments select option', False), 
('Include or exclude segments', 'include'), ('Segment file', 
'stackid_file.dat'), ('Classes select option', False), 
('Include or exclude classes', 'include'), ('Class type', 'class_id'), 
('Classes list', '1-9, 11, 13'),  ('Persistence class option', False), 
('Persistence class length in Angstrom', 700), 
('Class occupancy threshold', 0.5), ('Straightness select option', False), 
('Include or exclude straight helices', 'include'), ('Persistence length range', 
(80, 100)), ('Layer line correlation select option', False), 
('Include or exclude segments based on layer-line correlation', 
'include'), ('Correlation layer line range', (60, 100)), 
('Defocus select option', False), ('Include or exclude defocus range', 
'include'), ('Defocus range', (10000, 40000)), 
('Astigmatism select option', False), 
('Include or exclude astigmatic segments', 'include'), 
('Astigmatism range', (0, 4000)), 
('Projection correlation select option', False), 
('Include or exclude segments based on projection correlation', 
'include'), ('Correlation projection range', (60, 100)), 
('Out-of-plane tilt select option', False), 
('Include or exclude out-of-plane tilted segments', 'include'), 
('Out-of-plane tilt range', (-5, 5)), 
('Shift normal to helix select option', False), 
('Include or exclude segments with shift normal to helix', 'include'), 
('Shift normal to helix in Angstrom', 5.0), ('Keep intermediate files', 
False), ('Estimated helix inner and outer diameter in Angstrom', (0, 190)), 
('Pixel size in Angstrom', 1.163), ('Symmetrize helix', True), 
('Helical rise/rotation or pitch/number of units per turn choice', 
'rise/rotation'), ('Enforce even phi option', False), 
('Release cycle even phi', 8), ('Pitch enforce even phi', 8.0), 
('Bin cutoff of phi angles', 100), 
('Helical symmetry in Angstrom or degrees', (1.111, 22.03)), 
('Rotational symmetry', 1), ('Helix polarity', 'polar'), 
('Unbending option', False), ('Force helical continuity', True), 
('Limit in-plane rotation', True), ('Delta in-plane rotation angle', 
10.0), ('Out-of-plane tilt angle range', (-12, 12)), 
('Number of projections azimuthal/out-of-plane angle', 
(90, 7)), ('Image alignment size in Angstrom', 700), 
('Step size of segmentation in Angstrom', 70), 
('Choose out-of-plane tilt amplitude correlation', False), 
('Amplitude correlation out-of-plane tilt range', (-12, 12)), 
('3D CTF correction', True), ('3D CTF correction intensity', 'low'), 
('MPI option', True), ('Number of CPUs', 8), ('Temporary directory', '/tmp')])
>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid
>>> s = SegRefine3dGrid()
>>> s.generate_file_name_for_grid_search('b-factor', None, [-200, 3])
'b-factor_-200'
>>> sec_par = 'helical_rise_or_pitch'
>>> s.generate_file_name_for_grid_search('b-factor', sec_par, [-200, 3.344])
'b-factor_-200_helical_rise_or_pitch_3344'
setup_parameters_for_each_grid_point(first_param, second_param, each_grid_point, parameters)[source]
class segrefine3dgrid.SegRefine3dGrid(parset=None)[source]

Methods

add_grid_point_to_parameter_dictionary(…)

>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid

extrapolate_second_order_to_end_of_box(…)

>>> from spring.segment3d.refine.sr3d_main import SegmentRefine3d

generate_cmdline_for_each_grid_point(…)

>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid

generate_file_name_for_grid_search(…)

>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid

sort_data_and_discard_duplicates(x, y)

split_grid_if_demanded(subgrid_option, …)

>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid

define_alignment_parameters

define_all_segmentrefine3d_parameters

define_filter_parameters

define_helical_symmetry_parameters

define_input_output_iteration

define_mpi_parameters

define_reconstruction_parameters

define_refinement_strategy_options

define_selection_parameters

enter_parameters_in_grid_database

enter_variables_into_grid_database

fill_in_excluded_quantities_by_interpolation

generate_segmentrefine3d_parameters_while_removing_grid_parameters

get_all_helices_from_last_refinement_cycle

get_all_segments_from_refinement_cycle

get_avg_helix_shift_x_and_y_and_avg_inplane_angles

get_cut_coordinates_named_tuple

get_grid_database_name

get_grid_parameters_and_final_grid_entry

get_helices_coordinates_required_for_unbending_from_database

get_helix_coordinates_named_tuple

get_picked_segment_coordinates

get_ref_session_and_last_cycle

get_segment_ids_from_helix

get_segments_from_helix

get_variables_ranges_and_increments

launch_segmentrefine3d_jobs

make_database_entries

make_unbending_named_tuple

prepare_grid_database

prepare_unique_updated_stack_name

setup_alignment_related_parameters

setup_filter_related_parameters

setup_grid_sequence

setup_non_refinement_selection_criteria

setup_parameters_for_each_grid_point

setup_refinement_selection_criteria

setup_symmetry_related_parameters

unbend_window_and_mask_input_stack

split_grid_if_demanded(subgrid_option, subgrid, grid_sequence)[source]
>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid
>>> from spring.segment3d.segclassreconstruct import SegClassReconstruct
>>> s = SegClassReconstruct()
>>> grid = s.generate_rise_rotation_or_pitch_unitnumber_pairs_for_symmetry_grid((275.0, 305.0), 5.0, (3.8, 4.2), 0.1)
>>> SegRefine3dGrid().split_grid_if_demanded(True, (1, 6), grid.ravel())
array([(275.0, 3.8), (275.0, 3.9), (275.0, 4.0), (275.0, 4.1),
       (275.0, 4.2), (280.0, 3.8)], dtype=object)
>>> SegRefine3dGrid().split_grid_if_demanded(True, (7, 6), grid.ravel())
Traceback (most recent call last):
  File '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/doctest.py', line 1254, in __run
    compileflags, 1) in test.globs
  File '<doctest segrefine3dgrid.SegRefine3dGrid.split_grid_if_demanded[5]>', line 1, in <module>
    SegRefine3dGrid().split_grid_if_demanded(True, (7, 6), grid.ravel())
  File 'spring/segment3d/segrefine3dgrid.py', line 430, in split_grid_if_demanded
    raise ValueError(msg)
ValueError: Part of subgrids must not be larger than entire number of subgrids. Enter part of subgrids < number of subgrids.
get_grid_parameters_and_final_grid_entry(grid_database, grid_name)[source]
get_grid_database_name(subgrid_option)[source]
get_variables_ranges_and_increments(grid_name)[source]
setup_grid_sequence()[source]
generate_cmdline_for_each_grid_point(parameter_file)[source]
>>> from spring.segment3d.segrefine3dgrid import SegRefine3dGrid
>>> s = SegRefine3dGrid()
>>> s.generate_cmdline_for_each_grid_point('rot_23432_rise_4224.par')
'segmentrefine3d --d rot_23432_rise_4224 --f rot_23432_rise_4224.par'
make_database_entries(run_name, each_grid_point, grid_session, last_cycle, stat_file, reproj_file, latest_reconstruction)[source]
enter_parameters_in_grid_database(primary_variable, secondary_variable, run_name, each_grid_point, grid_name, target_cycle_id)[source]
enter_variables_into_grid_database(primary_variable, secondary_variable, primary_range, secondary_range, primary_inc, second_inc, rise_rot_or_pitch_unit_choice)[source]
prepare_grid_database(primary_variable, secondary_variable, primary_range, secondary_range, primary_inc, second_inc, grid_name)[source]
launch_segmentrefine3d_jobs()[source]
segrefine3dgrid.main()[source]