Feature table importing

Hi!

I have a feature table I recived from collaborator, using Qiime1 to process the sequences.
It looks like feature tables usually look, with first coulmn containing feature information and each coulmn is a sample with counts:

taxatable = pd.read_table("/table.tsv", index_col = 0)

gives me a dataframe of all features as indexes and coulmns for samples.

Than, if I try to import it as a QIIME2 feature table:

taxatable_feature_table = q2.Artifact.import_data(type="FeatureTable[Frequency]", view=taxatable)

and summarize the results, I get a table of my features as samples, and samples as features. obviously calling

transpose()

on the taxatable solves it, but from what I know my origial table looks like feature tables should be organised for QIIME2..

Hi @kam,

Another python API user! Whoo!

One of the delightfully weird tricks about the python API is that the pandas representation of a feature table uses samples as rows and features as columns, but the biom Table representation uses features as row and samples as columns.

QIIME 1 was based on a biom format exclusively with a biom export. My suspecion is the at the table was exported using the biom convert functionality which didn't do transposition.

So, yeah, transpose your table or convert the text (pandas) table to a biom.Table object before importing.

Best,
Justine

3 Likes

Thank you so much for the clarification

Working with Python API is sure confusing as a beginner but the ability to use concise code to work with artificats outside QIIME worth it..

3 Likes