<commit_before>'''
Created on Apr 18, 2013

@author: jmht
'''

import copy
import cPickle
import logging
import os
import re
import shutil
import sys

# our imports
import ample_util
import cluster_with_MAX
import pdb_edit
import printTable
import run_spicker

class EnsembleData(object):
    """Class to hold data about an ensemble"""
    
    def __init(self):
        
        self.name = None 
        self.num_models = None
        self.num_residues = None
        self.num_atoms = None
        self.residues = []
        
        self.side_chain_treatment = None
        self.radius_threshold = None
        self.truncation_threshold = None
        
        self.pdb = None # path to the ensemble file


class Ensembler(object):
    """Class to generate ensembles from cluster of models"""
    
    def __init__(self):
        """Initialise"""
        
        # Directory where all files generated
        self.work_dir = None
        
        # Directory where the final ensembles end up
        self.ensemble_dir = None
        
        # cluster of models to work from
        self.cluster_models = []
        
        # Percent of residues to keep under each truncation level
        self.percent= None
        
        # theseus variance file
        self.variance_log = None<commit_msg>Added a more helpful __str__ method for the data object<commit_after>'''
Created on Apr 18, 2013

@author: jmht
'''

import copy
import cPickle
import logging
import os
import re
import shutil
import sys
import types


# our imports
import ample_util
import cluster_with_MAX
import pdb_edit
import printTable
import run_spicker

class EnsembleData(object):
    """Class to hold data about an ensemble"""
    
    def __init(self):
        
        self.name = None 
        self.num_models = None
        self.num_residues = None
        self.num_atoms = None
        self.residues = []
        
        self.side_chain_treatment = None
        self.radius_threshold = None
        self.truncation_threshold = None
        
        self.pdb = None # path to the ensemble file

    def __str__(self):
        """List the data attributes of this object"""
        me = {}
        for slot in dir(self):
            attr = getattr(self, slot)
            if not slot.startswith("__") and not ( isinstance(attr, types.MethodType) or
              isinstance(attr, types.FunctionType) ):
                me[slot] = attr
            
        return "{0} : {1}".format(self.__repr__(),str(me))
    
class Ensembler(object):
    """Class to generate ensembles from cluster of models"""
    
    def __init__(self):
        """Initialise"""
        
        # Directory where all files generated
        self.work_dir = None
        
        # Directory where the final ensembles end up
        self.ensemble_dir = None
        
        # cluster of models to work from
        self.cluster_models = []
        
        # Percent of residues to keep under each truncation level
        self.percent= None
        
        # theseus variance file
        self.variance_log = None
{'fraction_non_alphanumeric': 0.07040417209908735, 'fraction_numerical': 0.0045632333767926985, 'mean_word_length': 2.056772908366534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5685732', 'n_tokens_mistral': 874, 'n_tokens_neox': 824, 'n_words': 280}