Error with Gemelli CF TypeError: '<' not supported between instances of 'str' and 'float'

Hi Qiime2 folks!

I’ve been exploring compositionally-aware analyses and recently have been attempting to use CTF in the gemelli plugin to look at repeated measure data.

I ran the following:

(qiime2-2021.2) Mollys-MacBook-Pro-2:~ mollybletz$ qiime gemelli ctf --i-table /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234/Temp14-TS_t1-4_Filtlowsamp_CopCor_True_abund_estimate_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_TempDose_Exp_merged1234.qza --m-sample-metadata-file /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/Metadata_NSFEEID_16SRuns_1234Merged_plusExpData.txt --m-feature-metadata-file /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/EEID_16S_1234_Taxonomywplasmid.qza --p-state-column SampleDay --p-individual-id-column UTKID --output-dir EEID_14C_TimeSeries_t1-4_Gemelli_CopCorData

And I have been getting the follow error:

**Plugin error from gemelli:**

**'<' not supported between instances of 'str' and 'float'**

**See above for debug info.** 

Traceback (most recent call last):
  File "/Users/mollybletz/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "<decorator-gen-558>", line 2, in ctf
  File "/Users/mollybletz/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    output_types, provenance)
  File "/Users/mollybletz/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 390, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/Users/mollybletz/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/gemelli/ctf.py", line 40, in ctf
    feature_metadata)
  File "/Users/mollybletz/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/gemelli/ctf.py", line 122, in ctf_helper
    individual_id_column, state_columns)
  File "/Users/mollybletz/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/gemelli/preprocessing.py", line 346, in construct
    self._construct()
  File "/Users/mollybletz/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/gemelli/preprocessing.py", line 395, in _construct
    subject_order = sortset(mf[self.subjects])
  File "/Users/mollybletz/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/gemelli/preprocessing.py", line 393, in sortset
    def sortset(ids): return sorted(set(ids))
TypeError: '<' not supported between instances of 'str' and 'float'

Any thoughts on the cause of this error? I do have a slightly unbalanced design with individuals dropping out at later timepoints. Could that be causing the error

1 Like

Hi @Molly_Bletz.

I’m not involved in the CTF development (cc @cmartino) but it looks like there might be some mixed typing in your IDs. I’ve had this happen when a sample ID “looks” like a decimal (i.e. 11234.50). Maybe check your metadata file and see if this might be the case?

3 Likes

Hi @Molly_Bletz,

I believe @gibsramen is correct - it is likely your subject and/or sample IDs have both floats and strings. Let me know if changing the IDs did not fix the problem.

Thanks!

2 Likes

Thanks @cmartino and @gibsramen! And apologies for the delay in my response.

My sample IDs look like the following:
NSF14-NOVI-PM36
NSF22-NOVI-3M8
NSF22-NOVI-7M13
NSF14-NOVI-2M10
NSF14-NOVI-PM14
NSF22-NOVI-3M10
NSF22-NOVI-5M4
NSF22-NOVI-4M4
NSF22-NOVI-3M9
NSF14-NOVI-PM5

So I don’t have decimals, but there are numbers and letters. Would removing the dashes help?

1 Like

Hi @Molly_Bletz,

What do the values in the subject column “UTKID” used for --p-individual-id-column look like? I think that is where the issue is occurring.

Thanks!

1 Like

Hi @cmartino ,

Those IDs look as follows:
UTKID
M36
M38
M40
M42
M39
M43
M44
M37
M41
M45

1 Like

Hi @Molly_Bletz,

Thank you for your patience.

Would it be possible to send the full metadata for the columns being used with CTF? I can’t see why any of the IDs you sent would cause an error unless there is some exception (some missing values or mixed types).

Thanks,

Cameron

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.