ReinV / SCOPE

Search and Chemical Ontology Plotting Environment
Other
1 stars 2 forks source link

Bug in make_table.py? #32

Closed magnuspalmblad closed 3 years ago

magnuspalmblad commented 3 years ago

So it looks as if search_query.py works fine and creates the correct results files. But there is an issue with make_table.py. Perhaps I do not have the necessary files in "searches_by_year"? See output below (directory content at the end):

(base) C:\Users\Magnus Palmblad\Downloads\SCOPE-master>python search_query.py -i queries/input_queries.txt
searching with: (Metabolomics OR metabonomics) AND (METHODS:"Nuclear Magnetic Resonance" OR METHODS:NMR OR METHODS:"NMR spectrometry" OR METHODS:"nuclear magnetic resonance spectrometry" OR METHODS:"NMR spectroscopy" OR METHODS:"nuclear magnetic resonance (NMR) spectroscopy")
searching publications...
total hits: 5172
1/6 pages retrieved
2/6 pages retrieved
3/6 pages retrieved
4/6 pages retrieved
5/6 pages retrieved
6/6 pages retrieved
7/6 pages retrieved
NMR query results are written to file
5148 publications with text mined terms and annotations of type 'chemical' found for NMR
searching with: (Metabolomics OR metabonomics) AND (METHODS:"LC/MS" OR METHODS:"LC-MS" OR METHODS:"LC MS" OR METHODS:"liquid chromatography mass spectrometry" OR METHODS:"liquid chromatography/mass spectrometry" OR METHODS:"LCMS")
searching publications...
total hits: 11060
1/12 pages retrieved
2/12 pages retrieved
3/12 pages retrieved
4/12 pages retrieved
5/12 pages retrieved
6/12 pages retrieved
7/12 pages retrieved
8/12 pages retrieved
9/12 pages retrieved
10/12 pages retrieved
11/12 pages retrieved
12/12 pages retrieved
LCMS query results are written to file
11034 publications with text mined terms and annotations of type 'chemical' found for LCMS

(base) C:\Users\Magnus Palmblad\Downloads\SCOPE-master>python make_table.py -i results -t folder
getting searches by year ...
Traceback (most recent call last):
  File "make_table.py", line 160, in <module>
    main()
  File "make_table.py", line 135, in main
    data = import_properties()
  File "make_table.py", line 60, in import_properties
    df['ChEBI'] = df['ChEBI'].astype(int)
  File "C:\Users\Magnus Palmblad\anaconda3\lib\site-packages\pandas\core\frame.py", line 2773, in __getitem__
    if self.columns.is_unique and key in self.columns:
  File "C:\Users\Magnus Palmblad\anaconda3\lib\site-packages\pandas\core\generic.py", line 5270, in __getattr__
    return object.__getattribute__(self, name)
  File "pandas\_libs\properties.pyx", line 63, in pandas._libs.properties.AxisProperty.__get__
  File "C:\Users\Magnus Palmblad\anaconda3\lib\site-packages\pandas\core\generic.py", line 5270, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute '_data'

(base) C:\Users\Magnus Palmblad\Downloads\SCOPE-master>ls -l results
total 30599
-rw-rw-rw-   1 user     group    21426748 Sep  9 17:23 LCMS_ChEBI_IDs.tsv
-rw-rw-rw-   1 user     group     9905624 Sep  9 17:15 NMR_ChEBI_IDs.tsv

(base) C:\Users\Magnus Palmblad\Downloads\SCOPE-master>ls -l searches_by_year
total 1044683
-rw-rw-rw-   1 user     group    287649374 Sep  9 15:06 2000-2009_ChEBI_IDS.tsv
-rw-rw-rw-   1 user     group    756443045 Sep  9 15:05 2010-2019_ChEBI_IDs.tsv
-rw-rw-rw-   1 user     group    25661453 Sep  9 15:02 2020-2029_ChEBI_IDs.tsv

(base) C:\Users\Magnus Palmblad\Downloads\SCOPE-master>
ReinV commented 3 years ago

This error happened when importing the files from the files folder, more specifically the "ChEBI2Class.pkl" file. Could you check if all the files are in the files folder? The .pkl file should be around 56MB

ReinV commented 3 years ago

If so, try updating the pandas package.

magnuspalmblad commented 3 years ago

I updated pandas to no effect, then updated all libraries with conda update --all, which did the trick! Perhaps we could add some advice to Windows users to install the latest version of Anaconda or similar?