One of the most common conversions to biom tables is from pandas data frames. Thus, having a Table.from_dataframe command would be a strong utility. As a first pass, the following can be done
@staticmethod
def from_dataframe(self, df):
""" pd.DataFrame with rows as samples and features as columns. """
return biom.Table(df.values.T, df.columns, df.index)
I find myself copying / pasting this command quite often. So having this embedded within biom would be low hanging fruit, but slightly ease analysis effort.
One of the most common conversions to biom tables is from pandas data frames. Thus, having a
Table.from_dataframe
command would be a strong utility. As a first pass, the following can be doneI find myself copying / pasting this command quite often. So having this embedded within biom would be low hanging fruit, but slightly ease analysis effort.