Skip to content

Commit

Permalink
move imports into the functon
Browse files Browse the repository at this point in the history
  • Loading branch information
hopedisastro committed Jun 11, 2024
1 parent 9182848 commit 88a430f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions str/fine-mapping/susie_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@
--max-parallel-jobs 100
"""

import gzip

import click
import pandas as pd

import hailtop.batch as hb

from cpg_utils import to_path
from cpg_utils.hail_batch import get_batch, output_path, reset_batch
from cpg_utils.hail_batch import get_batch


def susie_runner(ld_path, associatr_path, celltype, chrom):

import rpy2.robjects as ro
import pandas as pd
from rpy2.robjects import pandas2ri
from cpg_utils.hail_batch import output_path


ro.r('library(coloc)')
ro.r('library(tidyverse)')
Expand Down Expand Up @@ -113,7 +114,7 @@ def manage_concurrency_for_job(job: hb.batch.job.Job):

for celltype in celltypes.split(','):
for chrom in chromosomes.split(','):
ld_files = list(to_path(f'{associatr_dir}/{celltype}/{chrom}').glob('*.tsv'))
ld_files = list(to_path(f'{ld_dir}/{celltype}/{chrom}').glob('*.tsv'))
for ld_file in ld_files: # for each gene (each has its own LD file)
ld_file = str(ld_file)
gene = ld_file.split('/')[-1].split('_')[0]
Expand Down

0 comments on commit 88a430f

Please sign in to comment.