biocore / biocore/gemelli

ValueError: No more features left. Check to make sure that the sample names between `sample-metadata` and `table` are consistent

Open
#34 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
92
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Running the stand-alone version of `gemelli` on the example data used in the tutorial I get the error `ValueError: No more features left. Check to make sure that the sample names between `sample-metadata` and `table` are consistent`

As I'm not a `Python` person, I filter the example data in `R`.

```
mdat <- read.table("IBD-2538/data/metadata.tsv", sep='\t', header=T) # nrow(mdat) 516
ftbl <- biomformat::read_biom("IBD-2538/data/table.biom")
ftbl <- as(biomformat::biom_data(ftbl), "matrix") # ncol(ftbl) 470

mdat <- mdat %>% filter(sample_name %in% colnames(ftbl))
rownames(mdat) <- mdat $sample_name

ps <- phyloseq(otu_table(ftbl, taxa_are_rows=T),
sample_data(mdat))
# here I skip adding the taxonomy

ps <- metagMisc::phyloseq_filter_prevalence(ps, prev.trh=0.2, abund.trh=10, abund.type="total", threshold_condition="AND")

> ps
phyloseq-class experiment-level object
otu_table() OTU Table: [ 236 taxa and 318 samples ]
sample_data() Sample Data: [ 318 samples by 128 sample variables ]

# Do we need to filter to only keep subjects with >=t timepoints?

biomformat::write_biom(biomformat::make_biom(t(otu_table(ps))), "table_filt.biom")
write.table(sample_data(ps), "metadata_filt.txt", sep="\t", quote=F)
```

Having made sure that samples match between the feature table and the metadata (plus filtered the our rare stuff), I run `gemelli` and get the following error

```
gemelli \
--in-biom table_filt.biom \
--sample-metadata-file metadata_filt.txt \
--individual-id-column 'host_subject_id' \
--state-column-1 'timepoint' \
--output-dir results

Traceback (most recent call last):
File "/Users/johannesbjork/python/miniconda3/bin/gemelli", line 8, in
sys.exit(standalone_ctf())
File "/Users/johannesbjork/python/miniconda3/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/johannesbjork/python/miniconda3/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/johannesbjork/python/miniconda3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/johannesbjork/python/miniconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/johannesbjork/python/miniconda3/lib/python3.7/site-packages/gemelli/scripts/_standalone_ctf.py", line 131, in standalone_ctf
feature_metadata)
File "/Users/johannesbjork/python/miniconda3/lib/python3.7/site-packages/gemelli/ctf.py", line 97, in ctf_helper
raise ValueError(("No more features left. Check to make sure that "
ValueError: No more features left. Check to make sure that the sample names between `sample-metadata` and `table` are consistent
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported command with the filtered table_filt.biom and metadata_filt.txt, then inspect gemelli/scripts/_standalone_ctf.py and gemelli/ctf.py at the traceback locations. Determine why valid matching samples and retained features lead to the ValueError; done means the example invocation completes or reports the actual invalid input clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.