FINNGEN / autoreporting

MIT License
0 stars 1 forks source link

error if special characters in column names. replace illegal characters or warning or error out early #68

Open Fedja opened 4 years ago

Fedja commented 4 years ago
filter & group SNPs
Traceback (most recent call last):
  File "autoreporting/Scripts/main.py", line 125, in <module>
    main(args)
  File "autoreporting/Scripts/main.py", line 34, in main
    ignore_region=args.ignore_region, cred_set_file=args.cred_set_file,ld_api=ld_api)
  File "/mnt/disks/r4/mitja/autoreporting/Scripts/gws_fetch.py", line 210, in fetch_gws
    temp_df=get_gws_variants(gws_fpath,sign_treshold=sig_tresh_2,dtype=dtype,columns=columns,compression="gzip")
  File "/mnt/disks/r4/mitja/autoreporting/Scripts/gws_fetch.py", line 170, in get_gws_variants
    retval=retval[ [ columns["chrom"],columns["pos"],columns["ref"],columns["alt"],columns["pval"], columns["beta"],columns["af"] ] ]
  File "/home/mitja/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 2806, in __getitem__
    indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
  File "/home/mitja/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1551, in _get_listlike_indexer
    keyarr, indexer, o._get_axis_number(axis), raise_missing=raise_missing
  File "/home/mitja/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1644, in _validate_read_indexer
    raise KeyError(f"{not_found} not in index")
KeyError: "['#CHROM'] not in index"
Lipastomies commented 4 years ago

Can you add the script call and input file columns? I usually get that error if the input file has different column names than those that are supplied with --column-labels. Nevertheless, that error should be handled more gracefully.