Commit ea7e6a43 authored by Fabrice Allain's avatar Fabrice Allain Committed by Fabrice ALLAIN
Browse files

*: Fix bug during pdf generation in analysis command; Added analysis example for bpt1

parent bfa30ae0
......@@ -2,6 +2,7 @@
## <small>0.0.18 (2018-04-23)</small>
* docs: Added bpt1 setup in examples ([a76abff](https://gitlab.pasteur.fr/bis-aria/Ariaec/commit/a76abff))
* docs: Added link to example archive in docs ([9ec966b](https://gitlab.pasteur.fr/bis-aria/Ariaec/commit/9ec966b))
* docs: updated changelog ([ceececc](https://gitlab.pasteur.fr/bis-aria/Ariaec/commit/ceececc))
* docs: updated changelog ([95d3f62](https://gitlab.pasteur.fr/bis-aria/Ariaec/commit/95d3f62))
* docs: Updated changelog (removed old tags) ([a59416d](https://gitlab.pasteur.fr/bis-aria/Ariaec/commit/a59416d))
......
Version: 0.0.18
\ No newline at end of file
Version: 0.0.20
\ No newline at end of file
......@@ -10,7 +10,7 @@ import csv
import datetime
import itertools
import logging
import matplotlib
import matplotlib; matplotlib.use("Agg")
import numpy as np
import operator
import os
......@@ -30,7 +30,7 @@ from ..core.legacy import AminoAcid as AminoAcid
from .common import (tickmin, tickrot, titleprint, addtup)
from .ndconv import net_deconv
matplotlib.use("Agg", warn=False)
LOG = logging.getLogger(__name__)
# TODO: check dataframe symmetry or always use unstack
# TODO: objet MapContainer contenant les differentes maps en attributs ! (et
......@@ -364,7 +364,7 @@ class ProteinMap(Map):
@property
def contact_flags(self):
return self._contact_flags
return self._evflags
def create_heatmap(self):
"""
......@@ -503,7 +503,7 @@ class ProteinMap(Map):
Returns
-------
"""
plotpath = os.path.join(outdir, "%s.maplot.%s" % (
outprefix, plot_ext))
......@@ -565,23 +565,18 @@ class ProteinMap(Map):
def compareplot(self, protmap, save_fig=True, alpha=None, **kwargs):
"""
Compare 2 contact map and plot differences
Compare 2 contact map and plot the differences
Parameters
----------
protmap :
param save_fig:
alpha :
param kwargs: (Default value = None)
save_fig :
(Default value = True)
**kwargs :
alpha :
kwargs :
Returns
-------
"""
self.plotflush()
# Contact map plot
......
......@@ -327,11 +327,13 @@ class MapFile(RegexFile):
"""
self.conioflag = kwargs.pop("conkit_reader") \
if "conkit_reader" in kwargs else False
self.checkflag = kwargs.pop("check_type") \
if "check_type" in kwargs else True
super(MapFile, self).__init__(*args, **kwargs)
if not self.conioflag:
if not self.conioflag and self.checkflag:
LOG.info("Conkit doesn't support {ftype}".format(
ftype=self.filetype))
LOG.info("Using {module} module".format(module=__name__))
LOG.debug("Using {module}".format(module=__name__))
self.regex, self.filetype, self.sort = self.check_maptype()
self.mapdict = {"alldistmap": None,
"allcontactmap": None,
......@@ -727,9 +729,8 @@ class PDBFile(MapFile):
def __init__(self, *args, **kwargs):
# TODO: use PDB object in aria
# TODO: write dataframe in a separated file
self.check_type = False
super(PDBFile, self).__init__(*args, regex=self.pdbreg, filetype="pdb",
**kwargs)
check_type=False, **kwargs)
def create_map(self, protein, contactdef, groupby_method="min", scsc=None,
flaglist=None, sym=True, path=""):
......@@ -760,7 +761,8 @@ class PDBFile(MapFile):
flaglist=flaglist, path=path,
seqidx=protein.index, desc=self.filetype)
# noinspection PyTypeChecker
resmap[:] = self.update_map(resmap, sym=sym)
resmap = self.update_map(resmap, sym=sym)
# df.combine_first(d2)
LOG.debug("pdb distance map:\n%s", resmap)
self.mapdict["alldistmap"] = resmap
self.mapdict["distmap"] = resmap.reduce(groupby=groupby_method)
......@@ -931,12 +933,10 @@ class MapFileListReader(object):
if os.path.exists(filepath):
# TODO: check_type functionstr
LOG.debug("Adding %s file to watchlist", maptypes[i])
if (maptypes[i].lower() == "pdb" and
os.path.splitext(filepath)[1][1:] == "pdb") or (
maptypes[i].lower() == "distfile" and
os.path.splitext(filepath)[1][1:] == "pdb"):
self.maps.append(PDBFile(filepath))
if maptypes[i].lower() == "pdb" or (
maptypes[i].lower() == "distfile" and
os.path.splitext(filepath)[-1][1:] == "pdb"):
self.maps.append(PDBFile(filepath))
# TODO: find another solution in the future since
# conio.CONTACT_FILE_PARSERS might be deprecated
elif maptypes[i].lower() in conio.CONTACT_FILE_PARSERS:
......
......@@ -191,11 +191,10 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# documentation.
#
html_theme_options = {
'logo_only': True
'logo_only': False
}
# html_logo = "_static/logo.jpg"
html_logo = "_static/ariaec_blue.png"
# html_logo = "_static/ariaec_blue.png"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
......
......@@ -17,7 +17,47 @@ Contact map analysis
.. code-block:: console
> ariaec -o examples/bpt1/out maplot examples/bpt1/data/BPT1_BOVIN.fa examples/bpt1/data/BPT1_BOVIN.indextableplus examples/bpt1/.native.aligned.pdb $< -t pdb contactlist maplot --onlyreport $(DATADIR)/$${prot}/$${prot}.fa $${psipred_file} $(DATADIR)/$${prot}/$${prot}.native.aligned.pdb $< -t pdb contactlist
> ariaec -o examples/bpt1/out maplot examples/bpt1/data/BPT1_BOVIN.fa examples/bpt1/data/BPT1_BOVIN.indextableplus examples/bpt1/data/BPT1_BOVIN.native.aligned.pdb examples/bpt1/data/BPT1_BOVIN_contacts.gremlin.out -t pdb gremlin
**Output**
.. code-block:: console
================================================================================
ARIA Evolutive Contact toolbox
================================================================================
INFO Initialize settings
INFO Making output directories
reading FASTA file examples/bpt1/data/BPT1_BOVIN.fa
INFO Amino acid sequence: FCLEPPYTGPCKARIIRYFYNAKAGLCQTFVYGGCRAKRNNFKSAEDCMRTCG
INFO Checking if file examples/bpt1/data/BPT1_BOVIN.indextableplus correspond to indextableplus format
INFO Format type correct (indextableplus)
INFO Reading secondary structure file examples/bpt1/data/BPT1_BOVIN.indextableplus [indextableplus]
INFO Loading ss dist file
INFO Reading distance file /baycells/home/fallain/Projects/ariaec/bin/python/Ariaec/aria/conbox/data/ss_dist.txt
INFO Align secondary structure sequence with protein sequence
INFO Reader focused on file(s) ['examples/bpt1/data/BPT1_BOVIN.native.aligned.pdb', 'examples/bpt1/data/BPT1_BOVIN_contacts.gremlin.out'] ['pdb', 'gremlin']
INFO Reading examples/bpt1/data/BPT1_BOVIN.native.aligned.pdb file
INFO Updating distance map with pdb file
INFO Generate contact map using contact definition defaultdict(None, {'bool': None, 'default_cutoff': 8.0})
INFO Using default cutoff
INFO Reading examples/bpt1/data/BPT1_BOVIN_contacts.gremlin.out file
INFO Pdb map set as reference
INFO Generate contact map plot (examples/bpt1/out/BPT1_BOVIN.maplot.pdf)
INFO Generate contact file (examples/bpt1/out/BPT1_BOVIN_native_aligned.contact.txt)
INFO Generate map report file (examples/bpt1/out/mapreport)
INFO Generate roc file (examples/bpt1/out/graphics/maplot.roc.csv)
INFO Generate roc plot (examples/bpt1/out/graphics/maplot.roc.pdf)
INFO Generate precall file (examples/bpt1/out/graphics/maplot.roc.csv)
INFO Generate precall plot (examples/bpt1/out/graphics/maplot.precall.pdf)
INFO Generate contact file (examples/bpt1/out/BPT1_BOVIN_contacts_gremlin.contact.txt)
INFO Generate stat file (examples/bpt1/out/maplot.contactcmp.csv)
INFO Contact list: [(1, 39), (1, 42), (1, 51), (3, 22), (3, 25), (3, 45), (3, 47), (3, 51), (4, 23), (4, 38), (4, 39), (4, 42), (4, 49), (5, 23), (6, 19), (7, 37), (8, 12), (8, 31), (8, 33), (9, 19), (9, 34), (9, 37), (9, 41), (10, 33), (10, 36), (11, 33), (11, 35), (12, 8), (12, 20), (12, 31), (12, 33), (13, 33), (13, 34), (14, 31), (14, 33), (14, 36), (15, 31), (16, 29), (16, 31), (17, 41), (17, 43), (18, 28), (18, 29), (18, 45), (19, 6), (19, 9), (19, 28), (19, 29), (20, 12), (20, 25), (20, 27), (21, 28), (22, 3), (22, 25), (22, 28), (23, 4), (23, 5), (23, 26), (23, 29), (23, 43), (24, 28), (25, 3), (25, 20), (25, 22), (25, 28), (25, 46), (25, 53), (26, 23), (27, 20), (27, 48), (27, 52), (28, 18), (28, 19), (28, 21), (28, 22), (28, 24), (28, 25), (29, 16), (29, 18), (29, 19), (29, 23), (30, 33), (30, 37), (30, 38), (31, 8), (31, 12), (31, 14), (31, 15), (31, 16), (32, 37), (32, 38), (32, 40), (32, 41), (33, 8), (33, 10), (33, 11), (33, 12), (33, 13), (33, 14), (33, 30), (34, 9), (34, 13), (34, 37), (35, 11), (36, 10), (36, 14), (36, 39), (36, 50), (37, 7), (37, 9), (37, 30), (37, 32), (37, 34), (37, 41), (38, 4), (38, 30), (38, 32), (38, 41), (39, 1), (39, 4), (39, 36), (40, 32), (41, 9), (41, 17), (41, 32), (41, 37), (41, 38), (42, 1), (42, 4), (43, 17), (43, 23), (43, 47), (44, 47), (45, 3), (45, 18), (45, 49), (46, 25), (46, 49), (46, 50), (47, 3), (47, 43), (47, 44), (47, 51), (48, 27), (48, 52), (49, 4), (49, 45), (49, 46), (49, 53), (50, 36), (50, 46), (50, 53), (51, 1), (51, 3), (51, 47), (52, 27), (52, 48), (53, 25), (53, 49), (53, 50)]
INFO Generate contact map plot (examples/bpt1/out/.maplot.pdf)
Setup
-----
......@@ -26,7 +66,7 @@ Setup
> ariaec -o examples/bpt1/out -c examples/bpt1/data/config.ini setup examples/bpt1/data/BPT1_BOVIN.fa examples/bpt1/data/BPT1_BOVIN_contacts.gremlin.out -t gremlin -s examples/bpt1/data/BPT1_BOVIN.indextableplus
The output should look like this
**Output**
.. code-block:: console
......@@ -89,6 +129,8 @@ ARIA Setup
> aria2 -s examples/bpt1/out/ariaproject.xml
**Output**
.. code-block:: console
ARIA Version 2.3.2. Authors: Benjamin Bardiaux, Michael Habeck, Jens Linge,
......@@ -118,6 +160,8 @@ ARIA Run
> aria2 examples/bpt1/out/ariaproject.xml
**Output**
.. code-block:: console
ARIA Version 2.3.2. Authors: Benjamin Bardiaux, Michael Habeck, Jens Linge,
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment