<commit_before>.. _signdy-overview:

Overview
===============================================================================

The first step in signature dynamics analysis is to collect a set of related 
protein structures and build a :class:`.PDBEnsemble`. This can be achieved by 
multiple routes: a query search of the PDB using :func:`.blastPDB` or 
:func:`.searchDali`, extraction of PDB IDs from the Pfam or CATH database, or 
input of a pre-defined list. 

We demonstrate the `Dali`_ method here in the first part of the tutorial. The usage of 
`Pfam`_ and `CATH`_ methods are described in the database tutorial (under construction) 
and the function :func:`.blastPDB` is described in the `Structure Analysis Tutorial`_.

We apply these methods to the PBP-I domains, a group of protein structures originally 
found in bacteria for transport of solutes across the periplasmic space and later 
seen in various eukaryotic receptors including ionotropic and metabotropic glutamate 
receptors. We use the N-terminal domain of AMPA receptor subunit GluA2 (gene name 
`GRIA2 <https://www.uniprot.org/uniprot/P42262>`_) as a query.

First, make necessary imports from ProDy and Matplotlib packages if you haven't already.

.. ipython:: python

   from prody import *
   from pylab import *
   ion()

Prepare ensemble (using Dali)
-------------------------------------------------------------------------------

First we use the function :func:`.searchDali` to search the PDB, which returns a 
:class:`.DaliRecord` object that contains a list of PDB IDs and their corresponding 
mappings to the reference structure. 

.. ipython:: python

   dali_rec = searchDali('3H5V','A')
   dali_rec

Next, we get the lists of PDB IDs and mappings from *dali_rec*, parse the *pdb_ids* 
to get a list of :class:`.AtomGroup` instances:

.. ipython:: python

   pdb_ids = dali_rec.getPDBs()
   mappings = dali_rec.getMappings()

.. ipython:: python

   pdbs = parsePDB(*pdb_ids, subset='ca')
   len(pdbs)<commit_msg>filter out PDBs in the dali_rec<commit_after>.. _signdy-overview:

Overview
===============================================================================

The first step in signature dynamics analysis is to collect a set of related 
protein structures and build a :class:`.PDBEnsemble`. This can be achieved by 
multiple routes: a query search of the PDB using :func:`.blastPDB` or 
:func:`.searchDali`, extraction of PDB IDs from the Pfam or CATH database, or 
input of a pre-defined list. 

We demonstrate the `Dali`_ method here in the first part of the tutorial. The usage of 
`Pfam`_ and `CATH`_ methods are described in the database tutorial (under construction) 
and the function :func:`.blastPDB` is described in the `Structure Analysis Tutorial`_.

We apply these methods to the PBP-I domains, a group of protein structures originally 
found in bacteria for transport of solutes across the periplasmic space and later 
seen in various eukaryotic receptors including ionotropic and metabotropic glutamate 
receptors. We use the N-terminal domain of AMPA receptor subunit GluA2 (gene name 
`GRIA2 <https://www.uniprot.org/uniprot/P42262>`_) as a query.

First, make necessary imports from ProDy and Matplotlib packages if you haven't already.

.. ipython:: python

   from prody import *
   from pylab import *
   ion()

Prepare ensemble (using Dali)
-------------------------------------------------------------------------------

First we use the function :func:`.searchDali` to search the PDB, which returns a 
:class:`.DaliRecord` object that contains a list of PDB IDs and their corresponding 
mappings to the reference structure. 

.. ipython:: python

   dali_rec = searchDali('3H5V','A')
   dali_rec

Next, we get the lists of PDB IDs and mappings from *dali_rec*, parse the *pdb_ids* 
to get a list of :class:`.AtomGroup` instances:

.. ipython:: python

   pdb_ids = dali_rec.filter(cutoff_len=0.7, cutoff_rmsd=1.0, cutoff_Z=10)
   mappings = dali_rec.getMappings()

.. ipython:: python

   pdbs = parsePDB(*pdb_ids, subset='ca')
   len(pdbs)
{'fraction_non_alphanumeric': 0.14750061561191824, 'fraction_numerical': 0.005909874415168678, 'mean_word_length': 3.668965517241379, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '961044', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1145, 'n_words': 496}