Commit 106514c2 authored by Pauline Pommeret's avatar Pauline Pommeret

Adding supervised learning-related features

parent 9a140f0f
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
""" """
Main module of the Xylok project Main module of the Xylok project
Author: Pauline Pommeret Author: Pauline Pommeret, Jonas Senizergues
Jonas Senizergues
Defines: Defines:
- :py:class:`Sequence` - :py:class:`Sequence`
...@@ -79,9 +78,17 @@ class Sequence(object): ...@@ -79,9 +78,17 @@ class Sequence(object):
# self.sequence using self.trx_scale_path # self.sequence using self.trx_scale_path
self.trx = {} self.trx = {}
# Stores md_parameters for computation
self.md_parameters = md_parameters
# Populates some of the attributes # Populates some of the attributes
self.load_fasta(fasta) self.load_fasta(fasta)
self.load_md(md_parameters)
def do_analysis(self):
"""
Compute complex data from parameters.
"""
self.load_md()
self.load_trx() self.load_trx()
def get(self, name, default): def get(self, name, default):
...@@ -149,7 +156,7 @@ class Sequence(object): ...@@ -149,7 +156,7 @@ class Sequence(object):
self.accession = str(parsed_sequence.id.split("|")[3]) self.accession = str(parsed_sequence.id.split("|")[3])
self.description = str(parsed_sequence.description) self.description = str(parsed_sequence.description)
def load_md(self, md_parameters): def load_md(self):
# XXX # XXX
""" """
Loads MD files and populates: Loads MD files and populates:
...@@ -158,7 +165,6 @@ class Sequence(object): ...@@ -158,7 +165,6 @@ class Sequence(object):
Parameters: Parameters:
- ``self`` - ``self``
- ``md_parameters`` : dictionary {..., "helicoidal param": path, ...}
Uses: Uses:
- :py:meth:`lib.file_tools:load_md_data` - :py:meth:`lib.file_tools:load_md_data`
...@@ -177,7 +183,7 @@ class Sequence(object): ...@@ -177,7 +183,7 @@ class Sequence(object):
# -*- Populating self.mdd -*- # # -*- Populating self.mdd -*- #
# Iterates on every helicoidal parameter file # Iterates on every helicoidal parameter file
for (helicoidal_parameter, path) in md_parameters.iteritems(): for (helicoidal_parameter, path) in self.md_parameters.iteritems():
# Loads the file # Loads the file
_md_params[helicoidal_parameter] = file_tools.load_md_data(path) _md_params[helicoidal_parameter] = file_tools.load_md_data(path)
......
Markdown is supported
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