FRED-2 / OptiType

Precision HLA typing from next-generation sequencing data
BSD 3-Clause "New" or "Revised" License
180 stars 74 forks source link

OptiType crashes after loading reads #100

Closed TimFugmann closed 4 years ago

TimFugmann commented 4 years ago

Hi there,

I am trying to run OptiType, but it crashes after loading the reads:

128K...129K...130K... 0:05:47.06 130124 reads loaded. Creating dataframe... Traceback (most recent call last): File "OptiTypePipeline.py", line 309, in <module> pos, read_details = ht.pysam_to_hdf(bam_paths[0]) File "/home/tfugman/OptiType/hlatyper.py", line 239, in pysam_to_hdf pos_df = pd.DataFrame.from_items(iter(hits.items())).T AttributeError: type object 'DataFrame' has no attribute 'from_items'

pysam is installed and working... Reads are there obviously...

Any idea? Thanks, Tim

Stikus commented 4 years ago

Same error here. Looks like 'FutureWarning' strikes back :) From old builds:

/soft/OptiType-1.3.2/hlatyper.py:239: FutureWarning: from_items is deprecated. Please use DataFrame.from_dict(dict(items), ...) instead. DataFrame.from_dict(OrderedDict(items)) may be used to preserve the key order.
  pos_df = pd.DataFrame.from_items(iter(hits.items())).T

Now:

Traceback (most recent call last):
  File "/soft/OptiType-1.3.2/OptiTypePipeline.py", line 310, in <module>
    pos, read_details = ht.pysam_to_hdf(bam_paths[0])
  File "/soft/OptiType-1.3.2/hlatyper.py", line 239, in pysam_to_hdf
    pos_df = pd.DataFrame.from_items(iter(hits.items())).T
AttributeError: type object 'DataFrame' has no attribute 'from_items'
Stikus commented 4 years ago

Looks like temp fix is to change: pos_df = pd.DataFrame.from_items(iter(hits.items())).T to pos_df = pd.DataFrame.from_dict(OrderedDict(iter(hits.items()))).T. Working for me now.

Stikus commented 4 years ago

Looks like this commit e2b5d7132c2b9ded854e7e544d31136ceaaefe3e contains fix for this issue. Is it correct, @andras86 ? Should you close it?

andras86 commented 4 years ago

Yup, correct, thx.