# Path: ariba/flag.py
# class Error (Exception): pass
# class Flag:
#     def __init__(self, n=0):
#     def set_flag(self, n):
#     def add(self, f):
#     def to_number(self):
#     def __eq__(self, other):
#     def __str__(self):
#     def to_long_string(self):
#     def has(self, s):
#     def to_comma_separated_string(self):
# 
# Path: ariba/summary_cluster.py
# class Error (Exception): pass
# class SummaryCluster:
#     def __init__(self, min_pc_id=90):
#     def __eq__(self, other):
#     def line2dict(cls, line, filename=None):
#     def add_data_dict(self, data_dict):
#     def _pc_id_and_read_depth_of_longest(self):
#     def _has_any_part_of_ref_assembled(self):
#     def _to_cluster_summary_assembled(self):
#     def _has_known_variant(cls, data_dict):
#     def _has_any_known_variant(self):
#     def _has_nonsynonymous(cls, data_dict):
#     def _has_any_nonsynonymous(self):
#     def _has_novel_nonsynonymous(cls, data_dict):
#     def _has_any_novel_nonsynonymous(self):
#     def _to_cluster_summary_has_known_nonsynonymous(self, assembled_summary):
#     def _to_cluster_summary_has_novel_nonsynonymous(self, assembled_summary):
#     def _to_cluster_summary_has_nonsynonymous(self, assembled_summary):
#     def _get_known_noncoding_het_snp(data_dict):
#     def _get_nonsynonymous_var(data_dict):
#     def _has_match(self, assembled_summary):
#     def has_var_groups(self):
#     def column_summary_data(self):
#     def non_synon_variants(self):
#     def known_noncoding_het_snps(self):
#     def _get_all_nonsynon_variants_set(cls, data_dicts):
#     def gather_data(self):
# 
# Path: ariba/summary_cluster_variant.py
# class Error (Exception): pass
# class SummaryClusterVariant:
#     def __init__(self, data_dict):
#     def __eq__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def _has_nonsynonymous(cls, data_dict):
#     def _filter_depths(cls, ref_base, depths):
#     def _get_is_het_and_percent(cls, data_dict):
#     def _get_nonsynon_variant_data(self, data_dict):


import unittest
import os
from ariba import flag, summary_cluster, summary_cluster_variant
        '''Test _to_cluster_summary_assembled'''
        line = 'ariba_refname\trefname\t0\t0\t19\t78\tcluster\t120\t100\t98.33\tctg_name\t279\t24.4\t1\tSNP\tn\tA14T\t1\tA14T\tSNP\t13\t13\tA\t84\t84\tT\t17\tT\t17\tnoncoding1:0:0:A14T:id1:ref has wild type, foo bar\tsome free text'
        data_dict = summary_cluster.SummaryCluster.line2dict(line)

        tests = [
            ('0', 0, 'partial'),
            ('0', 64, 'no'),
            ('0', 1024, 'no'),
            ('0', 1, 'fragmented'),
            ('0', 3, 'yes_nonunique'),
            ('0', 19, 'yes'),
            ('0', 23, 'yes_nonunique'),
            ('0', 51, 'yes_nonunique'),
            ('0', 147, 'yes_nonunique'),
            ('0', 275, 'yes_nonunique'),
            ('1', 0, 'partial'),
            ('1', 64, 'no'),
            ('1', 1024, 'no'),
            ('1', 1, 'fragmented'),
            ('1', 11, 'yes_nonunique'),
            ('1', 27, 'yes'),
            ('1', 29, 'fragmented'),
            ('1', 59, 'yes_nonunique'),
            ('1', 155, 'yes_nonunique'),
            ('1', 283, 'yes_nonunique'),
        ]

        for gene, f, expected in tests:
            cluster = summary_cluster.SummaryCluster()
            data_dict['gene'] = gene

# Path: ariba/flag.py
# class Error (Exception): pass
# class Flag:
#     def __init__(self, n=0):
#     def set_flag(self, n):
#     def add(self, f):
#     def to_number(self):
#     def __eq__(self, other):
#     def __str__(self):
#     def to_long_string(self):
#     def has(self, s):
#     def to_comma_separated_string(self):
# 
# Path: ariba/summary_cluster.py
# class Error (Exception): pass
# class SummaryCluster:
#     def __init__(self, min_pc_id=90):
#     def __eq__(self, other):
#     def line2dict(cls, line, filename=None):
#     def add_data_dict(self, data_dict):
#     def _pc_id_and_read_depth_of_longest(self):
#     def _has_any_part_of_ref_assembled(self):
#     def _to_cluster_summary_assembled(self):
#     def _has_known_variant(cls, data_dict):
#     def _has_any_known_variant(self):
#     def _has_nonsynonymous(cls, data_dict):
#     def _has_any_nonsynonymous(self):
#     def _has_novel_nonsynonymous(cls, data_dict):
#     def _has_any_novel_nonsynonymous(self):
#     def _to_cluster_summary_has_known_nonsynonymous(self, assembled_summary):
#     def _to_cluster_summary_has_novel_nonsynonymous(self, assembled_summary):
#     def _to_cluster_summary_has_nonsynonymous(self, assembled_summary):
#     def _get_known_noncoding_het_snp(data_dict):
#     def _get_nonsynonymous_var(data_dict):
#     def _has_match(self, assembled_summary):
#     def has_var_groups(self):
#     def column_summary_data(self):
#     def non_synon_variants(self):
#     def known_noncoding_het_snps(self):
#     def _get_all_nonsynon_variants_set(cls, data_dicts):
#     def gather_data(self):
# 
# Path: ariba/summary_cluster_variant.py
# class Error (Exception): pass
# class SummaryClusterVariant:
#     def __init__(self, data_dict):
#     def __eq__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def _has_nonsynonymous(cls, data_dict):
#     def _filter_depths(cls, ref_base, depths):
#     def _get_is_het_and_percent(cls, data_dict):
#     def _get_nonsynon_variant_data(self, data_dict):


# Path: ariba/tests/summary_cluster_test.py
import unittest
import os
from ariba import flag, summary_cluster, summary_cluster_variant

        '''Test _to_cluster_summary_assembled'''
        line = 'ariba_refname\trefname\t0\t0\t19\t78\tcluster\t120\t100\t98.33\tctg_name\t279\t24.4\t1\tSNP\tn\tA14T\t1\tA14T\tSNP\t13\t13\tA\t84\t84\tT\t17\tT\t17\tnoncoding1:0:0:A14T:id1:ref has wild type, foo bar\tsome free text'
        data_dict = summary_cluster.SummaryCluster.line2dict(line)

        tests = [
            ('0', 0, 'partial'),
            ('0', 64, 'no'),
            ('0', 1024, 'no'),
            ('0', 1, 'fragmented'),
            ('0', 3, 'yes_nonunique'),
            ('0', 19, 'yes'),
            ('0', 23, 'yes_nonunique'),
            ('0', 51, 'yes_nonunique'),
            ('0', 147, 'yes_nonunique'),
            ('0', 275, 'yes_nonunique'),
            ('1', 0, 'partial'),
            ('1', 64, 'no'),
            ('1', 1024, 'no'),
            ('1', 1, 'fragmented'),
            ('1', 11, 'yes_nonunique'),
            ('1', 27, 'yes'),
            ('1', 29, 'fragmented'),
            ('1', 59, 'yes_nonunique'),
            ('1', 155, 'yes_nonunique'),
            ('1', 283, 'yes_nonunique'),
        ]

        for gene, f, expected in tests:
            cluster = summary_cluster.SummaryCluster()
            data_dict['gene'] = gene

            data_dict['flag'] = flag.Flag(f)