Skip to content

XML particle data format

Marten edited this page Feb 7, 2023 · 1 revision

Results from template matching are stored in the pytom particle list xml format. These results can easily be parsed with an xml reader in python (we use lxml). In pytom, each subelement in the tree correspond to a class.

When moving to subtomgram alignment and classification the information in the particle list is updated with refined angles, subtomogram shifts and a class (similar to RELION star files). The xml particle lists can also be converted to star files using convert.py or the GUI conversion icon (which wraps convert.py with a friendly user interface).

An example particle list is shown below, elements contain the following information:

  • ParticleList: a list of Particles
    • Particle: subtomogram file name
      • Rotation: Euler rotation angles in zxz format describing rotation of reference onto the particle, to get rotation of particle to reference take the inverse of the rotation matrix (which is identical to the tranpose for a 3x3 rotation matrix). pytom defines euler angles anti-clockwise, therefore to convert to, for example, RELION, the angles first need to be converted to ZYZ and then multiplied with -1, i.e. relion_zyz = (-z1, -y, -z2).
      • Shifts: shift (in pixels) to align the reference on the particle after applying first the rotation
      • PickPosition: voxel indices of where the particle was identified in tomogram file origin
      • Wedge: type of missing wedge, angles are defined as Angle1 = (90 - abs(min(tilt_angles))) and Angle2 = (90 - abs(max(tilt_angles)))
      • InfoTomogram: binning of tomogram and which marker was used as reference in alignment (deprecated funtionality)
      • Score: cross correlation information from template matching, Value shows normalised cross correlation score with the template
      • Class: integer class (starting from 0) assigned to particle during subtomogram classification
<ParticleList>
  <Particle Filename="05_Subtomogram_Analysis/Subtomograms/particleList_TM_tomogram_070_WBP/particle_24.em">
    <Rotation Paradigm="ZXZ" X="106.94996883060917" Z1="125.07693679975073" Z2="183.3447532664744"/>
    <Shift X="0.20115090824138804" Y="0.35341457119587716" Z="-1.6898794640329697"/>
    <PickPosition Origin="04_Particle_Picking/Tomograms/tomogram_070_WBP.mrc" X="124.0" Y="291.0" Z="245.0"/>
    <Wedge Type="SingleTiltWedge">
      <SingleTiltWedge Angle1="38.0" Angle2="38.0" CutoffRadius="0.0" Smooth="0.0">
        <TiltAxisRotation Z1="0.0" Z2="0.0" X="0.0"/>
      </SingleTiltWedge>
    </Wedge>
    <InfoTomogram BinningFactor="1" RefMarkIndex="0" TomoName="['', 1, 1]"/>
    <Score RemoveAutocorr="False" Type="undefined" Value="0.24800656116707256">
      <PeakPrior Filename="" Radius="0.0" Smooth="-1.0"/>
    </Score>
    <Class Name="0"/>
  </Particle>
  <Particle Filename="05_Subtomogram_Analysis/Subtomograms/particleList_TM_tomogram_070_WBP/particle_26.em">
    <Rotation Paradigm="ZXZ" X="34.856218885095466" Z1="250.27143264427764" Z2="112.55257562573414"/>
    <Shift X="0.6979222876319469" Y="-0.40750876295253846" Z="-1.9867106468136129"/>
    <PickPosition Origin="04_Particle_Picking/Tomograms/tomogram_070_WBP.mrc" X="268.0" Y="274.0" Z="233.0"/>
    <Wedge Type="SingleTiltWedge">
      <SingleTiltWedge Angle1="38.0" Angle2="38.0" CutoffRadius="0.0" Smooth="0.0">
        <TiltAxisRotation Z1="0.0" Z2="0.0" X="0.0"/>
      </SingleTiltWedge>
    </Wedge>
    <InfoTomogram BinningFactor="1" RefMarkIndex="0" TomoName="['', 1, 1]"/>
    <Score RemoveAutocorr="False" Type="undefined" Value="0.23164746882547074">
      <PeakPrior Filename="" Radius="0.0" Smooth="-1.0"/>
    </Score>
    <Class Name="0"/>
  </Particle>
  ...
</ParticleList>