From 823976b5c0e0f38b19598bc87e998a9a14ad7792 Mon Sep 17 00:00:00 2001 From: hanna julienne <hanna.julienne@pasteur.fr> Date: Mon, 18 Nov 2019 10:20:17 +0100 Subject: [PATCH] corrected column mix up when snpid is not first --- jass_preprocessing/map_gwas.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jass_preprocessing/map_gwas.py b/jass_preprocessing/map_gwas.py index 7c3b6e0..3cf1a5c 100644 --- a/jass_preprocessing/map_gwas.py +++ b/jass_preprocessing/map_gwas.py @@ -152,13 +152,13 @@ def read_gwas( gwas_internal_link, column_map): compression=compression, #column_dict['label_position'].keys(), names= column_map.index, - index_col=0, header=0, na_values= ['', '#N/A', '#N/A', 'N/A','#NA', '-1.#IND', '-1.#QNAN', '-NaN', '-nan', '1.#IND', '1.#QNAN', 'N/A', 'NA', 'NULL', 'NaN', - 'nan', 'na', '.']) - - + 'nan', 'na', '.', '-'], dtype={"snpid":str, "a1":str,"a2":str,"freq":float, "z":float,"se":float, "pval":float}) + print(fullGWAS.head()) + fullGWAS.set_index("snpid", inplace=True) + print(fullGWAS.head()) fullGWAS = fullGWAS[~fullGWAS.index.duplicated(keep='first')] #fullGWAS = convert_missing_values(fullGWAS) -- GitLab