Skip to content

Commit

Permalink
updated all links in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Simkovic committed Jul 30, 2018
1 parent 516f3d2 commit 8487874
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 38 deletions.
25 changes: 13 additions & 12 deletions docs/examples/rst/python_analyse_conpred.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ Contact Prediction Analysis
>>> conpred.sequence = conkit.io.read("toxd/toxd.fasta", "fasta").top_sequence
>>> conpred.set_sequence_register()
Note, we've chosen the top contact map immediately because this file only contained a single one. We also added the sequence straight away and assigned the sequence register using the :func:`set_sequence_register() <conkit.core.ContactMap.set_sequence_register>` function. The latter makes sure that each residue number has the right amino acid assigned.
Note, we've chosen the top :obj:`~conkit.core.contactmap.ContactMap` immediately because this file only contained a single one. We also added the sequence straight away and assigned the sequence register using the :meth:`~conkit.core.contactmap.ContactMap.set_sequence_register` function. The latter makes sure that each residue number has the right amino acid assigned.

2. **Plotting a contact map**
2. **Plotting a :obj:`conkit.core.contactmap.ContactMap`**

Similar to the example on plotting a contact map, this is something you will almost certainly do every single time you obtain a contact prediction. Head over to the :ref:`contact map plotting example <python_plot_map>` in case you haven't looked at it.
Similar to the example on plotting a :obj:`~conkit.core.contactmap.ContactMap`, this is something you will almost certainly do every single time you obtain a contact prediction. Head over to the :ref:`python_plot_map` example in case you haven't looked at it.

Let's assume we have created the following contact map plot
Let's assume we have created the following :obj:`conkit.core.contactmap.ContactMap` plot

.. figure:: ../images/toxd_cmap_simple.png
:alt: Toxd CMap Simple
:scale: 30

Looking at this contact map tells us that there is most likely a |beta|-strand between residues 13-23 and 33-34. The spread of the contacts also gives us an indication that we are dealing with a monomeric protein structure. However, our contact prediction contains a lot more information that is not visible from this plot.
Looking at this :obj:`conkit.core.contactmap.ContactMap` tells us that there is most likely a |beta|-strand between residues 13-23 and 33-34. The spread of the contacts also gives us an indication that we are dealing with a monomeric protein structure. However, our contact prediction contains a lot more information that is not visible from this plot.


3. **Looking at individual residues**

Assume you have prior knowledge about the protein target, in this case PDB entry `1DTX <http://www.rcsb.org/pdb/explore/explore.do?structureId=1dtx>`_. Let's assume that this prior knowledge includes information about a residue, e.g. residue 34. As a result, we might want to look at all contacts related to residue 34 in our contact map to see specifically if any relevant contacts were predicted.
Assume you have prior knowledge about the protein target, in this case PDB entry `1DTX <http://www.rcsb.org/pdb/explore/explore.do?structureId=1dtx>`_. Let's assume that this prior knowledge includes information about a residue, e.g. residue 34. As a result, we might want to look at all contacts related to residue 34 in our :obj:`conkit.core.contactmap.ContactMap` to see specifically if any relevant contacts were predicted.

In ConKit, we can use the :func:`find() <conkit.core.ContactMap.find>` function to extract all contacts containing one or more residues.
In ConKit, we can use the :meth:`~conkit.core.contactmap.ContactMap.find` function to extract all contacts containing one or more residues.

.. code-block:: python
Expand All @@ -41,7 +41,7 @@ In ConKit, we can use the :func:`find() <conkit.core.ContactMap.find>` function
This print statement in the last line indicates that there a total of 59 contacts are associated with residue 34. Let's rank them to see the most confidently predicted contact involving residue 34.

We use the :func:`sort() <conkit.core.ContactMap.sort>` function for ranking our map. We want to sort it by the ``raw_score`` in reverse order, i.e. largest values at the top of the list. We don't want to create a new contact map but instead apply the changes to the existing one, thus we use the ``inplace=True`` keyword argument.
We use :meth:`~conkit.core.contactmap.ContactMap.sort` for ranking our map. We want to sort it by the :attr:`~conkit.core.contact.Contact.raw_score` in reverse order, i.e. largest values at the top of the list. We don't want to create a new :obj:`~conkit.core.contactmap.ContactMap` but instead apply the changes to the existing one, thus we use the ``inplace=True`` keyword argument.

.. code-block:: python
Expand All @@ -50,7 +50,7 @@ We use the :func:`sort() <conkit.core.ContactMap.sort>` function for ranking our
Contact(id="(21, 34)" res1="P" res1_chain="" res1_seq=21 res2="R" res2_chain="" res2_seq=34 raw_score=0.459334760904)
This shows that the most confidently predicted contact is between residues 21 and 34 with a prediction score of 0.46. Considering our contact map from the step 2, this information would make sense as we assumed |beta|-sheet in that region of residues.
This shows that the most confidently predicted contact is between residues 21 and 34 with a prediction score of 0.46. Considering our :obj:`conkit.core.contactmap.ContactMap` from the step 2, this information would make sense as we assumed |beta|-sheet in that region of residues.

4. **Calculating the precision score**

Expand All @@ -60,7 +60,7 @@ This shows that the most confidently predicted contact is between residues 21 an

Finally, in some cases you either have already existing structural information, such as a crystal structure, or a predicted model and you want to assess how accurate or satisfied your contact prediction is. For this kind of analysis, the precision score is the ideal measure. It compares one set of contacts against a second and calculates the ratio between the matches and the total number of contacts compared.

In ConKit, this functionality is provided via the :attr:`precision <conkit.core.ContactMap.precision>` attribute of each contact map. If we want to use the latter, we need to :func:`match() <conkit.core.ContactMap.match>` the two contact maps first. The following Python code shows the entire process.
In ConKit, this functionality is provided via the :attr:`~conkit.core.contactmap.ContactMap.precision` attribute of each :obj:`~conkit.core.contactmap.ContactMap`. If we want to use the latter, we need to :meth:`~conkit.core.contactmap.ContactMap.match` the two :obj:`~conkit.core.contactmap.ContactMap`'s first. The following Python code shows the entire process.

.. code-block:: python
Expand All @@ -73,7 +73,7 @@ In ConKit, this functionality is provided via the :attr:`precision <conkit.core.
The output from this final ``print`` statement tells us that the precision score for the 59 most confidently predicted contacts is 0.59.

We could also ask for the first 30 contacts only or the last 20. Each contact map understands Python slices, and thus any fraction can be successfully extracted.
We could also ask for the first 30 contacts only or the last 20. Each :obj:`conkit.core.contactmap.ContactMap` understands Python slices, and thus any fraction can be successfully extracted.

.. code-block:: python
Expand All @@ -88,7 +88,8 @@ We could also ask for the first 30 contacts only or the last 20. Each contact ma
As you can see, it's simple to calculate late it for the three different factors ``0.5``, ``1.0`` and ``1.5``, i.e. ``L/2``, ``L`` and ``3L/2``.

If you would like to automate this process, or rather visualise the data, you can use the `PrecisionEvaluationFigure <conkit.plot.PrecisionEvaluationPlot.PrecisionEvaluationFigure>` class. It accepts a **matched** contact map and calculates the precision values at different thresholds to produce a plot.
If you would like to automate this process, or rather visualise the data, you can use the :obj:`~conkit.plot.precisionevaluation.PrecisionEvaluationFigure` class. It accepts a **matched** :obj:`~conkit.core.contactmap.ContactMap` and calculates the precision values at different thresholds to produce a plot.


To produce a precision evaluation plot with factors between 0.0 and 5.0 with a stepwise increase of 0.1, use the following command.

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rst/python_analyse_msa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Multiple Sequence Alignment Analysis
------------------------------------

.. warning::
You require the optional dependency `SciPy <http://scipy.org/>`_ package to use this script. If you are unsure if it is installed on your system, refer to the :ref:`Installation` documentation
You require the :mod:`scipy` package to use this script. If you are unsure if it is installed on your system, refer to the :ref:`Installation` documentation

**1. The MSA ConKit hierarchy needs to be created first.**

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/rst/python_convert_conpred.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ File Format Conversion
In order to convert files in ConKit, we need to use the ConKit I/O framework.

.. note::
ConKit I/O framework consists of three main functions that handle the relevant parsers: :func:`read() <conkit.io.read>`, :func:`write() <conkit.io.write>` and :func:`convert() <conkit.io.convert>`. The latter effectively uses the former two but handles everything in one step.
ConKit I/O framework consists of three main functions that handle the relevant parsers: :func:`~conkit.io.read`, :func:`~conkit.io.write` and :func:`~conkit.io.convert`. The latter effectively uses the former two but handles everything in one step.

**1. Files can be read in ConKit's internal hierarchies using simple Python code.**

Expand All @@ -22,7 +22,7 @@ In order to convert files in ConKit, we need to use the ConKit I/O framework.
>>> import conkit.io
>>> conkit.io.write('toxd/toxd.rr', 'casprr', conpred)
**3. To convert file formats in single call, you can use the :func:`conkit.io.convert` function.**
**3. To convert file formats in single call, you can use the :func:`~conkit.io.convert` function.**

.. code-block:: python
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/rst/python_convert_msa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ File Format Conversion
In order to convert files in ConKit, we need to use the ConKit I/O framework.

.. note::
ConKit I/O framework consists of three main functions that handle the relevant parsers: :func:`read() <conkit.io.read>`, :func:`write() <conkit.io.write>` and :func:`convert() <conkit.io.convert>`. The latter effectively uses the former two but handles everything in one step.
ConKit I/O framework consists of three main functions that handle the relevant parsers: :func:`~conkit.io.read`, :func:`~conkit.io.write` and :func:`~conkit.io.convert`. The latter effectively uses the former two but handles everything in one step.

**1. Files can be read in ConKit's internal hierarchies using simple Python code.**

Expand All @@ -22,7 +22,7 @@ In order to convert files in ConKit, we need to use the ConKit I/O framework.
>>> import conkit.io
>>> conkit.io.write('toxd/toxd.mfa', 'fasta', msa)
**3. To convert file formats in single call, you can use the :func:`conkit.io.convert` function.**
**3. To convert file formats in single call, you can use the :func:`~conkit.io.convert` function.**

.. code-block:: python
Expand Down
18 changes: 9 additions & 9 deletions docs/examples/rst/python_create_contactfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ If you wish to construct it as part of a new development to store your contact i
Entities
++++++++

**1. How to create a Contact?**
**1. How to create a :obj:`~conkit.core.contact.Contact`?**

.. code-block:: python
>>> from conkit.core import Contact
>>> contact = Contact(1, 10, 1.0)
The example above creates a contact between residues ``1`` and ``10`` and assigns a ``raw_score`` of ``1.0`` to it. By default, this contact has many more default attributes assigned, such as the distance value often seen in columns 3 and 4 in the Casp RR format.
The example above creates a contact between residues ``1`` and ``10`` and assigns a :attr:`~conkit.core.contact.Contact.raw_score` of ``1.0`` to it. By default, this contact has many more default attributes assigned, such as the distance value often seen in columns 3 and 4 in the Casp RR format.

**2. How to create a ContactMap?**
**2. How to create a :obj:`~conkit.core.contactmap.ContactMap`?**

.. code-block:: python
>>> from conkit.core import ContactMap
>>> cmap = ContactMap('example')
This example shows you how to create a :obj:`ContactMap <conkit.core.ContactMap>` which can store a :obj:`Contact <conkit.core.Contact>`.
This example shows you how to create a :obj:`~conkit.core.contactmap.ContactMap` which can store a :obj:`~conkit.core.contact.Contact`.

**3. How to create a ContactFile?**
**3. How to create a :obj:`~conkit.core.contactfile.ContactFile`?**

.. code-block:: python
>>> from conkit.core import ContactFile
>>> cmap = ContactFile('example')
This example shows you how to create a :obj:`ContactFile <conkit.core.ContactFile>` which can store a :obj:`ContactMap <conkit.core.ContactMap>`.
This example shows you how to create a :obj:`~conkit.core.contactfile.ContactFile` which can store a :obj:`~conkit.core.contactmap.ContactMap`.

Hierarchy
+++++++++

Above is an outline for the different contact-related entities. Each higher entity allows you to store one or more lower-level ones, i.e. you can store one or more :obj:`ContactMap <conkit.core.ContactMap>` entities in a single :obj:`ContactFile <conkit.core.ContactFile>`. Similarly, you could many :obj:`Contact <conkit.core.Contact>` entities in a :obj:`ContactMap <conkit.core.ContactMap>`; however, be aware that all **must** have unique IDs.
Above is an outline for the different contact-related :obj:`~conkit.core.entity.Entity` classes. Each higher entity allows you to store one or more lower-level ones, i.e. you can store one or more :obj:`~conkit.core.contactmap.ContactMap` entities in a single :obj:`~conkit.core.contactfile.ContactFile`. Similarly, you could many :obj:`~conkit.core.contact.Contact` entities in a :obj:`~conkit.core.contactmap.ContactMap`; however, be aware that all **must** have unique IDs.

To illustrate how you can combine the entities, look at the following:
To illustrate how you can combine the :obj:`~conkit.core.entity.Entity` classes, look at the following:

.. code-block:: python
Expand All @@ -53,6 +53,6 @@ To illustrate how you can combine the entities, look at the following:
>>> # Add the contact map to the contact file
>>> cfile.add(cmap)
Note, the order in which you add entities does not matter. We could also add the ``cmap`` to the ``cfile`` before adding the ``contact`` to the ``cmap``.
Note, the order in which you add :obj:`~conkit.core.entity.Entity` instances does not matter. We could also add the ``cmap`` to the ``cfile`` before adding the ``contact`` to the ``cmap``.

Once you have constructed your hierarchy, all related functions are available to you.
17 changes: 8 additions & 9 deletions docs/examples/rst/python_create_sequencefile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,40 @@ If you wish to construct it as part of a new development to store your sequence
Entities
++++++++

1. **How to create a Sequence?**
1. **How to create a :obj:`~conkit.core.sequence.Sequence`?**

.. code-block:: python
>>> import conkit.core
>>> seq = conkit.core.Sequence("example", "ABCDEF")
The example above creates a :obj:`Sequence <conkit.core.Sequence>` object with id "example" and sequence "ABCDEF". This sequence contains numerous functions, such as :func:`align_global() <conkit.core.Sequence.align_global>` for a global pairwise alignment with a second sequence
The example above creates a :obj:`~conkit.core.sequence.Sequence` object with id "example" and sequence "ABCDEF". This sequence contains numerous functions, such as :meth:`~conkit.core.sequence.Sequence.align_global` for a global pairwise alignment with a second sequence

2. **How to create a SequenceFile?**
2. **How to create a :obj:`~conkit.core.sequencefile.SequenceFile`?**

.. code-block:: python
>>> import conkit.core
>>> sfile = conkit.core.SequenceFile("example)
>>> sfile = conkit.core.SequenceFile("example")
This example shows you how to create a :obj:`SequenceFile <conkit.core.SequenceFile>` which can store one or more :obj:`Sequence <conkit.core.Sequence>` objects.
This example shows you how to create a :obj:`~conkit.core.sequencefile.SequenceFile` which can store one or more :obj:`~conkit.core.sequence.Sequence` objects.

Hierarchy
+++++++++

Above is an outline for the different sequence-related entities. Each higher entity allows you to store one or more lower-level ones, i.e. you can store one or more :obj:`Sequence <conkit.core.Sequence>` entities in a single :obj:`SequenceFile <conkit.core.SequenceFile>`; however, be aware that all **must** have unique IDs.
Above is an outline for the different sequence-related :obj:`~conkit.core.entity.Entity` classes. Each higher entity allows you to store one or more lower-level ones, i.e. you can store one or more :obj:`~conkit.core.sequence.Sequence` entities in a single :obj:`~conkit.core.sequencefile.SequenceFile`; however, be aware that all **must** have unique IDs.

To illustrate how you can combine the entities, look at the following:

.. code-block:: python
>>> import conkit.core
>>> sfile = conkit.core.SequenceFile("example)
>>> sfile = conkit.core.SequenceFile("example")
>>> seq1 = conkit.core.Sequence("example", "ABCDEF")
>>> seq2 = conkit.core.Sequence("elpmaxe", "FEDCBA")
>>> # Add the sequences to the sequence file
>>> sfile.add(seq1)
>>> sfile.add(seq2)
Note, the order in which you add entities does not matter.
Note, the order in which you add :obj:`~conkit.core.entity.Entity` instances does not matter.

Once you have constructed your hierarchy, all related functions are available to you.
2 changes: 1 addition & 1 deletion docs/examples/rst/python_plot_chord.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Contact Map Chord Diagram Plotting
:alt: Toxd Chord Simple
:scale: 30

Each residue in the Chord plot corresponds to an amino acid in your sequence. For a full list of the encoding used, check the :obj:`ContactMapChordFigure <conkit.plot.ContactMapChordPlot.ContactMapChordFigure>`.
Each residue in the Chord plot corresponds to an amino acid in your sequence. For a full list of the encoding used, check the :obj:`ContactMapChordFigure <conkit.plot.contactmapchord.ContactMapChordFigure>`.

.. role:: ala
.. role:: cys
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rst/script_analyse_msa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Multiple Sequence Alignment Analysis
------------------------------------

.. warning::
You require the optional dependency `SciPy <http://scipy.org/>`_ package to use this script. If you are unsure if it is installed on your system, refer to the :ref:`Installation` documentation
You require the :mod:`scipy` package to use this script. If you are unsure if it is installed on your system, refer to the :ref:`Installation` documentation


If you would like to analyse a Multiple Sequence Alignment (MSA) file, you can do so using ConKit's provided script, which is called ``conkit-msatool``.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rst/script_plot_chord.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The call above uses the contact prediction file ``toxd.mat`` file, which is in `
:align: center
:scale: 30

Each residue in the Chord plot corresponds to an amino acid in your sequence. For a full list of the encoding used, check the :obj:`ContactMapChordFigure <conkit.plot.ContactMapChordPlot.ContactMapChordFigure>`.
Each residue in the Chord plot corresponds to an amino acid in your sequence. For a full list of the encoding used, check the :obj:`~conkit.plot.contactmapchord.ContactMapChordFigure`.

.. role:: ala
.. role:: cys
Expand Down

0 comments on commit 8487874

Please sign in to comment.