Beispiel #1
0
def set_localdir():
    """Set the local database directory from the enviornmental variable
    GCN_DATA_DIR"""
    local = lib_config.gcn_path('GCN_DATA_DIR')
    if local is not None:
        global _LOCALDIR
        _LOCALDIR = local
Beispiel #2
0
def main():
    """to generate Clinvitae VCF file"""

    desc = 'Generating Clinvitae VCF file'
    parser = argparse.ArgumentParser(description=desc)

    parser.add_argument('--preprocess', action='store_const', dest='preprocess',\
      required=False, default=False, const=True, help='download Clinvitae')

    parser.add_argument('-g', dest='mutalyzer_fn', required=False,\
     default=None, help='a file generated from https://mutalyzer.nl/position-converter')

    parser.add_argument('-o', '--out_dir', dest='out_dir', required=False,\
     type=str, default = lib_config.gcn_path('GCN_DATA_DIR'),\
      help='output directory')

    args = parser.parse_args()

    if args.preprocess:
        clinvt = lib_clinvitae.ClinVitae(args.out_dir)
        clinvt.download()
        _ = clinvt.extract_cDNA()
    elif args.mutalyzer_fn:
        clinvt = lib_clinvitae.ClinVitae(args.out_dir)
        if os.path.exists(clinvt.tsv) and os.path.exists(args.mutalyzer_fn):
            clinvt.gdna_to_vcf(args.mutalyzer_fn)
        else:
            raise RuntimeError('check if both [%s] and [%s] exists'%\
                     (clinvt.tsv,args.mutalyzer_fn))
    else:
        raise RuntimeError('it does not do anything!')
Beispiel #3
0
 def __init__(self):
     self.location = lib_config.gcn_path('GCN')
     self.liftover = os.path.join(self.location, \
                                   'gcn/bin/hgConvert/liftOver_exe', \
                                   'liftOver')
     self.chaindata = os.path.join(self.location, 'gcn/bin/hgConvert', \
                                   'chainData')
     self.tmpdir = os.path.join(self.location, 'gcn/bin/hgConvert', 'temp')
     if not os.path.exists(self.tmpdir):
         os.system('mkdir %s' % (self.tmpdir))
Beispiel #4
0
 def _check_env(self):
     flag = 0
     envs = ['GCN', 'GCN_DATA_DIR', 'GCN_DB_DIR']
     for env in envs:
         loc = lib_config.gcn_path(env)
         if loc:
             if not os.path.exists(loc):
                 self.logger.error('Path set to %s environment does not '
                                   'exist..' % env)
                 flag = 1
         else:
             self.logger.error('%s environment variable is not set..' % env)
             flag = 1
     return flag
Beispiel #5
0
 'GENCODE':
 os.path.join(_LOCALDIR, 'gencode', 'wgEncodeGencodeBasicV19.txt'),
 'FUNSIM':
 os.path.join(_LOCALDIR, 'geneontology', 'uprot20160505_funsim.tsv'),
 'GOA':
 os.path.join(_LOCALDIR, 'geneontology', 'gene_association.goa_human'),
 'GOBO':
 os.path.join(_LOCALDIR, 'geneontology', 'go.obo'),
 'MIRNA':
 os.path.join(_LOCALDIR, 'mirna', 'human_predictions_S_C_aug2010.txt'),
 'UTRDB':
 os.path.join(_LOCALDIR, 'utrdb', ''),
 'CLNPHESNP':
 os.path.join(_LOCALDIR, 'clnphesnp', ''),
 'LOGFILE':
 lib_config.gcn_path('GCN_LOGFILE'),
 'UNIPROT':
 os.path.join(_LOCALDIR, 'uniprot', 'uniprot_sprot_human.dat'),
 'OMIM':
 os.path.join(_LOCALDIR, 'omim', 'uniprot_sprot_human.dat'),
 'NSFP':
 os.path.join(_LOCALDIR, 'dbnsfp', ''),
 'GERP':
 os.path.join(_LOCALDIR, 'gerp', '*.txt'),
 'REFGENOME':
 os.path.join(_LOCALDIR, 'refgenome', 'human_g1k_v37.fasta'),
 'REFGENOME_UCSC':
 os.path.join(_LOCALDIR, 'refgenome', 'hg19.fasta'),
 'REGULOME':
 os.path.join(_LOCALDIR, 'regulome', ''),
 'SeqCapEZ_Exome':