# 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/report.py
# class Error (Exception): pass
# def header_line():
# def _samtools_depths_at_known_snps_all_wild(sequence_meta, contig_name, cluster, variant_list):
# def _report_lines_for_one_contig(cluster, contig_name, ref_cov_per_contig, pymummer_variants):
# def report_lines(cluster):
# 
# 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):


from ariba import flag, report, summary_cluster_variant
        for d in self.data:
            if d['ref_base_assembled'] > longest:
                longest = d['ref_base_assembled']
                identity = d['pc_ident']
                depth = d['ctg_cov']

        return identity, depth


    def _has_any_part_of_ref_assembled(self):
        for d in self.data:
            if isinstance(d['ref_base_assembled'], int) and d['ref_base_assembled'] > 0:
                return True

        return False


    def _to_cluster_summary_assembled(self):
        if len(self.data) == 0:
            return 'no'

        if self.data[0]['gene'] == '0':
            has_complete_gene = True
        else:
            has_complete_gene = self.flag.has('complete_gene')

        if self.flag.has('assembly_fail') or self.flag.has('ref_seq_choose_fail'):
            return 'no'
        elif not self.flag.has('assembled'):
            return 'partial' if self._has_any_part_of_ref_assembled() else 'no'

# 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/report.py
# class Error (Exception): pass
# def header_line():
# def _samtools_depths_at_known_snps_all_wild(sequence_meta, contig_name, cluster, variant_list):
# def _report_lines_for_one_contig(cluster, contig_name, ref_cov_per_contig, pymummer_variants):
# def report_lines(cluster):
# 
# 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/summary_cluster.py
from ariba import flag, report, summary_cluster_variant

        for d in self.data:
            if d['ref_base_assembled'] > longest:
                longest = d['ref_base_assembled']
                identity = d['pc_ident']
                depth = d['ctg_cov']

        return identity, depth


    def _has_any_part_of_ref_assembled(self):
        for d in self.data:
            if isinstance(d['ref_base_assembled'], int) and d['ref_base_assembled'] > 0:
                return True

        return False


    def _to_cluster_summary_assembled(self):
        if len(self.data) == 0:
            return 'no'

        if self.data[0]['gene'] == '0':
            has_complete_gene = True
        else:
            has_complete_gene = self.flag.has('complete_gene')

        if self.flag.has('assembly_fail') or self.flag.has('ref_seq_choose_fail'):
            return 'no'
        elif not self.flag.has('assembled'):
            return 'partial' if self._has_any_part_of_ref_assembled() else 'no'

        elif self.flag.has('assembled_into_one_contig') and has_complete_gene: