scout/parse/omim.py
def cli(context, morbid, genemap, mim2gene, mim_titles, phenotypes):
    """Parse the omim files"""
    # if not (morbid and genemap and mim2gene, mim_titles):
    #     print("Please provide all files")
    #     context.abort()

    from scout.utils.handle import get_file_handle
    from pprint import pprint as pp
    
    print("Morbid file: %s" % morbid)
    print("Genemap file: %s" % genemap)
    print("mim2gene file: %s" % mim2gene)
    print("MimTitles file: %s" % mim_titles)
    
    
    if morbid:
        morbid_handle = get_file_handle(morbid)
    if genemap:
        genemap_handle = get_file_handle(genemap)
    if mim2gene:
        mim2gene_handle = get_file_handle(mim2gene)
    if mim_titles:
        mimtitles_handle = get_file_handle(mim_titles)

    
    mim_genes = get_mim_genes(genemap_handle, mim2gene_handle)
    for entry in mim_genes: 
        if entry == 'C10orf11':
            pp(mim_genes[entry])
    
    context.abort()
    if phenotypes:
        if not genemap:
            click.echo("Please provide the genemap file")
            context.abort()
        phenotypes = get_mim_phenotypes(genemap_handle)
        for i,mim_term in enumerate(phenotypes):
            # pp(phenotypes[mim_term])
            pass
    
    print("Number of phenotypes found: %s" % i)
    
    context.abort()
    # hgnc_genes = get_mim_genes(genemap_handle, mim2gene_handle)
    # for hgnc_symbol in hgnc_genes:
    #     pp(hgnc_genes[hgnc_symbol])
    # phenotypes = get_mim_phenotypes(genemap_handle, mim2gene_handle, mimtitles_handle)
    # for mim_nr in phenotypes:
    #     pp(phenotypes[mim_nr])
    
    genes = get_mim_genes(genemap_handle, mim2gene_handle)
    for hgnc_symbol in genes:
        if hgnc_symbol == 'OPA1':
            print(genes[hgnc_symbol])
def cli(context, morbid, genemap, mim2gene, mim_titles, phenotypes):
    # if not (morbid and genemap and mim2gene, mim_titles):
    #     print("Please provide all files")
    #     context.abort()

    from scout.utils.handle import get_file_handle
    from pprint import pprint as pp
    
    print("Morbid file: %s" % morbid)
    print("Genemap file: %s" % genemap)
    print("mim2gene file: %s" % mim2gene)
    print("MimTitles file: %s" % mim_titles)
    
    
    if morbid:
        morbid_handle = get_file_handle(morbid)
    if genemap:
        genemap_handle = get_file_handle(genemap)
    if mim2gene:
        mim2gene_handle = get_file_handle(mim2gene)
    if mim_titles:
        mimtitles_handle = get_file_handle(mim_titles)

    
    mim_genes = get_mim_genes(genemap_handle, mim2gene_handle)
    for entry in mim_genes: 
        if entry == 'C10orf11':
            pp(mim_genes[entry])
    
    context.abort()
    if phenotypes:
        if not genemap:
            click.echo("Please provide the genemap file")
            context.abort()
        phenotypes = get_mim_phenotypes(genemap_handle)
        for i,mim_term in enumerate(phenotypes):
            # pp(phenotypes[mim_term])
            pass
    
    print("Number of phenotypes found: %s" % i)
    
    context.abort()
    # hgnc_genes = get_mim_genes(genemap_handle, mim2gene_handle)
    # for hgnc_symbol in hgnc_genes:
    #     pp(hgnc_genes[hgnc_symbol])
    # phenotypes = get_mim_phenotypes(genemap_handle, mim2gene_handle, mimtitles_handle)
    # for mim_nr in phenotypes:
    #     pp(phenotypes[mim_nr])
    
    genes = get_mim_genes(genemap_handle, mim2gene_handle)
    for hgnc_symbol in genes:
        if hgnc_symbol == 'OPA1':
            print(genes[hgnc_symbol])
def cli ( context , morbid , genemap , mim2gene , mim_titles , phenotypes ) : # if not (morbid and genemap and mim2gene, mim_titles): #     print("Please provide all files") #     context.abort() from scout . utils . handle import get_file_handle from pprint import pprint as pp print ( "Morbid file: %s" % morbid ) print ( "Genemap file: %s" % genemap ) print ( "mim2gene file: %s" % mim2gene ) print ( "MimTitles file: %s" % mim_titles ) if morbid : morbid_handle = get_file_handle ( morbid ) if genemap : genemap_handle = get_file_handle ( genemap ) if mim2gene : mim2gene_handle = get_file_handle ( mim2gene ) if mim_titles : mimtitles_handle = get_file_handle ( mim_titles ) mim_genes = get_mim_genes ( genemap_handle , mim2gene_handle ) for entry in mim_genes : if entry == 'C10orf11' : pp ( mim_genes [ entry ] ) context . abort ( ) if phenotypes : if not genemap : click . echo ( "Please provide the genemap file" ) context . abort ( ) phenotypes = get_mim_phenotypes ( genemap_handle ) for i , mim_term in enumerate ( phenotypes ) : # pp(phenotypes[mim_term]) pass print ( "Number of phenotypes found: %s" % i ) context . abort ( ) # hgnc_genes = get_mim_genes(genemap_handle, mim2gene_handle) # for hgnc_symbol in hgnc_genes: #     pp(hgnc_genes[hgnc_symbol]) # phenotypes = get_mim_phenotypes(genemap_handle, mim2gene_handle, mimtitles_handle) # for mim_nr in phenotypes: #     pp(phenotypes[mim_nr]) genes = get_mim_genes ( genemap_handle , mim2gene_handle ) for hgnc_symbol in genes : if hgnc_symbol == 'OPA1' : print ( genes [ hgnc_symbol ] )
Parse the omim files
Parse the omim files