Skip to content

Commit

Permalink
Merge pull request #7 from Nealelab/test_wlu
Browse files Browse the repository at this point in the history
setup.py updated
  • Loading branch information
wlu04 authored Nov 4, 2021
2 parents ee06397 + 94a75f7 commit f9b4c03
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ukbb_common.utils import *
from ukbb_common.resources import *
from .utils import *
from .resources import *
4 changes: 2 additions & 2 deletions resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ukb_common.resources.generic import *
from ukb_common.resources.results import *
from ukbb_common.resources.generic import *
from ukbb_common.resources.results import *
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import setuptools

import os

with open("README.md", "r", encoding="utf-8") as readme_file:
long_description = readme_file.read()

requirements = []
with open("requirements.txt", "r") as requirements_file:
for req in (line.strip() for line in requirements_file):
requirements.append(req)
# requirements = []
# with open("requirements.txt", "r") as requirements_file:
# for req in (line.strip() for line in requirements_file):
# requirements.append(req)

setuptools.setup(
name="ukbb_common",
version="0.1.2",
version="0.1.3",
author="",
author_email="",
description="Common functions for UK Biobank Data",
Expand All @@ -30,7 +30,7 @@
"Development Status :: 4 - Beta",
],
python_requires=">=3.6",
package_dir={"": "src"},
packages=setuptools.find_packages(where="src"),
install_requires=requirements,
package_dir={"ukbb_common": "."},
packages=['ukbb_common', 'ukbb_common.resources', 'ukbb_common.utils'],
install_requires=['hail', 'batch'],
)
11 changes: 7 additions & 4 deletions utils/phenotype_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ def load_covid_data(all_samples_ht: hl.Table, covid_data_path: str, hes_main_pat
print(f'Loading COVID wave {wave}...')

#### PATH OF DATA USED IN TESTING ####
# def get_covid_data_path(wave: str = '20201103'):
# return f'gs://ukb31063/ukb31063.covid19_test_result.{wave}.txt'
# def get_covid_data_path(wave: str = '20200724', region: str = 'england'):
# return f'gs://ukb31063/ukb31063.covid19_result_{region}.{wave}.txt'

# def get_hes_main_data_path(wave: str = '20200909'):
# return f'gs://ukb31063/ukb31063.hesin.{wave}.txt'
Expand All @@ -658,6 +658,7 @@ def load_covid_data(all_samples_ht: hl.Table, covid_data_path: str, hes_main_pat
# return f'gs://ukb31063/ukb31063.death.{wave}.txt'

covid_ht = hl.import_table(covid_data_path, delimiter='\t', missing='', impute=True, key='eid', min_partitions=100)

hes_main_ht = hl.import_table(hes_main_path, delimiter='\t', missing='', impute=True, key=('eid', 'ins_index'), min_partitions=100)
hes_diag_ht = hl.import_table(hes_diag_path, delimiter='\t', missing='', impute=True, key=('eid', 'ins_index'), min_partitions=100)
death_ht = hl.import_table(death_path, delimiter='\t', missing='', impute=True, key='eid', min_partitions=100)
Expand All @@ -674,8 +675,10 @@ def load_covid_data(all_samples_ht: hl.Table, covid_data_path: str, hes_main_pat
hes_ht = hes_ht.key_by('eid').join(hes_pcr_pos.key_by('eid'), how='outer') # Create PCR-Positive information for all diagnoses

hes_death_ht = hes_ht.join(death_ht, how='outer') # Join Death Register Data to HES Info
hes_death_ht = hes_death_ht.annotate(inpatient2=hes_death_ht.admi_date >= hes_death_ht.covid_diag_date,
death=hes_death_ht.death_date >= hes_death_ht.covid_diag_date) # Compare PCR-Positive Date to Death Date and Admission Date
hes_death_ht = hes_death_ht.annotate(inpatient2=(hes_death_ht.admi_date >= hes_death_ht.covid_diag_date) &
(hes_death_ht.admi_date < hes_death_ht.covid_diag_date + 86400 * 30),
death=(hes_death_ht.death_date >= hes_death_ht.covid_diag_date) &
(hes_death_ht.death_date < hes_death_ht.covid_diag_date + 86400 * 30)) # Compare PCR-Positive Date to Death Date and Admission Date
hes_death_ht = hes_death_ht.group_by('eid').aggregate(inpatient2=hl.agg.any(hes_death_ht.inpatient2),
death=hl.agg.any(hes_death_ht.death),
pcr_result=hl.agg.any(hes_death_ht.pcr_result),
Expand Down

0 comments on commit f9b4c03

Please sign in to comment.