EichlerLab / pav

Phased assembly variant caller
98 stars 8 forks source link

possible typo caught by latest pandas #41

Closed dgordon562 closed 1 year ago

dgordon562 commented 1 year ago

Hi, Pete,

version: commit ccd826a5f8c8b8982b183c1efb819ba9d9328430 Author: Peter Audano peter.audano@jax.org Date: Wed May 31 09:32:09 2023 -0400

In call.snakefile with pandas 2.0.1 you get this error: RuleException:
AttributeError in file
/panfs/jay/groups/7/hsiehph/gordo893/pipelines/pav/rules/call.snakefile,
line 466:
'DataFrame' object has no attribute 'append'
File
"/panfs/jay/groups/7/hsiehph/gordo893/pipelines/pav/rules/call.snakefile",
line 466, in rule_call_integrate_sources
File
"/home/hsiehph/shared/conda_shared/envs/pav3/lib/python3.9/site-packages/pandas/core/generic.py", line 5989, in
getattr__
File
"/home/hsiehph/shared/conda_shared/envs/pav3/lib/python3.9/concurrent/futures/thread.py",
line 58, in run
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message

The lines that have this problem are:

 466         df_insdel_drp.append(df_insdel_drp)                                                 
467         df_snv_drp.append(df_snv_drp)    

Or here are the lines in context:

     # CIGAR: Filter by tig regions
    df_insdel, df_insdel_drp = pavlib.call.filter_by_tig_tree(df_insdel, tig_filter_tree)
    df_snv, df_snv_drp = pavlib.call.filter_by_tig_tree(df_snv, tig_filter_tree)

    df_insdel_drp['REASON'] = FILTER_REASON['TIG_FILTER']
    df_snv_drp['REASON'] = FILTER_REASON['TIG_FILTER']

    df_insdel_drp.append(df_insdel_drp)
    df_snv_drp.append(df_snv_drp)

I'm wondering if you really meant to write:

insdel_drp_list.append(df_insdel_drp)
snv_drp_list.append(df_snv_drp)

?

So why wasn't this problem before now? Because pandas used to allow dataframe.append but doesn't any longer. But I think you intended to append to the python list insdel_drp_list which has no problem.

I also wonder if this caused some incorrect results in the past?

Let me know.

Best wishes, David

engelbrechte commented 1 year ago

Hi all, I received the same error as David. Any suggestion would be appreciated!

Best, Eric

paudano commented 1 year ago

Fix is in place, I need to test and it will be in the next release (targeting 2.3.1).