Beispiel #1
0
def run(args):
    if os.path.exists(args.model_output_path):
        logging.info("DB already there, delete it if you want it done again")
        return

    folder = os.path.split(args.model_output_path)[0]
    if not os.path.exists(folder):
        os.makedirs(folder)

    callback = callback_for_args(args)
    PB8KFileInfo.parse_input_file(args.model_output_path, args.pb8k_input_path, args.gencode_input_path, callback)
Beispiel #2
0
def row_from_comps(comps, TF, var, N):
    snp = comps[TF.SNPName]
    if not snp in var:
        return None
    chr = "chr"+comps[TF.SNPChr]
    pos = comps[TF.SNPChrPos]
    reference_allele, effect_allele = PB8KFileInfo.alleles(TF, comps)
    zscore = float(comps[TF.OverallZScore])
    se = math.sqrt(float(var[snp])/N)
    beta = zscore*se
    OR = str(math.exp(beta))
    #check ldpred coord_genotype parse_sum_stats_standard() for what is a1 and a2
    p = str(stats.norm.sf(abs(zscore)) * 2)
    row = (chr, snp, reference_allele, effect_allele, pos, OR, p,)
    return row
def row_from_comps(gene, comps, TF):
    snp = comps[TF.SNPName]
    reference_allele, effect_allele = PB8KFileInfo.alleles(TF, comps)
    zscore = comps[TF.OverallZScore]
    row = (snp, gene, zscore, reference_allele, effect_allele,)
    return row