In [ ]:
import pandas as pd

In [6]:
import os

In [9]:
cwd = os.getcwd()
cwd


Out[9]:
'/Users/otvisitor/Documents/proj/pycharm_projects/postgap/qaqc'

In [15]:
filename = cwd + "/../tests/sample_data/qaqc_data/postgap.20180209.gold_standard_snps.txt"
filename


Out[15]:
'/Users/otvisitor/Documents/proj/pycharm_projects/postgap/qaqc/../tests/sample_data/qaqc_data/postgap.20180209.gold_standard_snps.txt'

In [16]:
df = pd.read_csv(filename, sep='\t', na_values=['None'])

In [18]:
df.head()


Out[18]:
ld_snp_rsID chrom pos GRCh38_chrom GRCh38_pos afr_maf amr_maf eas_maf eur_maf sas_maf ... vep_sum vep_mean GTEx VEP Fantom5 DHS PCHiC Nearest Regulome VEP_reg
0 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
1 rs3751812 16 53818460 16 53784548 0.0545 0.2277 0.1667 0.4135 0.2914 ... 0.0 0.0 0.000000 0.0 0 0.0 0.009325 0.0 0 0
2 rs3751812 16 53818460 16 53784548 0.0545 0.2277 0.1667 0.4135 0.2914 ... 0.0 0.0 0.028039 0.0 0 0.0 0.000000 0.0 0 0
3 rs1421085 16 53800954 16 53767042 0.0560 0.2392 0.1687 0.4324 0.3067 ... 0.0 0.0 0.000000 0.0 0 0.0 0.013251 0.0 0 0
4 rs9939609 16 53820527 16 53786615 0.4939 0.2622 0.1687 0.4135 0.2883 ... 0.0 0.0 0.093748 0.0 0 0.0 0.000000 0.0 0 0

5 rows × 44 columns

Select rows that have 'ld_snp_rsID' = 'rs17817449'


In [19]:
df.loc[df['ld_snp_rsID'] == 'rs17817449']


Out[19]:
ld_snp_rsID chrom pos GRCh38_chrom GRCh38_pos afr_maf amr_maf eas_maf eur_maf sas_maf ... vep_sum vep_mean GTEx VEP Fantom5 DHS PCHiC Nearest Regulome VEP_reg
0 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
5 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
10 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.291158 0.0 0 0.0 0.000000 0.0 0 0
13 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.395961 0.0 0 0.0 0.000000 0.0 0 0
17 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.515353 0.0 0 0.0 0.000000 0.0 0 0
22 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
29 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0
33 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
42 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
66 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.291158 0.0 0 0.0 0.000000 0.0 0 0
78 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.395961 0.0 0 0.0 0.000000 0.0 0 0
101 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.515353 0.0 0 0.0 0.000000 0.0 0 0
145 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
190 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0
216 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
217 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
297 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
298 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
442 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.291158 0.0 0 0.0 0.000000 0.0 0 0
443 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.291158 0.0 0 0.0 0.000000 0.0 0 0
539 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.395961 0.0 0 0.0 0.000000 0.0 0 0
540 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.395961 0.0 0 0.0 0.000000 0.0 0 0
680 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.515353 0.0 0 0.0 0.000000 0.0 0 0
681 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.515353 0.0 0 0.0 0.000000 0.0 0 0
1136 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
1137 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
1370 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0
1371 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0
1501 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
1510 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
11923 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
11968 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0
12008 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
12009 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
12010 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
12026 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
12027 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
12028 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
12041 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.291158 0.0 0 0.0 0.000000 0.0 0 0
12042 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.291158 0.0 0 0.0 0.000000 0.0 0 0
12043 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.291158 0.0 0 0.0 0.000000 0.0 0 0
12050 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.395961 0.0 0 0.0 0.000000 0.0 0 0
12051 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.395961 0.0 0 0.0 0.000000 0.0 0 0
12052 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.395961 0.0 0 0.0 0.000000 0.0 0 0
12059 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.515353 0.0 0 0.0 0.000000 0.0 0 0
12060 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.515353 0.0 0 0.0 0.000000 0.0 0 0
12061 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.515353 0.0 0 0.0 0.000000 0.0 0 0
12074 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
12075 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
12076 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
12098 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0
12099 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0
12100 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0
12836 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.000000 0.0 0 0.0 0.024005 0.0 0 0
12904 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.104672 0.0 0 0.0 0.000000 0.0 0 0
13034 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.291158 0.0 0 0.0 0.000000 0.0 0 0
13119 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.395961 0.0 0 0.0 0.000000 0.0 0 0
13241 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.515353 0.0 0 0.0 0.000000 0.0 0 0
13669 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 0.0 0.0 0.823969 0.0 0 0.0 0.000000 0.0 0 0
13866 rs17817449 16 53813367 16 53779455 0.3759 0.2493 0.1696 0.4145 0.2894 ... 4.0 1.0 0.080767 1.0 0 0.0 0.000000 1.0 0 0

525 rows × 44 columns


In [ ]: