Skip to content
Snippets Groups Projects
Commit 437be196 authored by Hanna  JULIENNE's avatar Hanna JULIENNE
Browse files

treat exception when missing position

parent e7fde0e3
No related branches found
No related tags found
No related merge requests found
...@@ -21,8 +21,10 @@ def read_reference(gwas_reference_panel, mask_MHC=False, minimum_MAF=None, regio ...@@ -21,8 +21,10 @@ def read_reference(gwas_reference_panel, mask_MHC=False, minimum_MAF=None, regio
""" """
ref = pd.read_csv(gwas_reference_panel, header=None, sep= "\t", ref = pd.read_csv(gwas_reference_panel, header=None, sep= "\t",
names =[ 'chr', "snp_id", "MAF","pos", "ref", "alt"], names =[ 'chr', "snp_id", "MAF","pos", "ref", "alt"],
dtype = {"chr": str, "snp_id":str, "MAF": np.double, "pos":np.int64, "ref":str, "alt":str}, dtype = {"chr": str, "snp_id":str, "MAF": np.double, "pos":np.double, "ref":str, "alt":str},
index_col="snp_id") index_col="snp_id")
ref = ref.loc[~ref.pos.isnull()]
ref.pos = ref.pos.astype('int')
def sorted_alleles(x): def sorted_alleles(x):
return "".join(sorted(x)) return "".join(sorted(x))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment