Af_edge_RMSD: Function to calculate the RMSD between sequences over each...

View source: R/Af_edge_RMSD.R

Af_edge_RMSDR Documentation

Function to calculate the RMSD between sequences over each edge in the AntibodyForest object

Description

This function calculates the RMSD between sequences over each edge in the AntibodyForest object.

Usage

Af_edge_RMSD(
  AntibodyForests_object,
  VDJ,
  pdb.dir,
  file.df,
  sequence.region,
  sub.sequence.column,
  chain,
  font.size,
  point.size,
  color,
  output.file
)

Arguments

AntibodyForests_object

AntibodyForests-object, output from Af_build()

VDJ

The dataframe with V(D)J information such as the output of Platypus::VDJ_build() that was used to create the AntibodyForests-object. Must contain columns sample_id, clonotype_id, barcode.

pdb.dir

a directory containing PDB files.

file.df

a dataframe of pdb filenames (column file_name) to be used and sequence IDs (column sequence) corresponding to the the barcodes in the AntibodyForests-object

sequence.region

a character vector of the sequence region to be used to calculate properties. Default is "full.sequence".

  • full.sequence: the full sequence(s) in the PDB file

  • sub.sequence: part of the full sequence, for example the CDR3 region in the PDB file. This sub sequence must be a column in the VDJ dataframe.

  • binding.residues: the binding residues in the PDB file

sub.sequence.column

a character vector of the column name in the VDJ dataframe containing the sub sequence to be used to calculate properties. Default is NULL.

chain

a character vector of the chain to be used to calculate properties. Default is both heavy and light chain Assuming chain "A" is heavy chain, chain "B" is light chain, and possible chain "C" is the antigen.

  • HC+LC: both heavy and light chain

  • HC: heavy chain, assuming chain A is the heavy chain.

  • LC: light chain, assuming chain B is the light chain.

  • AG: antigen, assuming chain C is the antigen.

  • whole.complex: the whole complex of antibody-antigen (all available chains in the pdb file).

font.size

The font size of the plot. Default is 12.

point.size

The size of the points in the scatterplot. Default is 1.

color

The color of the dots in the scatterplot. Default is "black".

output.file

string - specifies the path to the output file (PNG of PDF). Defaults to NULL.

Value

A list with the edge dataframe and a ggplot2 object

Examples

## Not run: 
rmsd_df <- Af_edge_RMSD(AntibodyForests::small_af,
                       VDJ = AntibodyForests::small_vdj,
                       pdb.dir = "~/path/PDBS_superimposed/",
                       file.df = files,
                       sequence.region = "full.sequence",
                       chain = "HC+LC")
## End(Not run)

AntibodyForests documentation built on April 4, 2025, 4:45 a.m.