diff --git a/jass_preprocessing/__main__.py b/jass_preprocessing/__main__.py index 212719155f6eab2fe4f712369ea62760a4de69a2..6c989c09c98812d26452b54f4dc94e5407576fd8 100644 --- a/jass_preprocessing/__main__.py +++ b/jass_preprocessing/__main__.py @@ -32,7 +32,7 @@ def launch_preprocessing(args): gwas_map = pd.read_csv(args.gwas_info, sep="\t") #define an unique - gwas_map['tag'] = gwas_map.Consortium+ "_" + D.Outcome + gwas_map['tag'] = gwas_map.Consortium+ "_" + gwas_map.Outcome if gwas_map.tag.duplicated().any(): raise_duplicated_index(gwas_map.tag) @@ -41,7 +41,7 @@ def launch_preprocessing(args): for tag in gwas_map.index: - gwas_filename = D.loc[tag, "filename"] + gwas_filename = gwas_map.loc[tag, "filename"] print('processing GWAS: {}'.format(tag)) start = time.time() diff --git a/jass_preprocessing/map_gwas.py b/jass_preprocessing/map_gwas.py index 901f609b6a50ccc0525e0ef0a849a00ec20b3571..0f5c35b96720649df8aadb4bd0bc1d4ffa5f220c 100644 --- a/jass_preprocessing/map_gwas.py +++ b/jass_preprocessing/map_gwas.py @@ -76,7 +76,7 @@ def convert_missing_values(df): return df.replace(def_missing, nan_vec) -def map_columns_position(gwas_internal_link, my_labels): +def map_columns_position(gwas_internal_link, column_dict): """ Find column position for each specific Gwas @@ -87,16 +87,14 @@ def map_columns_position(gwas_internal_link, my_labels): Return: pandas Series with column position and column names as index """ - - print(gwas_internal_link) gwas_file = gwas_internal_link.split('/')[-1] - my_labels = column_dict.loc[gwas_file] - #Our standart labels: - reference_label = column_dict.columns.tolist() + + reference_label = column_dict.index.tolist() + print(reference_label) # labels in the GWAS files - target_lab = pd.Index(my_labels.values.tolist()) + target_lab = pd.Index(column_dict.values.tolist()) is_gzipped = re.search(r".gz$", gwas_internal_link) if is_gzipped: f = gzip.open(gwas_internal_link)