Skip to content

GetAffineTransformation

apiblocks.GetAffineTransformation

For the given alignment, calculates an affine transformation \(A\) that transforms blocks in the reference structure to the blocks in the target structure, i.e.

\[ x_{tgt} = Ax_{ref} \]
Parameters:
Name Type Description Example Default
ref ProteinStructure

Reference protein structure

{
  "name": "Example reference",
  "chains": [
    {
      "chain_id": "A",
      "residues": [
        {
          "residue_id": "1",
          "name": "MET",
          "atoms": [
            {
              "name": "CA",
              "coordinates": {
                "x": 0.0,
                "y": 1.0,
                "z": 1.5
              }
            }
          ]
        }
      ]
    }
  ]
}
tgt ProteinStructure

Target protein structure

{
  "name": "Example target",
  "chains": [
    {
      "chain_id": "A",
      "residues": [
        {
          "residue_id": "1",
          "name": "MET",
          "atoms": [
            {
              "name": "CA",
              "coordinates": {
                "x": 1.0,
                "y": 2.0,
                "z": 2.5
              }
            }
          ]
        }
      ]
    }
  ]
}
alignment Optional[ProteinAlignment]

Pre-copmuted alignment between the ref and tgt. If not provided, will align structures first

null
null

Returns:

Type Description
List[AffineTransformation3D]

A list of affine 3D transformation matrices, one for each alignment block.

Examples:
$ curl 'https://api.apiblocks.dev/rpc' \
-H 'X-API-KEY: $APIBLOCKS_TOKEN' \
-H 'Content-Type: application/json' \
--data '{
    "id": "2ec9e628-f5e1-46f8-926c-b4fa7994469c",
    "method": "apiblocks.GetAffineTransformation",
    "params": {
      "ref": {
        "name": "Example reference",
        "chains": [
          {
            "chain_id": "A",
            "residues": [
              {
                "residue_id": "1",
                "name": "MET",
                "atoms": [
                  {
                    "name": "CA",
                    "coordinates": {
                      "x": 0.0,
                      "y": 1.0,
                      "z": 1.5
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      "tgt": {
        "name": "Example target",
        "chains": [
          {
            "chain_id": "A",
            "residues": [
              {
                "residue_id": "1",
                "name": "MET",
                "atoms": [
                  {
                    "name": "CA",
                    "coordinates": {
                      "x": 1.0,
                      "y": 2.0,
                      "z": 2.5
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      "alignment": null
    }
  }'