You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/notebooks/advanced.ipynb
+51-2Lines changed: 51 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -560,6 +560,55 @@
560
560
"You can then prepare your system and run the analysis as you normally would."
561
561
]
562
562
},
563
+
{
564
+
"cell_type": "markdown",
565
+
"metadata": {},
566
+
"source": [
567
+
"### Ignoring specific residue pairs\n",
568
+
"\n",
569
+
"By default, ProLIF skips calculating interactions between a residue and itself, which typically happens when calculating interactions of a protein with itself:"
"You can define your own predicate function to decide which residue pairs should be ignored. This can be done through the `ignore` parameter of the `Fingerprint` constructor, which takes two {class}`~prolif.residue.Residue` objects as input and returns a boolean:"
"""Generates the fingerprint on a trajectory for a ligand and a protein
563
580
564
-
Parameters
565
-
----------
566
-
traj : MDAnalysis.coordinates.base.ProtoReader or MDAnalysis.coordinates.base.FrameIteratorSliced or MDAnalysis.coordinates.base.FrameIteratorIndices or MDAnalysis.coordinates.timestep.Timestep
567
-
Iterate over this Universe trajectory or sliced trajectory object
568
-
to extract the frames used for the fingerprint extraction
569
-
lig : MDAnalysis.core.groups.AtomGroup
570
-
An MDAnalysis AtomGroup for the ligand
571
-
prot : MDAnalysis.core.groups.AtomGroup
572
-
An MDAnalysis AtomGroup for the protein (with multiple residues)
573
-
residues : list or "all" or None
574
-
A list of protein residues (:class:`str`, :class:`int` or
575
-
:class:`~prolif.residue.ResidueId`) to take into account for
576
-
the fingerprint extraction. If ``"all"``, all residues will be
577
-
used. If ``None``, at each frame the
578
-
:func:`~prolif.utils.get_residues_near_ligand` function is used to
579
-
automatically use protein residues that are distant of 6.0 Å or
580
-
less from each ligand residue.
581
-
converter_kwargs : tuple[dict, dict], optional
582
-
Tuple of kwargs passed to the underlying
583
-
:class:`~MDAnalysis.converters.RDKit.RDKitConverter` from MDAnalysis: the
584
-
first for the ligand, and the second for the protein
585
-
progress : bool
586
-
Display a :class:`~tqdm.std.tqdm` progressbar while running the calculation
587
-
n_jobs : int or None
588
-
Number of processes to run in parallel. If ``n_jobs=1``, the analysis
589
-
will run in serial. If ``n_jobs=None``, see
590
-
:func:`~prolif.parallel.get_n_jobs` for the default behavior.
591
-
parallel_strategy : {"chunk", "queue"}, optional
592
-
Strategy for parallel execution:
593
-
594
-
- ``"chunk"``: Split trajectory into chunks and distribute to workers.
595
-
Each worker pickles the full MDAnalysis objects once per chunk.
596
-
Scales better for small trajectories.
597
-
- ``"queue"``: Main thread converts frames to Molecules and enqueues
598
-
them for workers. Avoids repeated MDAnalysis pickling overhead.
599
-
Better when pickling is expensive, e.g. large trajectories with many
600
-
atoms.
601
-
- ``None``: See :func:`~prolif.parallel.get_mda_parallel_strategy` for
602
-
the default behavior.
603
-
604
-
Raises
581
+
Parameters
582
+
----------
583
+
traj : MDAnalysis.coordinates.base.ProtoReader or MDAnalysis.coordinates.base.FrameIteratorSliced or MDAnalysis.coordinates.base.FrameIteratorIndices or MDAnalysis.coordinates.timestep.Timestep
584
+
Iterate over this Universe trajectory or sliced trajectory object
585
+
to extract the frames used for the fingerprint extraction
586
+
lig : MDAnalysis.core.groups.AtomGroup
587
+
An MDAnalysis AtomGroup for the ligand
588
+
prot : MDAnalysis.core.groups.AtomGroup
589
+
An MDAnalysis AtomGroup for the protein (with multiple residues)
590
+
residues : list or "all" or None
591
+
A list of protein residues (:class:`str`, :class:`int` or
592
+
:class:`~prolif.residue.ResidueId`) to take into account for
593
+
the fingerprint extraction. If ``"all"``, all residues will be
594
+
used. If ``None``, at each frame the
595
+
:func:`~prolif.utils.get_residues_near_ligand` function is used to
596
+
automatically use protein residues that are distant of 6.0 Å or
597
+
less from each ligand residue.
598
+
converter_kwargs : tuple[dict, dict], optional
599
+
Tuple of kwargs passed to the underlying
600
+
:class:`~MDAnalysis.converters.RDKit.RDKitConverter` from MDAnalysis: the
601
+
first for the ligand, and the second for the protein
602
+
progress : bool
603
+
Display a :class:`~tqdm.std.tqdm` progressbar while running the calculation
604
+
n_jobs : int or None
605
+
Number of processes to run in parallel. If ``n_jobs=1``, the analysis
606
+
will run in serial. If ``n_jobs=None``, see
607
+
:func:`~prolif.parallel.get_n_jobs` for the default behavior.
608
+
parallel_strategy : {"chunk", "queue"}, optional
609
+
Strategy for parallel execution:
610
+
611
+
- ``"chunk"``: Split trajectory into chunks and distribute to workers.
612
+
Each worker pickles the full MDAnalysis objects once per chunk.
613
+
Scales better for small trajectories.
614
+
- ``"queue"``: Main thread converts frames to Molecules and enqueues
615
+
them for workers. Avoids repeated MDAnalysis pickling overhead.
616
+
Better when pickling is expensive, e.g. large trajectories with many
617
+
atoms.
618
+
- ``None``: See :func:`~prolif.parallel.get_mda_parallel_strategy` for
619
+
the default behavior.
620
+
621
+
Raises
605
622
------
606
-
ValueError
607
-
If ``n_jobs <= 0``
623
+
ValueError
624
+
If ``n_jobs <= 0``
608
625
609
-
Returns
610
-
-------
611
-
prolif.fingerprint.Fingerprint
612
-
The Fingerprint instance that generated the fingerprint
626
+
Returns
627
+
-------
628
+
prolif.fingerprint.Fingerprint
629
+
The Fingerprint instance that generated the fingerprint
0 commit comments