aitgon / vtam

MIT License
3 stars 3 forks source link

Error make_known_occurrences #29

Closed meglecz closed 2 years ago

meglecz commented 2 years ago

The following command returns an error

vtam make_known_occurrences  --asvtable asvtable_default_mfzr.tsv --sample_types sample_types_fish.tsv --mock_composition mock_composition_fish_mfzr.tsv 

(vtam_2) 10:55 meglecz@bombyx ~/vtam_benchmark/vtam_fish/test % vtam make_known_occurrences  --asvtable asvtable_default_mfzr.tsv --sample_types sample_types_fish.tsv --mock_composition mock_composition_fish_mfzr.tsv
Traceback (most recent call last):
  File "/home/meglecz/miniconda3/envs/vtam_2/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 3361, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 76, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'action'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/meglecz/miniconda3/envs/vtam_2/bin/vtam", line 8, in <module>
    sys.exit(main())
  File "/home/meglecz/miniconda3/envs/vtam_2/lib/python3.7/site-packages/vtam/__init__.py", line 308, in main
    VTAM(sys.argv[1:])
  File "/home/meglecz/miniconda3/envs/vtam_2/lib/python3.7/site-packages/vtam/__init__.py", line 291, in __init__
    CommandMakeKnownOccurrences.main(asvTable=asvTable,sampleTypes=sampleTypes,mockComposition=mockComposition,habitat_proportion=habitat_proportion,known_occurrences=known_occurrences,missing_occurrences=missing_occurrences)
  File "/home/meglecz/miniconda3/envs/vtam_2/lib/python3.7/site-packages/vtam/CommandMakeKnownOccurrences.py", line 21, in main
    occurrences = mock[mock['action']!='tolerate'].replace(np.nan, '', regex=True).astype(str)
  File "/home/meglecz/miniconda3/envs/vtam_2/lib/python3.7/site-packages/pandas/core/frame.py", line 3458, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/meglecz/miniconda3/envs/vtam_2/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 3363, in get_loc
    raise KeyError(key) from err
KeyError: 'action'
zsh: exit 1     vtam make_known_occurrences --asvtable asvtable_default_mfzr.tsv    

The input files are attached (change the tsv extention to csv, since tsv files are not accepted) asvtable_default_mfzr.csv mock_composition_fish_mfzr.csv sample_types_fish.csv

aitgon commented 2 years ago

I think the problem comes because the column names of "mock_composition_fish_mfzr.csv" are lower case including the first letter, eg, change Action -> action

meglecz commented 2 years ago

Thanks, it is working. I changed the doc, wich was missleading