Ejemplo n.º 1
0
def prepare_overlap(genome):
    """Converts indexing info into a dictionary"""
    package_dir = "/".join(os.path.abspath(__file__).split("/")[:-3])
    genome_dir = package_dir + '/annotations/' + genome
    if os.path.isdir(genome_dir):
        est_file = genome_dir + '/' + 'all_est.txt'
        index_file = est_file + '.idx'
        est_overlap = OverlapCoord(est_file, index_file)
        est_overlap.extract_index()
        
        return est_overlap
    
    return None
Ejemplo n.º 2
0
def prepare_overlap(genome, annodir):
    """Converts indexing info into a dictionary"""
    
    genome_dir = os.path.join(annodir, genome)
    
    if os.path.isdir(genome_dir):
        est_file = genome_dir + '/' + 'all_est.txt'
        index_file = est_file + '.idx'
        est_overlap = OverlapCoord(est_file, index_file)
        est_overlap.extract_index()
        
        return est_overlap
    
    return None
Ejemplo n.º 3
0
def prepare_overlap(genome, chrom):
    """Extracts index info into dictionary"""
    package_dir = "/".join(os.path.abspath(__file__).split("/")[:-3])
    genome_dir = package_dir + '/annotations/' + genome
    if not os.path.isdir(genome_dir):
	return None
    
    snp_file = genome_dir + '/snp/' + chrom + '-snp.txt'
    index_file = snp_file + '.idx'
    if not os.path.exists(snp_file) or not os.path.exists(index_file):
	return None
    snp_overlap = OverlapCoord(snp_file, index_file)
    snp_overlap.extract_index()
    
    return snp_overlap
Ejemplo n.º 4
0
def prepare_overlap(genome, chrom, annodir):
    """Extracts index info into dictionary"""

    genome_dir = os.path.join(annodir, genome)

    if not os.path.isdir(genome_dir):
        return None

    snp_file = genome_dir + "/snp/" + chrom + "-snp.txt"
    index_file = snp_file + ".idx"
    if not os.path.exists(snp_file) or not os.path.exists(index_file):
        return None
    snp_overlap = OverlapCoord(snp_file, index_file)
    snp_overlap.extract_index()

    return snp_overlap
Ejemplo n.º 5
0
def prepare_overlap(genome, annodir):
    """Extracts index info into dictionary"""
    
    genome_dir = os.path.join(annodir, genome)
    
    if not os.path.isdir(genome_dir):
        return None
    
    dgv_file = genome_dir + '/dgv.txt'
    index_file = genome_dir + '/dgv.idx'
    if not os.path.exists(dgv_file) or not os.path.exists(index_file):
        return None

    dgv_overlap = OverlapCoord(dgv_file, index_file)
    dgv_overlap.extract_index()
    
    return dgv_overlap
Ejemplo n.º 6
0
def prepare_overlap(genome):
    """Extracts index info into dictionary"""
    package_dir = "/".join(os.path.abspath(__file__).split("/")[:-3])
    genome_dir = package_dir + '/annotations/' + genome
    
    if not os.path.isdir(genome_dir):
	return None
    
    dgv_file = genome_dir + '/dgv.txt'
    index_file = genome_dir + '/dgv.idx'
    if not os.path.exists(dgv_file) or not os.path.exists(index_file):
	return None

    dgv_overlap = OverlapCoord(dgv_file, index_file)
    dgv_overlap.extract_index()
    
    return dgv_overlap
Ejemplo n.º 7
0
    def prepare_overlap(cls, genome, models):
	"""Prepares transcript overlapping for given genome and models"""
        overlaps = {}
    
        config = ConfigParser.ConfigParser()
        config.read(PACKAGE_DIR + "/configs/model_matcher.cfg")  
        for m in models.split(','):       
            config = ConfigParser.ConfigParser()
            config.read(PACKAGE_DIR + "/configs/model_matcher.cfg")
            annot_file = index = None

            if genome in config.sections():
                for field in config.options(genome):
                    if field.lower() == m.lower():
                        annot_file = PACKAGE_DIR + "/annotations/" + genome + "/" + config.get(genome, field)

                        if annot_file and os.path.exists(annot_file):
                            index_file = annot_file.replace('.txt', '.idx')                
                            txt_overlap = OverlapCoord(annot_file, index_file)
                            txt_overlap.extract_index()                       
			    overlaps[m] = txt_overlap
                        
        return overlaps
Ejemplo n.º 8
0
    def prepare_overlap(cls, genome, models, annodir, mmcfg):
        """Prepares transcript overlapping for given genome and models"""
        overlaps = {}
    
        config = ConfigParser.ConfigParser()
        config.read(mmcfg)  
        for m in models.split(','):       
            config = ConfigParser.ConfigParser()
            config.read(mmcfg)
            annot_file = index = None

            if genome in config.sections():
                for field in config.options(genome):
                    if field.lower() == m.lower():
                        annot_file = os.path.join(annodir, genome, config.get(genome, field))

                        if annot_file and os.path.exists(annot_file):
                            index_file = annot_file.replace('.txt', '.idx')                
                            txt_overlap = OverlapCoord(annot_file, index_file)
                            txt_overlap.extract_index()                       
                            overlaps[m] = txt_overlap
                        
        return overlaps