FRED-2 / OptiType

Precision HLA typing from next-generation sequencing data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OptiType crashes after loading reads

TimFugmann opened this issue · comments

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

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'

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.

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

Yup, correct, thx.