diff --git a/jass_preprocessing/__main__.py b/jass_preprocessing/__main__.py index 6570db67a85a8f133304112f231e6d72f0a00937..75e38801adc1c253a48c6c8baf7e634e60245511 100644 --- a/jass_preprocessing/__main__.py +++ b/jass_preprocessing/__main__.py @@ -95,7 +95,7 @@ def add_preprocessing_argument(): parser.add_argument('--additional-masked-region', required=False, help= "List of dictionary containing coordinate of region to mask. For example :[{'chr':6, 'start':50000000, 'end': 70000000}, {'chr':6, 'start':100000000, 'end': 120000000}]", default='None') parser.add_argument('--imputation-quality-treshold', required=False, help= "minimum imputation quality in summary statistics", default='None') - parser.add_argument('--index-type', required=False, help= "type of index : rsID or chr:postion:ref_allele:alt_allele", default='rsid') + parser.add_argument('--index-type', required=False, help= "type of index : rsID or chr:postion:ref_allele:alt_allele", default='rs-number') parser.set_defaults(func=launch_preprocessing) diff --git a/jass_preprocessing/map_reference.py b/jass_preprocessing/map_reference.py index f6ad23558a96009ad897bd8feab6531181cd3be6..8210e0a9a9a45bcc240ea9498553d6d21ad9ebf2 100644 --- a/jass_preprocessing/map_reference.py +++ b/jass_preprocessing/map_reference.py @@ -15,7 +15,7 @@ def read_reference(gwas_reference_panel, mask_MHC=False, minimum_MAF=None, regio Filter the reference panel by minimum allele frequency (hg19 coordinate) minimum_MAF (float): minimum allele frequency for a SNPs to be retain in the panel region_to_mask (dict): a list of additional regions to mask - type_of_index(str): 'rsid' or 'positional' + type_of_index(str): 'rs-number' or 'positional' Return: ref (pandas dataframe): the reference_panel with the specified filter applied """ @@ -44,7 +44,7 @@ def read_reference(gwas_reference_panel, mask_MHC=False, minimum_MAF=None, regio -def map_on_ref_panel(gw_df , ref_panel, index_type="rsid"): +def map_on_ref_panel(gw_df , ref_panel, index_type="rs-number"): """ Merge Gwas dataframe with the reference panel Make sure that the same SNPs are in the reference panel and the gwas @@ -58,7 +58,7 @@ def map_on_ref_panel(gw_df , ref_panel, index_type="rsid"): """ - if index_type=="rsid": + if index_type=="rs-number": merge_GWAS = pd.merge(ref_panel, gw_df, how='inner', indicator=True, left_index=True, right_index=True) print("SNPs {}".format(merge_GWAS.shape[0])) @@ -80,7 +80,7 @@ def map_on_ref_panel(gw_df , ref_panel, index_type="rsid"): print(merge_GWAS) merge_GWAS.set_index("snp_id", inplace=True) else: - raise ValueError("index_type can take only two values: 'rsid' or 'positional'") + raise ValueError("index_type can take only two values: 'rs-number' or 'positional'") if (("pos" in merge_GWAS.columns) and ("POS" in merge_GWAS.columns)) if (merge_GWAS.pos == merge_GWAS.POS).mean()> 0.95):