"""
DO NOT EDIT THIS FILE!!
This file is automatically generated by the process_schemas.py program
in the scripts directory. It is not intended to be edited directly. If
you need to update the GEL protocol classes, please run the script
on the appropriate schema version.
"""
from protocols.protocol import ProtocolElement
from protocols.protocol import SearchRequest
from protocols.protocol import SearchResponse
from protocols.protocol import avro_parse

import avro.schema

version = '0.1.0'


class AnalysisParameters(ProtocolElement):
    """
    The configuration parameters used for the analysis
    """
    _schemaSource = """
{"type": "record", "name": "AnalysisParameters", "namespace": "org.gel.models.coverage.avro", "doc":
"", "fields": [{"name": "coding_region_stats_enabled", "type": "boolean", "doc": ""}, {"name":
"exon_stats_enabled", "type": "boolean", "doc": ""}, {"name": "wg_stats_enabled", "type": "boolean",
"doc": ""}, {"name": "gene_list", "type": ["null", {"type": "array", "items": "string"}], "doc":
""}, {"name": "panel", "type": ["null", "string"], "doc": ""}, {"name": "panel_version", "type":
["null", "string"], "doc": ""}, {"name": "panelapp_host", "type": ["null", "string"], "doc": ""},
{"name": "panelapp_gene_confidence", "type": ["null", "string"], "doc": ""}, {"name":
"transcript_filtering_biotypes", "type": "string", "doc": ""}, {"name":
"transcript_filtering_flags", "type": "string", "doc": ""}, {"name": "cellbase_host", "type":
"string", "doc": ""}, {"name": "cellbase_version", "type": "string", "doc": ""}, {"name": "grch37",
"type": "string", "doc": ""}, {"name": "species", "type": "string", "doc": ""}, {"name":
"exon_padding", "type": "int", "doc": ""}, {"name": "gap_coverage_threshold", "type": "int", "doc":
""}, {"name": "gap_length_threshold", "type": "int", "doc": ""}, {"name": "input_file", "type":
"string", "doc": ""}, {"name": "configuration_file", "type": "string", "doc": ""}, {"name":
"wg_regions", "type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "cellbase_host",
        "cellbase_version",
        "coding_region_stats_enabled",
        "configuration_file",
        "exon_padding",
        "exon_stats_enabled",
        "gap_coverage_threshold",
        "gap_length_threshold",
        "gene_list",
        "grch37",
        "input_file",
        "panel",
        "panel_version",
        "panelapp_gene_confidence",
        "panelapp_host",
        "species",
        "transcript_filtering_biotypes",
        "transcript_filtering_flags",
        "wg_regions",
        "wg_stats_enabled",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'cellbase_host', 'cellbase_version',
        'coding_region_stats_enabled', 'configuration_file',
        'exon_padding', 'exon_stats_enabled',
        'gap_coverage_threshold', 'gap_length_threshold', 'gene_list',
        'grch37', 'input_file', 'panel', 'panel_version',
        'panelapp_gene_confidence', 'panelapp_host', 'species',
        'transcript_filtering_biotypes', 'transcript_filtering_flags',
        'wg_regions', 'wg_stats_enabled'
    ]

    def __init__(self, **kwargs):
        self.cellbase_host = kwargs.get(
            'cellbase_host', None)
        self.cellbase_version = kwargs.get(
            'cellbase_version', None)
        self.coding_region_stats_enabled = kwargs.get(
            'coding_region_stats_enabled', None)
        self.configuration_file = kwargs.get(
            'configuration_file', None)
        self.exon_padding = kwargs.get(
            'exon_padding', None)
        self.exon_stats_enabled = kwargs.get(
            'exon_stats_enabled', None)
        self.gap_coverage_threshold = kwargs.get(
            'gap_coverage_threshold', None)
        self.gap_length_threshold = kwargs.get(
            'gap_length_threshold', None)
        self.gene_list = kwargs.get(
            'gene_list', None)
        self.grch37 = kwargs.get(
            'grch37', None)
        self.input_file = kwargs.get(
            'input_file', None)
        self.panel = kwargs.get(
            'panel', None)
        self.panel_version = kwargs.get(
            'panel_version', None)
        self.panelapp_gene_confidence = kwargs.get(
            'panelapp_gene_confidence', None)
        self.panelapp_host = kwargs.get(
            'panelapp_host', None)
        self.species = kwargs.get(
            'species', None)
        self.transcript_filtering_biotypes = kwargs.get(
            'transcript_filtering_biotypes', None)
        self.transcript_filtering_flags = kwargs.get(
            'transcript_filtering_flags', None)
        self.wg_regions = kwargs.get(
            'wg_regions', None)
        self.wg_stats_enabled = kwargs.get(
            'wg_stats_enabled', None)


class AnalysisResults(ProtocolElement):
    """
    The output of a coverage analysis
    """
    _schemaSource = """
{"type": "record", "name": "AnalysisResults", "namespace": "org.gel.models.coverage.avro", "doc":
"", "fields": [{"name": "results", "type": {"type": "record", "name": "CoverageAnalysisResults",
"doc": "", "fields": [{"name": "genes", "type": {"type": "array", "items": {"type": "record",
"name": "Gene", "doc": "", "fields": [{"name": "trs", "type": {"type": "array", "items": {"type":
"record", "name": "Transcript", "doc": "", "fields": [{"name": "id", "type": "string", "doc": ""},
{"name": "stats", "type": {"type": "record", "name": "RegionStatistics", "doc": "", "fields":
[{"name": "avg", "type": "float", "doc": ""}, {"name": "sd", "type": "float", "doc": ""}, {"name":
"med", "type": "float", "doc": ""}, {"name": "gc", "type": ["null", "float"], "doc": ""}, {"name":
"pct75", "type": "float", "doc": ""}, {"name": "pct25", "type": "float", "doc": ""}, {"name":
"bases", "type": ["null", "int"], "doc": ""}, {"name": "bases_lt_15x", "type": ["null", "int"],
"doc": ""}, {"name": "bases_gte_15x", "type": ["null", "int"], "doc": ""}, {"name": "bases_gte_30x",
"type": ["null", "int"], "doc": ""}, {"name": "bases_gte_50x", "type": ["null", "int"], "doc": ""},
{"name": "gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type": "float", "doc": ""},
{"name": "gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type": "float", "doc": ""},
{"name": "rmsd", "type": ["null", "float"], "doc": ""}]}, "doc": ""}, {"name": "exons", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Exon", "doc": "", "fields":
[{"name": "exon", "type": "string", "doc": ""}, {"name": "s", "type": "int", "doc": ""}, {"name":
"padded_s", "type": ["null", "int"], "doc": ""}, {"name": "e", "type": "int", "doc": ""}, {"name":
"padded_e", "type": ["null", "int"], "doc": ""}, {"name": "l", "type": ["null", "int"], "doc": ""},
{"name": "gaps", "type": {"type": "array", "items": {"type": "record", "name": "CoverageGap", "doc":
"", "fields": [{"name": "s", "type": "int", "doc": ""}, {"name": "e", "type": "int", "doc": ""},
{"name": "l", "type": ["null", "int"], "doc": ""}]}}, "doc": ""}, {"name": "stats", "type":
"RegionStatistics", "doc": ""}]}}], "doc": ""}]}}, "doc": ""}, {"name": "union_tr", "type":
"Transcript", "doc": ""}, {"name": "name", "type": "string", "doc": ""}, {"name": "chr", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "coding_region", "type": ["null", {"type": "record",
"name": "CodingRegion", "doc": "", "fields": [{"name": "stats", "type": "RegionStatistics", "doc":
""}, {"name": "chrs", "type": {"type": "array", "items": {"type": "record", "name": "Chromosome",
"doc": "", "fields": [{"name": "chr", "type": "string", "doc": ""}, {"name": "avg", "type": "float",
"doc": ""}, {"name": "sd", "type": "float", "doc": ""}, {"name": "med", "type": "float", "doc": ""},
{"name": "gc", "type": ["null", "float"], "doc": ""}, {"name": "pct75", "type": "float", "doc": ""},
{"name": "pct25", "type": "float", "doc": ""}, {"name": "bases", "type": "int", "doc": ""}, {"name":
"gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type": "float", "doc": ""}, {"name":
"gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type": "float", "doc": ""}, {"name":
"rmsd", "type": ["null", "float"], "doc": ""}]}}, "doc": ""}]}], "doc": ""}, {"name":
"whole_genome", "type": ["null", {"type": "record", "name": "WholeGenome", "fields": [{"name":
"stats", "type": "RegionStatistics", "doc": ""}, {"name": "chrs", "type": {"type": "array", "items":
"Chromosome"}, "doc": ""}]}], "doc": ""}, {"name": "uncovered_genes", "type": {"type": "array",
"items": {"type": "record", "name": "UncoveredGene", "doc": "", "fields": [{"name": "chr", "type":
"string", "doc": ""}, {"name": "name", "type": "string", "doc": ""}, {"name": "s", "type": ["null",
"int"], "doc": ""}, {"name": "e", "type": ["null", "int"], "doc": ""}]}}, "doc": ""}]}, "doc": ""},
{"name": "parameters", "type": {"type": "record", "name": "AnalysisParameters", "doc": "", "fields":
[{"name": "coding_region_stats_enabled", "type": "boolean", "doc": ""}, {"name":
"exon_stats_enabled", "type": "boolean", "doc": ""}, {"name": "wg_stats_enabled", "type": "boolean",
"doc": ""}, {"name": "gene_list", "type": ["null", {"type": "array", "items": "string"}], "doc":
""}, {"name": "panel", "type": ["null", "string"], "doc": ""}, {"name": "panel_version", "type":
["null", "string"], "doc": ""}, {"name": "panelapp_host", "type": ["null", "string"], "doc": ""},
{"name": "panelapp_gene_confidence", "type": ["null", "string"], "doc": ""}, {"name":
"transcript_filtering_biotypes", "type": "string", "doc": ""}, {"name":
"transcript_filtering_flags", "type": "string", "doc": ""}, {"name": "cellbase_host", "type":
"string", "doc": ""}, {"name": "cellbase_version", "type": "string", "doc": ""}, {"name": "grch37",
"type": "string", "doc": ""}, {"name": "species", "type": "string", "doc": ""}, {"name":
"exon_padding", "type": "int", "doc": ""}, {"name": "gap_coverage_threshold", "type": "int", "doc":
""}, {"name": "gap_length_threshold", "type": "int", "doc": ""}, {"name": "input_file", "type":
"string", "doc": ""}, {"name": "configuration_file", "type": "string", "doc": ""}, {"name":
"wg_regions", "type": ["null", "string"], "doc": ""}]}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "parameters",
        "results",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'parameters': AnalysisParameters,
            'results': CoverageAnalysisResults,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'parameters': AnalysisParameters,
            'results': CoverageAnalysisResults,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'parameters', 'results'
    ]

    def __init__(self, **kwargs):
        self.parameters = kwargs.get(
            'parameters', AnalysisParameters())
        self.results = kwargs.get(
            'results', CoverageAnalysisResults())


class Chromosome(ProtocolElement):
    """
    All coverage information about a given chromosome
    """
    _schemaSource = """
{"type": "record", "name": "Chromosome", "namespace": "org.gel.models.coverage.avro", "doc": "",
"fields": [{"name": "chr", "type": "string", "doc": ""}, {"name": "avg", "type": "float", "doc":
""}, {"name": "sd", "type": "float", "doc": ""}, {"name": "med", "type": "float", "doc": ""},
{"name": "gc", "type": ["null", "float"], "doc": ""}, {"name": "pct75", "type": "float", "doc": ""},
{"name": "pct25", "type": "float", "doc": ""}, {"name": "bases", "type": "int", "doc": ""}, {"name":
"gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type": "float", "doc": ""}, {"name":
"gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type": "float", "doc": ""}, {"name":
"rmsd", "type": ["null", "float"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "avg",
        "bases",
        "chr",
        "gc",
        "gte15x",
        "gte30x",
        "gte50x",
        "lt15x",
        "med",
        "pct25",
        "pct75",
        "rmsd",
        "sd",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'avg', 'bases', 'chr', 'gc', 'gte15x', 'gte30x', 'gte50x',
        'lt15x', 'med', 'pct25', 'pct75', 'rmsd', 'sd'
    ]

    def __init__(self, **kwargs):
        self.avg = kwargs.get(
            'avg', None)
        self.bases = kwargs.get(
            'bases', None)
        self.chr = kwargs.get(
            'chr', None)
        self.gc = kwargs.get(
            'gc', None)
        self.gte15x = kwargs.get(
            'gte15x', None)
        self.gte30x = kwargs.get(
            'gte30x', None)
        self.gte50x = kwargs.get(
            'gte50x', None)
        self.lt15x = kwargs.get(
            'lt15x', None)
        self.med = kwargs.get(
            'med', None)
        self.pct25 = kwargs.get(
            'pct25', None)
        self.pct75 = kwargs.get(
            'pct75', None)
        self.rmsd = kwargs.get(
            'rmsd', None)
        self.sd = kwargs.get(
            'sd', None)


class CodingRegion(ProtocolElement):
    """
    All coverage information about the coding region
    """
    _schemaSource = """
{"type": "record", "name": "CodingRegion", "namespace": "org.gel.models.coverage.avro", "doc": "",
"fields": [{"name": "stats", "type": {"type": "record", "name": "RegionStatistics", "doc": "",
"fields": [{"name": "avg", "type": "float", "doc": ""}, {"name": "sd", "type": "float", "doc": ""},
{"name": "med", "type": "float", "doc": ""}, {"name": "gc", "type": ["null", "float"], "doc": ""},
{"name": "pct75", "type": "float", "doc": ""}, {"name": "pct25", "type": "float", "doc": ""},
{"name": "bases", "type": ["null", "int"], "doc": ""}, {"name": "bases_lt_15x", "type": ["null",
"int"], "doc": ""}, {"name": "bases_gte_15x", "type": ["null", "int"], "doc": ""}, {"name":
"bases_gte_30x", "type": ["null", "int"], "doc": ""}, {"name": "bases_gte_50x", "type": ["null",
"int"], "doc": ""}, {"name": "gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type":
"float", "doc": ""}, {"name": "gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type":
"float", "doc": ""}, {"name": "rmsd", "type": ["null", "float"], "doc": ""}]}, "doc": ""}, {"name":
"chrs", "type": {"type": "array", "items": {"type": "record", "name": "Chromosome", "doc": "",
"fields": [{"name": "chr", "type": "string", "doc": ""}, {"name": "avg", "type": "float", "doc":
""}, {"name": "sd", "type": "float", "doc": ""}, {"name": "med", "type": "float", "doc": ""},
{"name": "gc", "type": ["null", "float"], "doc": ""}, {"name": "pct75", "type": "float", "doc": ""},
{"name": "pct25", "type": "float", "doc": ""}, {"name": "bases", "type": "int", "doc": ""}, {"name":
"gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type": "float", "doc": ""}, {"name":
"gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type": "float", "doc": ""}, {"name":
"rmsd", "type": ["null", "float"], "doc": ""}]}}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "chrs",
        "stats",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'chrs': Chromosome,
            'stats': RegionStatistics,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'chrs': Chromosome,
            'stats': RegionStatistics,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'chrs', 'stats'
    ]

    def __init__(self, **kwargs):
        self.chrs = kwargs.get(
            'chrs', None)
        self.stats = kwargs.get(
            'stats', RegionStatistics())


class CoverageAnalysisResults(ProtocolElement):
    """
    Coverage analysis results
    """
    _schemaSource = """
{"type": "record", "name": "CoverageAnalysisResults", "namespace": "org.gel.models.coverage.avro",
"doc": "", "fields": [{"name": "genes", "type": {"type": "array", "items": {"type": "record",
"name": "Gene", "doc": "", "fields": [{"name": "trs", "type": {"type": "array", "items": {"type":
"record", "name": "Transcript", "doc": "", "fields": [{"name": "id", "type": "string", "doc": ""},
{"name": "stats", "type": {"type": "record", "name": "RegionStatistics", "doc": "", "fields":
[{"name": "avg", "type": "float", "doc": ""}, {"name": "sd", "type": "float", "doc": ""}, {"name":
"med", "type": "float", "doc": ""}, {"name": "gc", "type": ["null", "float"], "doc": ""}, {"name":
"pct75", "type": "float", "doc": ""}, {"name": "pct25", "type": "float", "doc": ""}, {"name":
"bases", "type": ["null", "int"], "doc": ""}, {"name": "bases_lt_15x", "type": ["null", "int"],
"doc": ""}, {"name": "bases_gte_15x", "type": ["null", "int"], "doc": ""}, {"name": "bases_gte_30x",
"type": ["null", "int"], "doc": ""}, {"name": "bases_gte_50x", "type": ["null", "int"], "doc": ""},
{"name": "gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type": "float", "doc": ""},
{"name": "gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type": "float", "doc": ""},
{"name": "rmsd", "type": ["null", "float"], "doc": ""}]}, "doc": ""}, {"name": "exons", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Exon", "doc": "", "fields":
[{"name": "exon", "type": "string", "doc": ""}, {"name": "s", "type": "int", "doc": ""}, {"name":
"padded_s", "type": ["null", "int"], "doc": ""}, {"name": "e", "type": "int", "doc": ""}, {"name":
"padded_e", "type": ["null", "int"], "doc": ""}, {"name": "l", "type": ["null", "int"], "doc": ""},
{"name": "gaps", "type": {"type": "array", "items": {"type": "record", "name": "CoverageGap", "doc":
"", "fields": [{"name": "s", "type": "int", "doc": ""}, {"name": "e", "type": "int", "doc": ""},
{"name": "l", "type": ["null", "int"], "doc": ""}]}}, "doc": ""}, {"name": "stats", "type":
"RegionStatistics", "doc": ""}]}}], "doc": ""}]}}, "doc": ""}, {"name": "union_tr", "type":
"Transcript", "doc": ""}, {"name": "name", "type": "string", "doc": ""}, {"name": "chr", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "coding_region", "type": ["null", {"type": "record",
"name": "CodingRegion", "doc": "", "fields": [{"name": "stats", "type": "RegionStatistics", "doc":
""}, {"name": "chrs", "type": {"type": "array", "items": {"type": "record", "name": "Chromosome",
"doc": "", "fields": [{"name": "chr", "type": "string", "doc": ""}, {"name": "avg", "type": "float",
"doc": ""}, {"name": "sd", "type": "float", "doc": ""}, {"name": "med", "type": "float", "doc": ""},
{"name": "gc", "type": ["null", "float"], "doc": ""}, {"name": "pct75", "type": "float", "doc": ""},
{"name": "pct25", "type": "float", "doc": ""}, {"name": "bases", "type": "int", "doc": ""}, {"name":
"gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type": "float", "doc": ""}, {"name":
"gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type": "float", "doc": ""}, {"name":
"rmsd", "type": ["null", "float"], "doc": ""}]}}, "doc": ""}]}], "doc": ""}, {"name":
"whole_genome", "type": ["null", {"type": "record", "name": "WholeGenome", "fields": [{"name":
"stats", "type": "RegionStatistics", "doc": ""}, {"name": "chrs", "type": {"type": "array", "items":
"Chromosome"}, "doc": ""}]}], "doc": ""}, {"name": "uncovered_genes", "type": {"type": "array",
"items": {"type": "record", "name": "UncoveredGene", "doc": "", "fields": [{"name": "chr", "type":
"string", "doc": ""}, {"name": "name", "type": "string", "doc": ""}, {"name": "s", "type": ["null",
"int"], "doc": ""}, {"name": "e", "type": ["null", "int"], "doc": ""}]}}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "coding_region",
        "genes",
        "uncovered_genes",
        "whole_genome",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coding_region': CodingRegion,
            'genes': Gene,
            'uncovered_genes': UncoveredGene,
            'whole_genome': WholeGenome,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coding_region': CodingRegion,
            'genes': Gene,
            'uncovered_genes': UncoveredGene,
            'whole_genome': WholeGenome,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'coding_region', 'genes', 'uncovered_genes', 'whole_genome'
    ]

    def __init__(self, **kwargs):
        self.coding_region = kwargs.get(
            'coding_region', None)
        self.genes = kwargs.get(
            'genes', None)
        self.uncovered_genes = kwargs.get(
            'uncovered_genes', None)
        self.whole_genome = kwargs.get(
            'whole_genome', None)


class CoverageGap(ProtocolElement):
    """
    A gap in coverage. A gap is a contiguous region under a certain
    depth of coverage.     There are two thresholds to define at
    analysis time: * The depth of coverage threshold under which a gap
    is considered * The number of consecutive positions under the
    depth of coverage threshold to call a gap      e.g.: we may
    consider a gap those regions of more than 5 consecutive bp under
    15x
    """
    _schemaSource = """
{"type": "record", "name": "CoverageGap", "namespace": "org.gel.models.coverage.avro", "doc": "",
"fields": [{"name": "s", "type": "int", "doc": ""}, {"name": "e", "type": "int", "doc": ""},
{"name": "l", "type": ["null", "int"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "e",
        "l",
        "s",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'e', 'l', 's'
    ]

    def __init__(self, **kwargs):
        self.e = kwargs.get(
            'e', None)
        self.l = kwargs.get(
            'l', None)
        self.s = kwargs.get(
            's', None)


class Exon(ProtocolElement):
    """
    All coverage information about a given exon
    """
    _schemaSource = """
{"type": "record", "name": "Exon", "namespace": "org.gel.models.coverage.avro", "doc": "", "fields":
[{"name": "exon", "type": "string", "doc": ""}, {"name": "s", "type": "int", "doc": ""}, {"name":
"padded_s", "type": ["null", "int"], "doc": ""}, {"name": "e", "type": "int", "doc": ""}, {"name":
"padded_e", "type": ["null", "int"], "doc": ""}, {"name": "l", "type": ["null", "int"], "doc": ""},
{"name": "gaps", "type": {"type": "array", "items": {"type": "record", "name": "CoverageGap", "doc":
"", "fields": [{"name": "s", "type": "int", "doc": ""}, {"name": "e", "type": "int", "doc": ""},
{"name": "l", "type": ["null", "int"], "doc": ""}]}}, "doc": ""}, {"name": "stats", "type": {"type":
"record", "name": "RegionStatistics", "doc": "", "fields": [{"name": "avg", "type": "float", "doc":
""}, {"name": "sd", "type": "float", "doc": ""}, {"name": "med", "type": "float", "doc": ""},
{"name": "gc", "type": ["null", "float"], "doc": ""}, {"name": "pct75", "type": "float", "doc": ""},
{"name": "pct25", "type": "float", "doc": ""}, {"name": "bases", "type": ["null", "int"], "doc":
""}, {"name": "bases_lt_15x", "type": ["null", "int"], "doc": ""}, {"name": "bases_gte_15x", "type":
["null", "int"], "doc": ""}, {"name": "bases_gte_30x", "type": ["null", "int"], "doc": ""}, {"name":
"bases_gte_50x", "type": ["null", "int"], "doc": ""}, {"name": "gte50x", "type": "float", "doc":
""}, {"name": "gte30x", "type": "float", "doc": ""}, {"name": "gte15x", "type": "float", "doc": ""},
{"name": "lt15x", "type": "float", "doc": ""}, {"name": "rmsd", "type": ["null", "float"], "doc":
""}]}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "e",
        "exon",
        "gaps",
        "l",
        "padded_e",
        "padded_s",
        "s",
        "stats",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'gaps': CoverageGap,
            'stats': RegionStatistics,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'gaps': CoverageGap,
            'stats': RegionStatistics,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'e', 'exon', 'gaps', 'l', 'padded_e', 'padded_s', 's', 'stats'
    ]

    def __init__(self, **kwargs):
        self.e = kwargs.get(
            'e', None)
        self.exon = kwargs.get(
            'exon', None)
        self.gaps = kwargs.get(
            'gaps', None)
        self.l = kwargs.get(
            'l', None)
        self.padded_e = kwargs.get(
            'padded_e', None)
        self.padded_s = kwargs.get(
            'padded_s', None)
        self.s = kwargs.get(
            's', None)
        self.stats = kwargs.get(
            'stats', RegionStatistics())


class Gene(ProtocolElement):
    """
    All coverage information about a given gene
    """
    _schemaSource = """
{"type": "record", "name": "Gene", "namespace": "org.gel.models.coverage.avro", "doc": "", "fields":
[{"name": "trs", "type": {"type": "array", "items": {"type": "record", "name": "Transcript", "doc":
"", "fields": [{"name": "id", "type": "string", "doc": ""}, {"name": "stats", "type": {"type":
"record", "name": "RegionStatistics", "doc": "", "fields": [{"name": "avg", "type": "float", "doc":
""}, {"name": "sd", "type": "float", "doc": ""}, {"name": "med", "type": "float", "doc": ""},
{"name": "gc", "type": ["null", "float"], "doc": ""}, {"name": "pct75", "type": "float", "doc": ""},
{"name": "pct25", "type": "float", "doc": ""}, {"name": "bases", "type": ["null", "int"], "doc":
""}, {"name": "bases_lt_15x", "type": ["null", "int"], "doc": ""}, {"name": "bases_gte_15x", "type":
["null", "int"], "doc": ""}, {"name": "bases_gte_30x", "type": ["null", "int"], "doc": ""}, {"name":
"bases_gte_50x", "type": ["null", "int"], "doc": ""}, {"name": "gte50x", "type": "float", "doc":
""}, {"name": "gte30x", "type": "float", "doc": ""}, {"name": "gte15x", "type": "float", "doc": ""},
{"name": "lt15x", "type": "float", "doc": ""}, {"name": "rmsd", "type": ["null", "float"], "doc":
""}]}, "doc": ""}, {"name": "exons", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "Exon", "doc": "", "fields": [{"name": "exon", "type": "string", "doc": ""}, {"name": "s",
"type": "int", "doc": ""}, {"name": "padded_s", "type": ["null", "int"], "doc": ""}, {"name": "e",
"type": "int", "doc": ""}, {"name": "padded_e", "type": ["null", "int"], "doc": ""}, {"name": "l",
"type": ["null", "int"], "doc": ""}, {"name": "gaps", "type": {"type": "array", "items": {"type":
"record", "name": "CoverageGap", "doc": "", "fields": [{"name": "s", "type": "int", "doc": ""},
{"name": "e", "type": "int", "doc": ""}, {"name": "l", "type": ["null", "int"], "doc": ""}]}},
"doc": ""}, {"name": "stats", "type": "RegionStatistics", "doc": ""}]}}], "doc": ""}]}}, "doc": ""},
{"name": "union_tr", "type": "Transcript", "doc": ""}, {"name": "name", "type": "string", "doc":
""}, {"name": "chr", "type": "string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "chr",
        "name",
        "trs",
        "union_tr",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'trs': Transcript,
            'union_tr': Transcript,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'trs': Transcript,
            'union_tr': Transcript,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'chr', 'name', 'trs', 'union_tr'
    ]

    def __init__(self, **kwargs):
        self.chr = kwargs.get(
            'chr', None)
        self.name = kwargs.get(
            'name', None)
        self.trs = kwargs.get(
            'trs', None)
        self.union_tr = kwargs.get(
            'union_tr', Transcript())


class RegionStatistics(ProtocolElement):
    """
    Represents a group of coverage statistics over a genomic region
    """
    _schemaSource = """
{"type": "record", "name": "RegionStatistics", "namespace": "org.gel.models.coverage.avro", "doc":
"", "fields": [{"name": "avg", "type": "float", "doc": ""}, {"name": "sd", "type": "float", "doc":
""}, {"name": "med", "type": "float", "doc": ""}, {"name": "gc", "type": ["null", "float"], "doc":
""}, {"name": "pct75", "type": "float", "doc": ""}, {"name": "pct25", "type": "float", "doc": ""},
{"name": "bases", "type": ["null", "int"], "doc": ""}, {"name": "bases_lt_15x", "type": ["null",
"int"], "doc": ""}, {"name": "bases_gte_15x", "type": ["null", "int"], "doc": ""}, {"name":
"bases_gte_30x", "type": ["null", "int"], "doc": ""}, {"name": "bases_gte_50x", "type": ["null",
"int"], "doc": ""}, {"name": "gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type":
"float", "doc": ""}, {"name": "gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type":
"float", "doc": ""}, {"name": "rmsd", "type": ["null", "float"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "avg",
        "bases",
        "bases_gte_15x",
        "bases_gte_30x",
        "bases_gte_50x",
        "bases_lt_15x",
        "gc",
        "gte15x",
        "gte30x",
        "gte50x",
        "lt15x",
        "med",
        "pct25",
        "pct75",
        "rmsd",
        "sd",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'avg', 'bases', 'bases_gte_15x', 'bases_gte_30x',
        'bases_gte_50x', 'bases_lt_15x', 'gc', 'gte15x', 'gte30x',
        'gte50x', 'lt15x', 'med', 'pct25', 'pct75', 'rmsd', 'sd'
    ]

    def __init__(self, **kwargs):
        self.avg = kwargs.get(
            'avg', None)
        self.bases = kwargs.get(
            'bases', None)
        self.bases_gte_15x = kwargs.get(
            'bases_gte_15x', None)
        self.bases_gte_30x = kwargs.get(
            'bases_gte_30x', None)
        self.bases_gte_50x = kwargs.get(
            'bases_gte_50x', None)
        self.bases_lt_15x = kwargs.get(
            'bases_lt_15x', None)
        self.gc = kwargs.get(
            'gc', None)
        self.gte15x = kwargs.get(
            'gte15x', None)
        self.gte30x = kwargs.get(
            'gte30x', None)
        self.gte50x = kwargs.get(
            'gte50x', None)
        self.lt15x = kwargs.get(
            'lt15x', None)
        self.med = kwargs.get(
            'med', None)
        self.pct25 = kwargs.get(
            'pct25', None)
        self.pct75 = kwargs.get(
            'pct75', None)
        self.rmsd = kwargs.get(
            'rmsd', None)
        self.sd = kwargs.get(
            'sd', None)


class Transcript(ProtocolElement):
    """
    All coverage information about a given transcript
    """
    _schemaSource = """
{"type": "record", "name": "Transcript", "namespace": "org.gel.models.coverage.avro", "doc": "",
"fields": [{"name": "id", "type": "string", "doc": ""}, {"name": "stats", "type": {"type": "record",
"name": "RegionStatistics", "doc": "", "fields": [{"name": "avg", "type": "float", "doc": ""},
{"name": "sd", "type": "float", "doc": ""}, {"name": "med", "type": "float", "doc": ""}, {"name":
"gc", "type": ["null", "float"], "doc": ""}, {"name": "pct75", "type": "float", "doc": ""}, {"name":
"pct25", "type": "float", "doc": ""}, {"name": "bases", "type": ["null", "int"], "doc": ""},
{"name": "bases_lt_15x", "type": ["null", "int"], "doc": ""}, {"name": "bases_gte_15x", "type":
["null", "int"], "doc": ""}, {"name": "bases_gte_30x", "type": ["null", "int"], "doc": ""}, {"name":
"bases_gte_50x", "type": ["null", "int"], "doc": ""}, {"name": "gte50x", "type": "float", "doc":
""}, {"name": "gte30x", "type": "float", "doc": ""}, {"name": "gte15x", "type": "float", "doc": ""},
{"name": "lt15x", "type": "float", "doc": ""}, {"name": "rmsd", "type": ["null", "float"], "doc":
""}]}, "doc": ""}, {"name": "exons", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "Exon", "doc": "", "fields": [{"name": "exon", "type": "string", "doc": ""}, {"name": "s",
"type": "int", "doc": ""}, {"name": "padded_s", "type": ["null", "int"], "doc": ""}, {"name": "e",
"type": "int", "doc": ""}, {"name": "padded_e", "type": ["null", "int"], "doc": ""}, {"name": "l",
"type": ["null", "int"], "doc": ""}, {"name": "gaps", "type": {"type": "array", "items": {"type":
"record", "name": "CoverageGap", "doc": "", "fields": [{"name": "s", "type": "int", "doc": ""},
{"name": "e", "type": "int", "doc": ""}, {"name": "l", "type": ["null", "int"], "doc": ""}]}},
"doc": ""}, {"name": "stats", "type": "RegionStatistics", "doc": ""}]}}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "exons",
        "id",
        "stats",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'exons': Exon,
            'stats': RegionStatistics,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'exons': Exon,
            'stats': RegionStatistics,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'exons', 'id', 'stats'
    ]

    def __init__(self, **kwargs):
        self.exons = kwargs.get(
            'exons', None)
        self.id = kwargs.get(
            'id', None)
        self.stats = kwargs.get(
            'stats', RegionStatistics())


class UncoveredGene(ProtocolElement):
    """
    A gene for which there is no information about coverage. A low
    covered gene will not be identified in this list,     only genes
    for which there is no coverage data.
    """
    _schemaSource = """
{"type": "record", "name": "UncoveredGene", "namespace": "org.gel.models.coverage.avro", "doc": "",
"fields": [{"name": "chr", "type": "string", "doc": ""}, {"name": "name", "type": "string", "doc":
""}, {"name": "s", "type": ["null", "int"], "doc": ""}, {"name": "e", "type": ["null", "int"],
"doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "chr",
        "e",
        "name",
        "s",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'chr', 'e', 'name', 's'
    ]

    def __init__(self, **kwargs):
        self.chr = kwargs.get(
            'chr', None)
        self.e = kwargs.get(
            'e', None)
        self.name = kwargs.get(
            'name', None)
        self.s = kwargs.get(
            's', None)


class WholeGenome(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "WholeGenome", "namespace": "org.gel.models.coverage.avro", "fields":
[{"name": "stats", "type": {"type": "record", "name": "RegionStatistics", "doc": "", "fields":
[{"name": "avg", "type": "float", "doc": ""}, {"name": "sd", "type": "float", "doc": ""}, {"name":
"med", "type": "float", "doc": ""}, {"name": "gc", "type": ["null", "float"], "doc": ""}, {"name":
"pct75", "type": "float", "doc": ""}, {"name": "pct25", "type": "float", "doc": ""}, {"name":
"bases", "type": ["null", "int"], "doc": ""}, {"name": "bases_lt_15x", "type": ["null", "int"],
"doc": ""}, {"name": "bases_gte_15x", "type": ["null", "int"], "doc": ""}, {"name": "bases_gte_30x",
"type": ["null", "int"], "doc": ""}, {"name": "bases_gte_50x", "type": ["null", "int"], "doc": ""},
{"name": "gte50x", "type": "float", "doc": ""}, {"name": "gte30x", "type": "float", "doc": ""},
{"name": "gte15x", "type": "float", "doc": ""}, {"name": "lt15x", "type": "float", "doc": ""},
{"name": "rmsd", "type": ["null", "float"], "doc": ""}]}, "doc": ""}, {"name": "chrs", "type":
{"type": "array", "items": {"type": "record", "name": "Chromosome", "doc": "", "fields": [{"name":
"chr", "type": "string", "doc": ""}, {"name": "avg", "type": "float", "doc": ""}, {"name": "sd",
"type": "float", "doc": ""}, {"name": "med", "type": "float", "doc": ""}, {"name": "gc", "type":
["null", "float"], "doc": ""}, {"name": "pct75", "type": "float", "doc": ""}, {"name": "pct25",
"type": "float", "doc": ""}, {"name": "bases", "type": "int", "doc": ""}, {"name": "gte50x", "type":
"float", "doc": ""}, {"name": "gte30x", "type": "float", "doc": ""}, {"name": "gte15x", "type":
"float", "doc": ""}, {"name": "lt15x", "type": "float", "doc": ""}, {"name": "rmsd", "type":
["null", "float"], "doc": ""}]}}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "chrs",
        "stats",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'chrs': Chromosome,
            'stats': RegionStatistics,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'chrs': Chromosome,
            'stats': RegionStatistics,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'chrs', 'stats'
    ]

    def __init__(self, **kwargs):
        self.chrs = kwargs.get(
            'chrs', None)
        self.stats = kwargs.get(
            'stats', RegionStatistics())
