T4SS Assembler

The classes below provide basic wrapper classes and functions for model sub-structures for Type IV Secretion System simulations.

class assemblers.t4ss_assembler.Barrel(volume_id, source, angle, orig_coord_sys)

Basic class to assemble Chimera commands to open a “barrel” for a T4SS model

volume_id

The Chimera volume ID to assign to the opened barrel

source

The path to the MRC to open for the barrel

angle

Random angle relative to the membrane perpendicular assigned to the barrel.

get_commands()

Get the list of commands to send to Chimera

Returns: List of Chimera commands

class assemblers.t4ss_assembler.Rod(volume_id, source, center, degrees, angle, orig_coord_sys)

Basic class to assemble Chimera commands to open a “rod” for a T4SS model

volume_id

The Chimera volume ID to assign to the opened rod

source

The path to the MRC to open for the rod

center

The location at which the rod should be centered

degrees

The degrees to rotate the rod around the z-axis

angle

Random angle relative to the membrane perpendicular assigned to the rod.

orig_coord_sys

The reference model number for the original coordinate system for the entire particle - used in case the laboratory frame is changed by the user mid-assembly

get_commands()

Get the list of commands to send to Chimera

Returns: List of Chimera commands

The main Assembler class

class assemblers.t4ss_assembler.T4SSAssembler(model, temp_dir, chimera_queue, ack_event, pid, custom_args)

A custom particle Assembler class used to build up fake Type IV Secretion System particles

### Attributes passed in on initialization ###
model

The filepath to the particle source MRC which represents the T4SS

temp_dir

The directory into which temporary truth volumes should be placed

chimera_queue

The multiprocessing queue that the server process is listening to

ack_event

The child process-specific acknowledgement event to subscribe to for completion notifications from the Chimera server

pid

The ID of the child process running this assembler

### Other attributes ###
commands

The list of Chimera commands accrued by the Assembler during processing, to be sent to the Chimera REST server once ready

loaded_orientations

The entire distribution of potential orientations loaded in from a Dynamo tbl file

chosen_orientations

The list of randomly selected particle orientations from the above distribution

chosen_positions

The list of randomly selected displacements from the center of the membrane segment for each particle

chosen_angles

The list of randomly selected angles off of the perpendicular to the membrane segment for each particle

simulation

The src.simulation.tem_simulation.Simulation object responsible for feeding particles assembled here to a TEM-Simulator run

__assemble_particle(output_filename)

Assemble a new particle by putting together a membrane segment and a particle map at randomized angle/position/orientation

Parameters

output_filename – The filepath where the assembled particle map is saved

__get_random_angle()

Get a random angle away from the perpendicular to the membrane segment to apply to a new particle

Returns: A random angle pair x,y from a Gaussian distribution of center 0 and standard

deviation 5

__get_random_position()

Get a random shift from the center of the membrane segment to apply to a new particle

Returns: A tuple (x, y) of the x-axis and y-axis shifts

__get_random_tbl_orientation()

Get a random particle orientation from the distribution loaded in from the .tbl file

Returns: A tuple (Z, X, Z) of Euler angles randomly taken from the loaded distribution,

inverted so that we have reference-to-particle angles

__open_membrane(model_id, particle_height_offset, orig_coord_sys)

Enqueues the command to open the previously saved membrane segment MRC to the Chimera session

Parameters
  • model_id – The Chimera session model ID to assign to the opened membrane segment

  • particle_height_offset – The z-axis offset to move up the membrane so that it sits above the particle

  • orig_coord_sys – The reference model number for the original coordinate system for the entire particle - used in case the laboratory frame is changed by the user mid-assembly

Returns: The model ID of the membrane volume within the Chimera segment

__send_commands_to_chimera()

Send the accumulated Chimera commands to the Chimera server for completion, waiting until the commands have been carried out

close()

Let the Chimera server know that this Assembler is done using the server

reset_temp_dir()

Cleans up the temporary files directory used by the Assembler (can be used to set up for a new TEM-Simulator run without having to re-instantiate the Assembler)

set_up_tiltseries(simulation)

Assembles a set of new particles to be placed in a single simulated tilt stack, and updates the TEM-Simulator configurations accordingly

For number of particles (i.e 4):
  1. Make a temp truth volume

  2. Assemble particle and save truth

  3. Set up sim configs and update TEM input files

Parameters

simulation – The src.simulation.tem_simulation.Simulation object responsible for feeding particles assembled here to a TEM-Simulator run, passed in from the simulation child process running the simulation using this Assembler.