ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory Class Reference

Public Member Functions

def __init__ (self)
 
def load_traj (self, path)
 
def dump_traj (self)
 
def pretend_blob (blob)
 
def get_normal (self, node0, node1, node2)
 
def create_cgo (self, script, display_params)
 
def write_cgo_for_elements (self, element_list, script, turbotraj)
 
def dump_cgo (self)
 
def load_ftj_header (self, fname)
 
def populate_turbotraj_from_ftj (self, fname, surf=None, load_all=1, frame_rate=1, num_frames_to_read=1000000, start=0)
 

Data Fields

 dimensions
 
 path
 
 blob
 
 turbotraj
 
 cgo_blob_index
 
 ftj
 
 num_blobs
 
 num_conformations
 
 num_nodes
 
 fpos
 
 num_frames
 
 step
 

Detailed Description

The FFEA_turbotrajectory class is an alternative to the FFEA_trajectory
class. It can only be generated from an FFEA trajectory, and the process
is one-way. It is not intended for general use, but may be handy for
applications in which the performance matters more than the semantics.
In addition to being very fast, it's also very small, as it stores
no second-order nodes, and stores trajectories as binary blobs, not as
text files.
For this reason, the read speed is only limited by your hard drive speed, 
unlike FFEA_trajectory, which is limited by how fast the individual lines
from the file can be read in.
FFEA_turbotrajectory is only really userful in situations when a trajectory
object has to be read in more than once - it still reads from the .ftj file,
so ultimately, you're adding a bit of overhead.
It can also directly precalculate the calls to CGL that are needed for the
PyMOL plugin to draw triangles on the screen. The major overhead in loading
trajectories into the viewer is actually looking up the triangle indices
and calculating the surface normals, and the cgo objects have that
pre-generated.
In the future, the FFEA runner may be able to write directly to turbotraj-
compatible binary blobs.

Constructor & Destructor Documentation

◆ __init__()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.__init__ (   self)

Member Function Documentation

◆ create_cgo()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.create_cgo (   self,
  script,
  display_params 
)
This sript creates a cgo object that can be fed into pymol for each frame
and blob. The cgo object contains the vertices of each triangle in the mesh,
a normal vector, and some control codes. This method also creates an index
file listing the name of each cgo object and which frame it belongs to.
In: self, script (an FFEA script object) and display_params, which is
a dictionary created by the pymol viewer gui.
Out: populates the self.cgo and self.cgo.blob_index objects.

◆ dump_cgo()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.dump_cgo (   self)

◆ dump_traj()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.dump_traj (   self)

◆ get_normal()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.get_normal (   self,
  node0,
  node1,
  node2 
)
Get the normal to a plane, specified by three nodes.
In: node1, node2, node3.
Out: Plane normal vector as a python list.

Referenced by ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.write_cgo_for_elements().

◆ load_ftj_header()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.load_ftj_header (   self,
  fname 
)
If we had to do this for every node, it would probably be a pain
Load header info. This works in almost the exact same way as the regular
FFEA trajectory method.

Referenced by ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.populate_turbotraj_from_ftj().

◆ load_traj()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.load_traj (   self,
  path 
)
Convert a trajectory into a turbotrajectory.
Note: this is kinda slow, you're better off using the
populate_turbotraj_from_ftj function.
In: self, path to trajectory file.
Out: writes to the self.turbotraj object.

Referenced by ffeatools.modules.FFEA_node.FFEA_node.load().

◆ populate_turbotraj_from_ftj()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.populate_turbotraj_from_ftj (   self,
  fname,
  surf = None,
  load_all = 1,
  frame_rate = 1,
  num_frames_to_read = 1000000,
  start = 0 
)
Create a turbotraj object straight from a ,ftj file. As far as I know,
this is the fastest way to do it, but if you have a better idea, go
ahead! We load in the file, grab the header, use the first 3 frames
to get the number of steps (it only starts stepping properly between
frame 2 and 3) in each frame (why that's not in the header I have no
idea). 
From there, we start reading the file sequentially. Every frame of every
blob has what is essentially header information above it, and let me
tell ya, it's a lot more human readable than it is machine-readable.
Regex is used to work out which part of the header we're in, and
extract the data from the header. We populate the turbotraj object
only with the first-order nodes.
In: self, fname...
Out: populates turbotraj attribute.

◆ pretend_blob()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.pretend_blob (   blob)

◆ write_cgo_for_elements()

def ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.write_cgo_for_elements (   self,
  element_list,
  script,
  turbotraj 
)
This writes to the CGO object using a list of elements supplied by the
user. It outputs a separate pymol object containing only the elements
that the user specifies. IN order to do this, it has to look up the
nodes in each element, and then create four triangles for each.
In: self, element_list (a python list object containing element indices),
a script object, and a turbotraj object.
Out: Appends to the cgo.

Field Documentation

◆ blob

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.blob

◆ cgo_blob_index

◆ dimensions

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.dimensions

◆ fpos

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.fpos

◆ ftj

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.ftj

◆ num_blobs

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.num_blobs

◆ num_conformations

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.num_conformations

◆ num_frames

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.num_frames

◆ num_nodes

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.num_nodes

◆ path

◆ step

ffeatools.modules.FFEA_turbotrajectory.FFEA_turbotrajectory.step

◆ turbotraj


The documentation for this class was generated from the following file: