simulariumio/medyan/medyan_converter.py
def _parse_data_dimensions(
        lines: List[str], input_data: MedyanData
    ) -> DimensionData:
        """
        Parse a MEDYAN snapshot.traj output file to get the number
        of subpoints per agent per timestep
        """
        result = DimensionData(0, 0)
        agents = 0
        at_frame_start = True
        for line in lines:
            if len(line) < 1:
                at_frame_start = True
                continue
            if at_frame_start:
                # start of timestep
                cols = line.split()
                if agents > result.max_agents:
                    result.max_agents = agents
                agents = int(cols[2]) + int(cols[3]) + int(cols[4])
                result.total_steps += 1
                at_frame_start = False
            elif "FILAMENT" in line or "LINKER" in line or "MOTOR" in line:
                # start of object
                if "FILAMENT" in line:
                    object_type = "filament"
                elif "LINKER" in line:
                    object_type = "linker"
                else:
                    object_type = "motor"
                if MedyanConverter._draw_endpoints(line, object_type, input_data):
                    agents += 2
                if "FILAMENT" in line:
                    # start of filament
                    cols = line.split()
                    subpoints = int(cols[3])
                    if result.max_subpoints < subpoints:
                        result.max_subpoints = subpoints
                else:
                    # start of linker or motor
                    if result.max_subpoints < 2:
                        result.max_subpoints = 2
        if agents > result.max_agents:
            result.max_agents = agents
        return result

        Parse a MEDYAN snapshot.traj output file to get the number
        of subpoints per agent per timestep
        
Parse a MEDYAN snapshot.traj output file to get the number
of subpoints per agent per timestep
Parse a MEDYAN snapshot . traj output file to get the number of subpoints per agent per timestep
def _parse_data_dimensions(
        lines: List[str], input_data: MedyanData
    ) -> DimensionData:
        result = DimensionData(0, 0)
        agents = 0
        at_frame_start = True
        for line in lines:
            if len(line) < 1:
                at_frame_start = True
                continue
            if at_frame_start:
                cols = line.split()
                if agents > result.max_agents:
                    result.max_agents = agents
                agents = int(cols[2]) + int(cols[3]) + int(cols[4])
                result.total_steps += 1
                at_frame_start = False
            elif "FILAMENT" in line or "LINKER" in line or "MOTOR" in line:
                if "FILAMENT" in line:
                    object_type = "filament"
                elif "LINKER" in line:
                    object_type = "linker"
                else:
                    object_type = "motor"
                if MedyanConverter._draw_endpoints(line, object_type, input_data):
                    agents += 2
                if "FILAMENT" in line:
                    cols = line.split()
                    subpoints = int(cols[3])
                    if result.max_subpoints < subpoints:
                        result.max_subpoints = subpoints
                else:
                    if result.max_subpoints < 2:
                        result.max_subpoints = 2
        if agents > result.max_agents:
            result.max_agents = agents
        return result
def _parse_data_dimensions ( lines : List [ str ] , input_data : MedyanData ) -> DimensionData : result = DimensionData ( 0 , 0 ) agents = 0 at_frame_start = True for line in lines : if len ( line ) < 1 : at_frame_start = True continue if at_frame_start : cols = line . split ( ) if agents > result . max_agents : result . max_agents = agents agents = int ( cols [ 2 ] ) + int ( cols [ 3 ] ) + int ( cols [ 4 ] ) result . total_steps += 1 at_frame_start = False elif "FILAMENT" in line or "LINKER" in line or "MOTOR" in line : if "FILAMENT" in line : object_type = "filament" elif "LINKER" in line : object_type = "linker" else : object_type = "motor" if MedyanConverter . _draw_endpoints ( line , object_type , input_data ) : agents += 2 if "FILAMENT" in line : cols = line . split ( ) subpoints = int ( cols [ 3 ] ) if result . max_subpoints < subpoints : result . max_subpoints = subpoints else : if result . max_subpoints < 2 : result . max_subpoints = 2 if agents > result . max_agents : result . max_agents = agents return result
Parse a MEDYAN snapshot.traj output file to get the number
of subpoints per agent per timestep
Parse a MEDYAN snapshot . traj output file to get the number of subpoints per agent per timestep
"""
        Parse a MEDYAN snapshot.traj output file to get the number
        of subpoints per agent per timestep
        """ # start of timestep # start of object # start of filament # start of linker or motor
lines
List[str]
input_data
MedyanData