Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
User Manual

Molecular_distances_flexible

Authors: F. Cazals and R. Tetley

Goals

Goals. The root mean square deviation (RMSD) and the least RMSD which are provided in the companion package Molecular_distances are two widely used similarity measures in structural bioinformatics. Yet, they stem from global comparisons, possibly obliterating locally conserved motifs.

To foster our understanding of molecular flexibility, this package, based upon developments presented in [29], provides so-called combined $\rmsd$, which mixes independent $\lrmsd$ measures, each computed with its own optimal rigid motion.

The structural units which may be domains, subdomain, SSE, etc, are defined using the machinery from the package MolecularSystemLabelsTraits

The combined $\rmsd$ can be used to compare (quaternary) structures based on motifs defined from the sequence (domains, SSE), or to compare structures based on structural motifs yielded by local structural alignment methods. To handle these situations, the following three executables are provided:

  • $\text{\sblrmsdflexconf}$ to compare conformations of a molecule–which can be done without computing a non-trivial alignment,
  • $\text{\sblrmsdflexprotkpax}$ to compare homologous proteins, using the structural aligner $\text{\kpax}$ provided in the package Apurva,
  • $\text{\sblrmsdflexprotapurva}$ to compare homologous proteins, using the structural aligner $\text{\apurva}$ provided in the package Iterative_alignment,
  • $\text{\sblrmsdflexmot}$ to compare structural motifs – see also the companion package Structural_motifs .

Labels and local alignments. As noticed above, regions are defined using the labels, as indicated in the package MolecularSystemLabelsTraits.

Two regions with the same label specification may not contain the same number of amino-acids – this typically occurs for homologous proteins or when the crystallographer could not resolve some amino acids. Therefore, for each label, a local alignment is run to ensure a 1-1 correspondence between a.a.

In the SBL, alignments are defined in the package Alignment_engines. Following the previous remark, we consider structural alignments in two settings:

  • For two chains with identical sequence, the alignment is trivial as common residues are retained and aligned.
  • If this is not the case, a structural alignment is computed using $\text{\kpax}$ or $\text{\apurva}$ – see above.
The rationale for performing a structural alignment is that motifs are primarily defined based on structural elements. For long motifs, a sequence alignment could be envisioned too.


In the sequel, it is assumed that any local alignment involves 4 or more residues; if not, a warning is issued, and the $\text{\lrmsd}$ output for the corresponding comparisons is set to -1.


Modes. As in the package Molecular_distances, four modes are provided:

  • Calpha atoms: distances are computed on Calpha.
  • Backbone atoms: only Calpha, C and N atoms.
  • Heavy atoms: distances are computed on all atoms but hydrogen atoms.
  • All atoms: distances are computed on all atoms, including hydrogen atoms.

Combined RMSD for proteins

Pre-requisites

Vertex weighted $\lrmsd$. Consider two point sets $A=\{ a_i \}$ and $B=\{ b_i \}$ of size $N$. Naturally, each point corresponds to an atom or pseudo-atom – which we generically call a particle.

Also consider a set of positive weights $\{ w_i\}_{i=1,\dots, N}$, meant to stress the importance of certain points. The weighted $\rmsd$ reads as

\begin{equation} \rmsdw{A}{B} = \sqrt{\frac{1}{\sum_i w_i} \sum_{i=1,\dots, N} w_i \vvnorm{a_i-b_i}^2} \end{equation}

Let $g$ a rigid motion from the special Euclidean group $SE(3)$. To perform a comparison of $A$ and $B$ oblivious to rigid motions, we use the so-called least RMSD [82] :

The vertex weighted $\lrmsd$ is defined by

\begin{equation} \lrmsdvw{A}{B} = \min_{g\in SE(3)} \rmsdw{A}{g(B)}. \end{equation}

The rigid motion yielding the minimum is denoted $\lrmsdoptrm{}(A,B)$ or $\lrmsdoptrm{}$ for short. The weight of the $\lrmsdvw$ is defined as $\rmsdW{vw}{A}{B} = \sum_i w_i$.


Note that the celebrated $\lrmsd$ is the particular case of the previous with unit weights:

\begin{equation} \lrmsd{A}{B} = \lrmsdvw{A}{B} \text{ with } w_i \equiv 1, \forall i. \end{equation}

We arrive at the main definition, which combines individual RMSD:

Consider two structures $A$ and $B$ for which non-overlapping regions $ \{ \motifacc{i}, \motifbcc{i} \}_{i=1,\dots,m}$ have been identified Assume that a $\lrmsd$ has been computed for each pair $(\motifacc{i}, \motifbcc{i} )$. Let $w_i$ be the weights associated with an individual $\lrmsd$. The combined $\rmsd$ is defined by

\begin{equation} \rmsdcomb{A}{B} = \sqrt{ \sum_{i=1}^m \frac{w_i}{\sum_i w_i} \lrmsds{ \motifacc{i}}{\motifbcc{i}} }. \end{equation}


Chain mappings for quaternary structures. Consider the case where one wishes to compare chains from different quaternary structures. In that case, one needs to know the correspondence between the individual chains across these structures. To this end, we define:

A mapping between the m chains of n proteins is given in matrix form as follows:
  • one line provides an ordered list of the $m$ protein chains. Phrased differently, two lines define a matching between the $m$ chains of these two proteins.
  • one column corresponds the chains of the $n$ proteins to be compared.


Functionalities and scenarios

Functionalities. The executables $\text{\sblrmsdflexprotkpax}$ and $\text{\sblrmsdflexprotapurva}$ computes a vertex weighted $\rmsd$ for homologous proteins. A pairwise comparison therefore requires an alignment, as discussed below.

Scenarios. The scenarii discussed below depend on

  • the number of proteins processed – one, two or more
  • the number of polypeptide chains studied of interest.

Options to compare polypeptide chains. The programs $\text{\sblrmsdflexprotkpax}$ and $\text{\sblrmsdflexprotapurva}$ enjoy the same options, the main ones being:

The main options of the program $\sblrmsdflexprotkpax$ are:
–pdb-file string: PDB file
–domain-labels: Spec. file defining the subdomain labels
–chains: Which chains to load
-d: Output directory
–allow-incomplete-chains: Load the polypeptide chains even if they are incomplete
-p: Set oocupancy policy


Options to compare conformations. As noticed above, the identity alignment between residues can be used. The options are:

The main options of the program $\sblrmsdflexconf$ are:
–pdb-file string: PDB file
–domain-labels: Spec. file defining the subdomain labels
–chains: Which chains to load
-d: Output directory


The reader is referred to the jupyter notebook – section Jupyter demo for illustrations.

Comparing n chains of one protein

This case is that of a protein with quaternary structure, in which case we compare the polypeptide chains.

Input.

Output. We report the matrix of $\text{\rmsdcomb}$ distances.

sbl-rmsd-flexible-proteins.exe --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains ABC -d results/onepnc -v -l


Comparing two polypeptide chains of two proteins

Consider two proteins, with a focus on one chain for each.

Input.

  • A PDB file for each chain.
  • One spec file per chain for the sub-domain definitions (as in MolecularSystemLabelsTraits) for each chain.

Output. The $\text{\rmsdcomb}$ is reported.

$SBL_DIR/Applications/Molecular_distances_flexible/src/Molecular_distances_flexible/build/sbl-rmsd-flexible-proteins.exe --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains A --pdb-file data/pdb_files/TBEV.pdb --domain-labels data/spec_files/TBEV.spec --chains A -d results/twoponec -v -l --allow-incomplete-chains -p 3


Comparing n chains of two proteins

Input. Consider two proteins, each of which with n chains, specified as follows:

  • A PDB file for each protein,
  • A spec file for each protein.

Output. A matrix of $\text{\rmsdcomb}$ is reported – one entry for each pair of chains.

$SBL_DIR/Applications/Molecular_distances_flexible/src/Molecular_distances_flexible/build/sbl-rmsd-flexible-proteins.exe --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains ABC --pdb-file data/pdb_files/TBEV.pdb --domain-labels data/spec_files/TBEV.spec --chains ABC -d results/twoponec -v -l --allow-incomplete-chains -p 3


Comparing n polypeptide chains

Input.

  • A PDB file for each chain.
  • One spec file per chain for the sub-domain definitions (as in MolecularSystemLabelsTraits) for each chain.

Output. The matrix of all pairwise $\text{\rmsdcomb}$ distances is reported – one entry for each pair of chains.

$SBL_DIR/Applications/Molecular_distances_flexible/src/Molecular_distances_flexible/build/sbl-rmsd-flexible-proteins.exe --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains A --pdb-file data/pdb_files/TBEV.pdb --domain-labels data/spec_files/TBEV.spec --chains A --pdb-file data/pdb_files/EFF1.pdb --domain-labels data/spec_files/EFF1.spec --chains A -d results/nponec -v -l --allow-incomplete-chains -p 3


Comparing m chains of n proteins

Input. Consider now a set of $n$ proteins, each involving $m$ chains defining the common quaternary structure.

We assume a a mapping between chains is provided – see Def. def-chain-mapping. The corresponding options are the following ones:

The main options of the program $\sblrmsdflexprotkpax$ are:
–chain-mapping: The mapping between the chains which should be compared


The main options of the program $\sblrmsdflexprotapurva$ are:
–chain-mapping: The mapping between the chains which should be compared


Output. We report $\binom{n}{2}(m+1)$ numbers, corresponding to $m+1$ distance matrices, stored in $m+1$ files:

  • For each column of the mapping i.e. each chain, we report in a file the $\binom{n}{2}$ numbers corresponding to pairwise comparisons between the chains identified by the column – that is each entry corresponds to a comparison between two files.
  • The last file contains weighted lRMSD for all pairs of proteins. For a pair of proteins $P_i$ and $P_j$, we also mix the weighted lRMSD obtained by comparing their chains (pairwise).
$SBL_DIR/Applications/Molecular_distances_flexible/src/Molecular_distances_flexible/build/sbl-rmsd-flexible-proteins.exe --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains ABC --pdb-file data/pdb_files/TBEV.pdb --domain-labels data/spec_files/TBEV.spec --chains ABC --pdb-file data/pdb_files/EFF1.pdb --domain-labels data/spec_files/EFF1.spec --chains ABC --chain-mapping data/mapping.txt -d results/npnc -v -l --allow-incomplete-chains -p 3


../examples/results/nponec/sbl-rmsd-flexible-proteins__weighted_lrmsd_0.txt Distance matrix One file per chain mapping. Contains the distance matrix for the N proteins and a given chain.


Combined RMSD for conformations

Pre-requisites

Functionalities. The executable $\text{\sblrmsdflexconf}$ computes the $\text{\rmsdcomb}$ (vertex weighted) for conformations of a given protein. Note that a structural alignment is no longer necessary, instead the trivial identity alignment is computed. It behaves as follows:

  • Compares N conformations of the same molecule, on a pairwise basis. That is, for each pair, the $\lrmsd$ of specified structural units are computed, and combined into a $\rmsdcomb$.
  • If several chains are loaded (per conformation), a chain mapping is required – see Definition def-chain-mapping.

Note that the run scenarios are the same as the previous executable (see Pre-requisites). For example runs, the user is refered to Combined RMSD for proteins .

Combined RMSD for structural motifs

Pre-requisites

Structural motifs. As explained in the companion package Structural_motifs , structural motifs are regions showing a structural conservation higher than that of the structures defining them. For two structures, a motif is defined by two sets of a.a. in one-to-one correspondence – that is one set of a.a. on each structure.

Motif graph for overlapping motifs. When several motifs exist for two structures, an important question is to handle them coherently. Since motifs may overlap, we define:

(Motif graph) The motif graph of a list of motifs $\{ (\motifa{i}, \motifb{i}) \}_{i=1,\dots,p}$ is defined as follows: its node set is the union of the particles $A$ and $B$; its edge set is the union of two types of edges:
  • matching edges: the edges associated with the matchings defined by the motifs. NB: such edges are counted without multiplicity, that is, a matching edge present in several motifs is counted once.
  • motif edges: edges defining a path connecting all amino acids in a motif.
Consider a connected component (c.c.) of the motif graph. Restricting each c.c. to each structure yields two subgraphs. The set of all such subgraphs is denoted $\{ \motifacc{i}, \motifbcc{i} \}_{i=1,\dots,m}$.


Consider now the case where motifs have been defined for the two structures $A$ and $B$. We wish to compare $A$ and $B$ exploiting the information yielded by the connected components of the motif graph.

Consider the i-th c.c. of the motif graph. Let $e_i$ be the number of matching edges of this c.c. As usual, let $g(b_j)$ the position of atom $b_j$ from $\motifbcc{i}$ matched with atom $a_j$ from $\motifacc{i}$, upon applying a rigid motion $g$. We define:

The edge weighted $\lrmsdew$ of the i-th c.c. of the motif graph is defined by

\begin{align} \lrmsdew{\motifacc{i}}{\motifbcc{i}} &= \min_{g\in SE(3)} \sqrt{\frac{1}{e_i} \sum_{j=1}^{e_i} \vvnorm{a_j - g(b_j)}^2 } \end{align}

The rigid motion yielding the minimum is denoted $\lrmsdoptrm{i}$. The weight of the $\lrmsdew$ is defined as $\rmsdW{ew}{\motifacc{i}}{\motifbcc{i}} = e_i$.


This definition recalled, we note that the $\rmsdcomb$ from Eq. def-rmsd-comb generalizes, using edge weighted rather than vertex weighted $\rmsd$.

Using

The input requires two structures (PDB files) and a specification of motifs. The motifs are defined as an identifier followed by a list of aligned residues (example file below).

sbl-rmsd-flexible-motifs.exe --pdb-file data/pdb_files/SFV-1RER.pdb --chains A --pdb-file data/pdb-files/RVFV.pdf --motif-file data/motifs.txt --allow-incomplete-chains -p 3 -d results/motifs -v -l


The main options of the program $\sblrmsdflexmot$ are:
–pdb-file string: PDB file
–motif-file: Spec. file defining the motifs
–chains: Which chains to load


../examples/results/onepnc/sbl-rmsd-flexible-motifs_motif_graph.xml Motif graph XML archive containing all the residues in the motif graph components


Programmer's Workflow

Pre-requisites

The implementation rationale behind the three executables is straightforward. Each executable has a workflow consisiting of one loader (SBL::IO::T_Protein_representation_loader, see Protein_representation) and one module. There are two different modules used among the three workflows :

  • SBL::Modules::T_Subdomain_comparator_module< ModuleTraits > is used in the $\sblrmsdflexconf$ and $\sblrmsdflexprotkpax$ and $\sblrmsdflexprotapurva$ executables. It simply instantiates the pairwise comparisons between all the specified labels. In the former case, it uses the trivial identity alignment (from the ModuleTraits class), in the latter case, it uses Apurva.
  • SBL::Modules::T_RMSD_comb_for_motifs_module< ModuleTraits > is used in $\sblrmsdflexmot$. See Molecular_distances for more details.

Workflow example

The workflows are extremely basic. One out of the three is displayed below as an example.

T_Local_structural_comparison_workflow:

Jupyter demo

See the following jupyter notebook:

  • Jupyter notebook file
  • Molecular_distances_flexible

    Molecular_distances_flexible

    We illustrate calculations involving the so-called combined RMSD or RMSD Comb. As test case, we use class II fusion proteins, decomposing each each polypeptide chain into 23 regions (see preprint by Tetley et al).

    Preparing directories for the calculations to be carried out

    In [1]:
    import os
    import sys
    import pdb
    
    from SBL import SBL_pytools
    from SBL_pytools import SBL_pytools as sblpyt
    
    
    odir = "results-new"
    sdirs = ["n-pc-one-protein", "two-pc", "n-pc-two-proteins", "n-pc", "m-pc-n-proteins", "motifs"]
    
    for sdir in sdirs:
        w = "%s/%s" % (odir, sdir)
        if not os.path.exists(w):
            os.system( ("mkdir -p %s" % w) )
    

    Comparing n polypeptide chains of one protein: n-pc-one-protein

    • We report the matrix of RMSDcomb distances
    • Nb: calculations using kpax and apura are shown for the sake of completeness. But since the sequences of the three chains are identical, the alignments are trivial, and the results for kpax and apurva identical.
    In [2]:
    def cmp_proteins_with_aligner_n_pc_one_protein(aligner, aligner_tag):
    
        osdir = "n-pc-one-protein"
        cmd = "%s --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains ABC -d %s/%s -v -l" % (aligner,odir,osdir)
        os.system(cmd)
    
        ofn = "%s/%s/sbl-rmsd-flexible-proteins-%s__weighted_lrmsd.txt" % (odir,osdir,aligner_tag)
        sblpyt.show_text_file(ofn)
     
    aligner_kpax = "sbl-rmsd-flexible-proteins-kpax.exe"   # kpax
    cmp_proteins_with_aligner_n_pc_one_protein(aligner_kpax, "kpax")
    
    aligner_apurva = "sbl-rmsd-flexible-proteins-apurva.exe" # apurva
    cmp_proteins_with_aligner_n_pc_one_protein(aligner_apurva, "apurva")
    
    ++Showing file results-new/n-pc-one-protein/sbl-rmsd-flexible-proteins-kpax__weighted_lrmsd.txt
    	A	B	C
    A
    B	0.0316797
    C	0.150864	0.155959
    --Done
    
    
    
    ++Showing file results-new/n-pc-one-protein/sbl-rmsd-flexible-proteins-apurva__weighted_lrmsd.txt
    	A	B	C
    A
    B	0.0316797
    C	0.150864	0.155959
    --Done
    
    
    

    Comparing two polypeptide chains of two proteins

    • The decomposition of each chain is specified using labels
    • The RMSDcomb is reported
    In [3]:
    ## 2.4 Comparing two polypeptide chains: two-pc
    def cmp_proteins_with_aligner_two_pc(aligner, aligner_tag):
    
        osdir = "two-pc"
        cmd = "%s --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains A --pdb-file data/pdb_files/TBEV.pdb --domain-labels data/spec_files/TBEV.spec --chains A -d %s/%s -v -l --allow-incomplete-chains -p 3" % (aligner,odir,osdir)
        os.system(cmd)
    
        ofn = "%s/%s/sbl-rmsd-flexible-proteins-%s__labels_lrmsd.txt" % (odir,osdir,aligner_tag)
        sblpyt.show_text_file(ofn)
    
    aligner_kpax = "sbl-rmsd-flexible-proteins-kpax.exe"   # kpax
    cmp_proteins_with_aligner_two_pc(aligner_kpax, "kpax")
    
    aligner_apurva = "sbl-rmsd-flexible-proteins-apurva.exe" # apurva
    cmp_proteins_with_aligner_two_pc(aligner_apurva, "apurva")
    
    ++Showing file results-new/two-pc/sbl-rmsd-flexible-proteins-kpax__labels_lrmsd.txt
    Label comparison between chain A of SFV-1RER and chain A of TBEV
    A 2.969
    B 1.555
    B0 0.857
    C 0.373
    C0 0.394
    D0 1.379
    E 0.359
    E0 0.943
    F 1.136
    F0 0.514
    G 0.345
    G0 1.276
    H0 0.561
    I0 1.362
    a 0.503
    b 0.833
    c 1.228
    d 0.817
    e 0.650
    f 0.303
    g 0.150
    h -1.000
    i 0.609
    j 0.688
    k -1.000
    l -1.000
    --Done
    
    
    
    ++Showing file results-new/two-pc/sbl-rmsd-flexible-proteins-apurva__labels_lrmsd.txt
    Label comparison between chain A of SFV-1RER and chain A of TBEV
    A 2.969
    B 1.555
    B0 1.642
    C 0.691
    C0 0.590
    D0 2.125
    E 0.862
    E0 1.434
    F 1.136
    F0 1.013
    G 1.505
    G0 1.276
    H0 0.807
    I0 1.362
    a 0.503
    b 2.288
    c 1.826
    d 1.496
    e 0.650
    f 0.501
    g 1.288
    h -1.000
    i 1.619
    j 0.841
    k -1.000
    l -1.000
    --Done
    
    
    

    Comparing n polypeptide chains of two proteins

    • The decomposition of each chain is specified using labels
    • The matrix of all pairwise distances RMSDcomb (between pairs of chains) is reported
    In [4]:
     ## 2.5 Comparing n polypeptide chains of two proteins: n-pc-two-proteins
    def cmp_proteins_with_aligner_n_pc_two_proteins(aligner, aligner_tag):
    
        osdir = "n-pc-two-proteins"
        cmd = "%s --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains ABC --pdb-file data/pdb_files/TBEV.pdb --domain-labels data/spec_files/TBEV.spec --chains ABC -d %s/%s -v -l --allow-incomplete-chains -p 3" % (aligner,odir,osdir)
        os.system(cmd)
    
        ofn = "%s/%s/sbl-rmsd-flexible-proteins-%s__weighted_lrmsd.txt" % (odir,osdir,aligner_tag)
        sblpyt.show_text_file(ofn)
    
    
    aligner_kpax = "sbl-rmsd-flexible-proteins-kpax.exe"   # kpax
    cmp_proteins_with_aligner_n_pc_two_proteins(aligner_kpax, "kpax")
    
    aligner_apurva = "sbl-rmsd-flexible-proteins-apurva.exe" # apurva
    cmp_proteins_with_aligner_n_pc_two_proteins(aligner_apurva, "apurva")
    
    ++Showing file results-new/n-pc-two-proteins/sbl-rmsd-flexible-proteins-kpax__weighted_lrmsd.txt
    	SFV-1RER_A	SFV-1RER_B	SFV-1RER_C
    TBEV_A	1.167	1.171	1.185
    TBEV_B	1.165	1.168	1.203
    TBEV_C	1.161	1.164	1.199
    --Done
    
    
    
    ++Showing file results-new/n-pc-two-proteins/sbl-rmsd-flexible-proteins-apurva__weighted_lrmsd.txt
    	SFV-1RER_A	SFV-1RER_B	SFV-1RER_C
    TBEV_A	1.575	1.580	1.581
    TBEV_B	1.574	1.579	1.579
    TBEV_C	1.567	1.572	1.572
    --Done
    
    
    

    Comparing n polypeptide chains

    • The decomposition of each chain is specified using labels
    • The chain of interest in each file is specified
    • The matrix of all pairwise distances RMSDcomb (between pairs of chains) is reported
    In [5]:
    ## 2.6 Comparing n polypeptide chains: n-pc
    def cmp_proteins_with_aligner_n_pc(aligner, aligner_tag):
        osdir = "n-pc"
        cmd = "%s --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains A --pdb-file data/pdb_files/TBEV.pdb --domain-labels data/spec_files/TBEV.spec --chains A --pdb-file data/pdb_files/EFF1.pdb --domain-labels data/spec_files/EFF1.spec --chains A -d %s/%s -v -l --allow-incomplete-chains -p 3" % (aligner,odir,osdir)
        os.system(cmd)
    
        ofn = "%s/%s/sbl-rmsd-flexible-proteins-%s__weighted_lrmsd.txt" % (odir,osdir,aligner_tag)
        sblpyt.show_text_file(ofn)
    
    
    aligner_kpax = "sbl-rmsd-flexible-proteins-kpax.exe"   # kpax
    cmp_proteins_with_aligner_n_pc(aligner_kpax, "kpax")
     
    aligner_apurva = "sbl-rmsd-flexible-proteins-apurva.exe" # apurva
    cmp_proteins_with_aligner_n_pc(aligner_apurva, "apurva")
     
    
    ++Showing file results-new/n-pc/sbl-rmsd-flexible-proteins-kpax__weighted_lrmsd.txt
    	SFV-1RER	TBEV	EFF1
    SFV-1RER	0	1.167	0.973
    TBEV	1.167	0	1.127
    EFF1	0.973	1.127	0
    --Done
    
    
    
    ++Showing file results-new/n-pc/sbl-rmsd-flexible-proteins-apurva__weighted_lrmsd.txt
    	SFV-1RER	TBEV	EFF1
    SFV-1RER	0	1.575	1.356
    TBEV	1.575	0	1.539
    EFF1	1.356	1.539	0
    --Done
    
    
    

    Comparing m polypeptide chains of n proteins

    • As above, except that one matrix of RMSDcomb per chain is reported
    In [6]:
    ## 2.7 Comparing m polypeptide chains of n proteins: m-pc-n-proteins
    def cmp_proteins_with_aligner_m_pc_n_chains(aligner, aligner_tag):
        osdir = "m-pc-n-proteins"
        cmd = "%s --pdb-file data/pdb_files/SFV-1RER.pdb --domain-labels data/spec_files/SFV.spec --chains ABC --pdb-file data/pdb_files/TBEV.pdb --domain-labels data/spec_files/TBEV.spec --chains ABC --pdb-file data/pdb_files/EFF1.pdb --domain-labels data/spec_files/EFF1.spec --chains ABC --chain-mapping data/mapping.txt -d %s/%s -v -l --allow-incomplete-chains -p 3" % (aligner,odir,osdir)
        os.system(cmd)
    
        ofn0 = "%s/%s/sbl-rmsd-flexible-proteins-%s__weighted_lrmsd_chain_0.txt" % (odir,osdir, aligner_tag)
        ofn1 = "%s/%s/sbl-rmsd-flexible-proteins-%s__weighted_lrmsd_chain_1.txt" % (odir,osdir, aligner_tag)
        ofn2 = "%s/%s/sbl-rmsd-flexible-proteins-%s__weighted_lrmsd_chain_2.txt" % (odir,osdir, aligner_tag)
    
        sblpyt.show_text_file(ofn0)
        sblpyt.show_text_file(ofn1)
        sblpyt.show_text_file(ofn2)
    
    aligner_kpax = "sbl-rmsd-flexible-proteins-kpax.exe"   # kpax
    cmp_proteins_with_aligner_m_pc_n_chains(aligner_kpax, "kpax")
     
    aligner_apurva = "sbl-rmsd-flexible-proteins-apurva.exe" # apurva
    cmp_proteins_with_aligner_m_pc_n_chains(aligner_apurva, "apurva")
     
    
    ++Showing file results-new/m-pc-n-proteins/sbl-rmsd-flexible-proteins-kpax__weighted_lrmsd_chain_0.txt
    	SFV-1RER	TBEV	EFF1
    SFV-1RER			1.167	0.973
    TBEV	1.167			1.127
    EFF1	0.973	1.127
    --Done
    
    
    
    ++Showing file results-new/m-pc-n-proteins/sbl-rmsd-flexible-proteins-kpax__weighted_lrmsd_chain_1.txt
    	SFV-1RER	TBEV	EFF1
    SFV-1RER			1.168	0.858
    TBEV	1.168			1.128
    EFF1	0.858	1.128
    --Done
    
    
    
    ++Showing file results-new/m-pc-n-proteins/sbl-rmsd-flexible-proteins-kpax__weighted_lrmsd_chain_2.txt
    	SFV-1RER	TBEV	EFF1
    SFV-1RER			1.199	0.853
    TBEV	1.199			1.119
    EFF1	0.853	1.119
    --Done
    
    
    
    ++Showing file results-new/m-pc-n-proteins/sbl-rmsd-flexible-proteins-apurva__weighted_lrmsd_chain_0.txt
    	SFV-1RER	TBEV	EFF1
    SFV-1RER			1.575	1.356
    TBEV	1.575			1.539
    EFF1	1.356	1.539
    --Done
    
    
    
    ++Showing file results-new/m-pc-n-proteins/sbl-rmsd-flexible-proteins-apurva__weighted_lrmsd_chain_1.txt
    	SFV-1RER	TBEV	EFF1
    SFV-1RER			1.579	1.353
    TBEV	1.579			1.537
    EFF1	1.353	1.537
    --Done
    
    
    
    ++Showing file results-new/m-pc-n-proteins/sbl-rmsd-flexible-proteins-apurva__weighted_lrmsd_chain_2.txt
    	SFV-1RER	TBEV	EFF1
    SFV-1RER			1.572	1.367
    TBEV	1.572			1.531
    EFF1	1.367	1.531
    --Done
    
    
    

    Comparing proteins using precomputed motifs

    In [7]:
    # cmp proteins using motifs
    #i################################################################################
    def cmp_proteins_with_motifs():
        ## 4.2 Combined RMSD for structural motifs
        osdir = "motifs"
        aligner = "sbl-rmsd-flexible-motifs.exe"
        cmd = "%s --pdb-file data/pdb_files/SFV-1RER.pdb --chains A --pdb-file data/pdb_files/RVFV.pdb --motif-file data/motifs.txt --allow-incomplete-chains -p 3 -d %s/%s -v -l" % (aligner,odir,osdir)
        print(cmd)
        os.system(cmd)
    cmp_proteins_with_motifs()
    
    sbl-rmsd-flexible-motifs.exe --pdb-file data/pdb_files/SFV-1RER.pdb --chains A --pdb-file data/pdb_files/RVFV.pdb --motif-file data/motifs.txt --allow-incomplete-chains -p 3 -d results-new/motifs -v -l