def __init__(self, config, parent=True): if parent: SeqLib.__init__(self, config) self.wt_dna = None self.wt_protein = None self.aligner = None self.aligner_cache = None try: self.set_wt(config['wild type']['sequence'], coding=config['wild type']['coding']) if 'align variants' in config: if config['align variants']: self.aligner = Aligner() self.aligner_cache = dict() except KeyError as key: raise EnrichError("Missing required config value '{key}'".format(key), self.name) if 'reference offset' in config['wild type']: try: self.reference_offset = int(config['wild type'] ['reference offset']) except ValueError: raise EnrichError("Invalid reference offset value", self.name) else: self.reference_offset = 0 self.df_dict['variants'] = None
def __init__(self, config, parent=True): if parent: SeqLib.__init__(self, config) self.wt_dna = None self.wt_protein = None self.aligner = None self.aligner_cache = None try: self.set_wt(config['wild type']['sequence'], coding=config['wild type']['coding']) if 'align variants' in config: if config['align variants']: self.aligner = Aligner() self.aligner_cache = dict() except KeyError as key: raise EnrichError( "Missing required config value '{key}'".format(key), self.name) if 'reference offset' in config['wild type']: try: self.reference_offset = int( config['wild type']['reference offset']) except ValueError: raise EnrichError("Invalid reference offset value", self.name) else: self.reference_offset = 0 self.df_dict['variants'] = None
def __init__(self, config, barcodevariant=False): self.barcodevariant = barcodevariant if not self.barcodevariant: SeqLib.__init__(self, config) try: if 'forward' in config['fastq'] and 'reverse' in config['fastq']: raise EnrichError("Multiple FASTQ files specified", self.name) elif 'forward' in config['fastq']: self.reads = config['fastq']['forward'] self.revcomp_reads = False elif 'reverse' in config['fastq']: self.reads = config['fastq']['reverse'] self.revcomp_reads = True else: raise KeyError("'forward' or 'reverse'") if 'start' in config['fastq']: self.bc_start = config['fastq']['start'] else: self.bc_start = 1 if 'length' in config['fastq']: self.bc_length = config['fastq']['length'] else: self.bc_length = 2147483647 # longer than any read... for now if 'min count' in config['barcodes']: self.min_count = config['barcodes']['min count'] else: self.min_count = 0 self.set_filters(config['filters'], { 'min quality': 0, 'avg quality': 0, 'chastity': False }) except KeyError as key: raise EnrichError( "Missing required config value {key}".format(key=key), self.name) try: check_fastq(self.reads) except IOError as fqerr: raise EnrichError("FASTQ file error: {error}".format(error=fqerr), self.name) self.df_dict['barcodes'] = None if self.min_count > 0: self.df_dict['barcodes_low_abundance'] = None
def __init__(self, config, barcodevariant=False): self.barcodevariant = barcodevariant if not self.barcodevariant: SeqLib.__init__(self, config) try: if 'forward' in config['fastq'] and 'reverse' in config['fastq']: raise EnrichError("Multiple FASTQ files specified", self.name) elif 'forward' in config['fastq']: self.reads = config['fastq']['forward'] self.revcomp_reads = False elif 'reverse' in config['fastq']: self.reads = config['fastq']['reverse'] self.revcomp_reads = True else: raise KeyError("'forward' or 'reverse'") if 'start' in config['fastq']: self.bc_start = config['fastq']['start'] else: self.bc_start = 1 if 'length' in config['fastq']: self.bc_length = config['fastq']['length'] else: self.bc_length = 2147483647 # longer than any read... for now if 'min count' in config['barcodes']: self.min_count = config['barcodes']['min count'] else: self.min_count = 0 self.set_filters(config['filters'], {'min quality' : 0, 'avg quality' : 0, 'chastity' : False}) except KeyError as key: raise EnrichError("Missing required config value {key}".format(key=key), self.name) try: check_fastq(self.reads) except IOError as fqerr: raise EnrichError("FASTQ file error: {error}".format(error=fqerr), self.name) self.df_dict['barcodes'] = None if self.min_count > 0: self.df_dict['barcodes_low_abundance'] = None
def __init__(self, config, parent=True): if parent: SeqLib.__init__(self, config) try: if "forward" in config["fastq"] and "reverse" in config["fastq"]: raise EnrichError("Multiple FASTQ files specified", self.name) elif "forward" in config["fastq"]: self.reads = config["fastq"]["forward"] self.revcomp_reads = False elif "reverse" in config["fastq"]: self.reads = config["fastq"]["reverse"] self.revcomp_reads = True else: raise KeyError("'forward' or 'reverse'") if "start" in config["fastq"]: self.bc_start = config["fastq"]["start"] else: self.bc_start = 1 if "length" in config["fastq"]: self.bc_length = config["fastq"]["length"] else: self.bc_length = 2147483647 # longer than any read... for now if "min count" in config["barcodes"]: self.min_count = config["barcodes"]["min count"] else: self.min_count = 0 self.set_filters(config["filters"], {"min quality": 0, "avg quality": 0, "chastity": False}) except KeyError as key: raise EnrichError("Missing required config value %s" % key, self.name) try: check_fastq(self.reads) except IOError as fqerr: raise EnrichError("FASTQ file error: %s" % fqerr, self.name) self.counts["barcodes"] = None