def load_config(genome_config, section_id): genome = Genome(section_id) genome.genomic_sequence_filename = genome_config.chr_all_file for section_id, gene_models_config in \ genome_config.gene_models.items(): gene_models = Genome.GeneModelsConfig( section_id, gene_models_config.file, gene_models_config.fileformat, None, ) genome._gene_models[gene_models.id] = gene_models assert genome_config.default_gene_models in genome._gene_models genome.default_gene_models_id = genome_config.default_gene_models genome.default_gene_models_filename = \ genome._gene_models[genome.default_gene_models_id].file if genome_config.pars: assert genome_config.pars.X is not None regions_x = [ Region.from_str(region) for region in genome_config.pars.X ] chrom_x = regions_x[0].chrom regions_y = [ Region.from_str(region) for region in genome_config.pars.Y ] chrom_y = regions_y[0].chrom genome.pars = {chrom_x: regions_x, chrom_y: regions_y} return genome
def test_collapse_no_chrom_simple(regions, expected): regions = [Region.from_str(r) for r in regions.split(",")] result = collapse_no_chrom(regions) assert len(result) == len(expected) for res, exp in zip(result, expected): assert res == exp
def reset_regions(self, regions): super(DenovoLoader, self).reset_regions(regions) result = [] for r in self.regions: if r is None: result.append(r) else: result.append(Region.from_str(r)) self.regions = result logger.debug(f"denovo reset regions: {self.regions}")
def reset_regions(self, regions): super(CNVLoader, self).reset_regions(regions) result = [] for r in self.regions: if r is None: result.append(r) else: result.append(Region.from_str(r)) self.regions = result print("CNV reset regions:", self.regions)
def test_parse_regions(region, expected): result = Region.from_str(region) # assert result is not None assert result == expected