Cloufield / gwaslab

A Python package for handling and visualizing GWAS summary statistics. https://cloufield.github.io/gwaslab/
GNU General Public License v3.0
119 stars 22 forks source link

Miami plot giving error #35

Closed soumickmj closed 1 year ago

soumickmj commented 1 year ago

Hi, I'm trying to create maimi plot using the following code:

gl.plot_miami(path1=path1, path2=path2, titles=["1DD","2DD"], mode="pickle", cols1=["SNPID", "CHR", "EAF", "MLOG10P"], cols2=["SNPID", "CHR", "EAF", "MLOG10P"], scaled=True, sig_level=5e-8, sig_line_color="blue",

suggestive_sig_line=True,

            suggestive_sig_level=5e-8/2, 
            skip=2, anno="GENENAME", build="19", verbose=False)

Here path1 and path2 contains pickles - created using gl.dump_pickle(sumstats)

When I'm running the code, I'm getting the following:

/scratch/soumick.chatterjee/conda_envs/BeegFSTorchHTBeta2/lib/python3.10/site-packages/gwaslab/miamiplot.py:304, in plot_miami(path1, path2, cols1, cols2, sep, mode, chr_dict, chr_dict1, chr_dict2, scaled, scaled1, scaled2, region, region_step, region_grid, region_grid_line, region_lead_grid, region_lead_grid_line, anno, anno_set, anno_set1, anno_set2, anno_alias1, anno_alias2, anno_d1, anno_d2, anno_args, anno_style, anno_fixed_arm_length, anno_source, anno_max_iter, anno_adjust, arm_offset, arm_scale, arm_scale_d, highlight, highlight1, highlight2, highlight_color, highlight_windowkb, pinpoint, pinpoint1, pinpoint2, pinpoint_color, titles, titles_pad, cut, skip, build, cutfactor, readcsv_args, cut_line_color, sig_level, sig_line_color, suggestive_sig_level, region_hspace, windowsizekb, dpi, figargs, fontsize, font_family, colors1, colors2, scatter_kwargs, xlabel_coords, xtick_label_pad, marker_size, verbose, xtickpad, repel_force, save, saveargs, log) 301 sumstats = _quick_extract_snp_in_region(sumstats,region, verbose=verbose, log=log) 303 # assign i and get tick dictionary --> 304 sumstats, chrom_df = _quick_assign_i(sumstats) 306 ## assign highlight indicator 307 if len(highlight1)>0 or len(highlight2)>0:

File /scratch/soumick.chatterjee/conda_envs/BeegFSTorchHTBeta2/lib/python3.10/site-packages/gwaslab/quickfix.py:148, in _quick_assign_i(sumstats, chrom, pos) 146 interval_between_chr = sumstats[pos].max()*0.05 147 # cumulative sum dictionary --> 148 for i in range(1,sumstats[chrom].max()+1): 149 posdiccul[i] = posdiccul[i-1] + posdiccul[i] + interval_between_chr 150 # convert base pair postion to x axis position using the cumulative sum dictionary

TypeError: 'NAType' object cannot be interpreted as an integer

Any idea what's going wrong?

Thanks :)