I currently have a taxonomy pd dataframe whose first column holds the columns names of my FeatureTable[Frequency] (species), and each subsequent column in the taxonomy table holds names of higher taxa.
So how can I import this table into FeatureTable[Taxonomy]?
I have been searching for several hours and can find no documentation at all describing the format qiime2 expects for FeatureTable[Taxonomy].
Also, is there any python package that can convert the dataframe mentioned above into the required format?
Your pd dataframe should contain 2 columns, Feature ID and Taxon. In Taxon column, all taxonomy levels should be merged in one string, separated by ";". When your table is ready, save it as a tsv file (your_table.to_csv("taxonomy.tsv", sep="\t"). If feature ids column in your dataframe is not an index (your rows are numbered), then you will need to drop index while writing it to tsv table (something like index= False). Then you can import it to Qiime2. In this thread you can find example commands and format.
I am a little bit confused with your table. Can you post a slice of it as an example?
I guess that you are working with already collapsed to species level data. In that case species should be a Feature IDs (if you do not have other IDs in your table). If I am right, you can also create a taxonomy file with species as IDs and also include species to the Taxon column.
You can use them in this format to indicate taxonomy level (kingdom, phylum, etc). But they are not necessary.
Here is an example how df should be formatted to import as feature table:
So in your table should be transposed (df = df.T).
Since you want to import is a frequency, not relative abundances, I wonder why you have float values instead of integers. Are they percents? Or averages? If they are averages, you can round them to integers before import If they are percents, you should divide them by 100 to get ratios and import as FeatureTable[RelativeFrequency].
I never worked with artifact API, but you can check both variants (with feature IDs as index and as a column with numbered index) and check which will give you right table at the end.