MOTHUR vs QIIME x Tax4Fun -> are all .biom equal?

Good afternoon,

Please see at the end the different scripts I have implemented for trying to solve my problem, with # in ().

I am currently working with a bacterial 16S Illumina sequencing dataset.

I have cleaned, trimmed and assigned taxonomy (SILVA) using Mothur, following the whole pipeline.

I want now to use Tax4Fun (R package), instead of PICRUSt, to generate predictions of metagenome content.

To do so, I need a .biom file, which I have generated using the mothur function make.biom (1).

Now, I cannot import this .biom file in Tax4Fun for some reasons, although I have tried quite everything I could imagine : I always get the same error (2).

I contacted Tax4Fun authors, who have kindly sent me a sample QIIME-generated OTU_table.txt, so I could try and compare with mine. I converted my .biom file to .txt (3) to be able to compare. I didn’t notice any different (human-readable).

So I converted their .txt file to a .biom file (4) to try and see if I was properly using the import function of Tax4Fun and it worked (5). I tried to convert my .txt into a .biom file (6) to do the same and it did not work (7).

So my question is: is there something non-human readable in .biom files, that mothur and qiime would not write the same, that could lead to this different behaviour from Tax4Fun?
If so, and even if not, do you know any trick I could use to make it work?

Thank you very much in advance,

Cecile

(1) In mothur:

make.biom(my_shared.shared, constaxonomy=my_constax.0.03.cons.taxonomy)

Mothur answers:

0.03
Output File Names:
my_mothur_biom.biom

(2) In R:

importQIIMEBiomData ('my_mothur_biom.biom')

R answers:

Error in rowsum.default(as.matrix(taxProfile), ModSilvaIds) :
  incorrect length for 'group'

(3) In Qiime:

biom convert -i my_mothur_biom.biom -o my_mothur_biom.txt --to-tsv

(4) In Qiime:

biom convert -i OTU_table_sample.txt -o OTU_table_sample.biom --to-hdf5 --table-type="OTU table" --process-obs-metadata taxonomy

(5) In R:

importQIIMEBiomData ('OTU_table_sample.biom')

(6) In Qiime:

biom convert -i my_mothur_biom.txt -o my_qiime_biom.biom --to-hdf5 --table-type="OTU table" --process-obs-metadata taxonomy

(7) In R:

importQIIMEBiomData ('my_qiime_biom.biom')

R answers:

Error in rowsum.default(as.matrix(taxProfile), ModSilvaIds) :
  incorrect length for 'group'

Hi all,

My colleague Matthew :ugeek: solved this issue like this (I quote:)

'It seems the mothur command produces biom files of version 0.9.1 whilst Tax4Fun needs version 1.0.0.

I made the biom file with the below command in mothur

make.biom(shared=glacier_samples_16s_v3_4.92_111_excluded.makecontigs.trim.contigs.good.unique.good.filter.precluster.pick.pick.subsample.an.unique_list.shared,label=0.03,constaxonomy=glacier_samples_16s_v3_4.92_111_excluded.makecontigs.trim.contigs.good.unique.good.filter.precluster.pick.pick.subsample.an.unique_list.0.03.cons.taxonomy)

Then I converted the file into the text format with the below command (glacier.biom was what I named the file produced from the above command):

biom convert --table-type="OTU table" -i glacier.biom -o glacier.biom.txt --biom-to-classic-table

However the produced text file was missing the taxonomy information for some reason
So I opened the mothur taxonomy file in excel and removed the brackets with numbers (I did this by replacing every (*) with nothing.
I then opened the biom.txt file with excel and copy and pasted the taxonomy information to the last column.’

Thanks anyway to all of those who had a thought about this problem.

NB: we don’t know yet if this will go through the whole Tax4Fun functions, but are really hopeful.

Thanks for bringing this to our attention. We will update mothur’s version of the biom file outputted.

FWIW, the biom standard isn’t totally static and isn’t backwards compatible. :frowning:

Hi Cecile,

thank you for your post, it really help me!!!, I just would like to ask you if you could predict your functional capabilities. I try but I got just FTU statistical value. I appreciate some advice.

Daniel

Dear all,

Can anyone help for further analysis? As Daniel, I got FTU results but I don’t know how to go on further. Do we need installed Matlab/Octave for Taxy Toolkit?

Any help?

Thanks a lot.

Best wishes,
Bahti

This is what I usually use for my Tax4Fun Outputs:

myQiimeBiom <- importQIIMEBiomData("file.biom")

folderReferenceData <- "~/Tax4FunData_Downloads/SILVA123/"

Tax4FunOut <- Tax4Fun(myQiimeBiom, folderReferenceData)

print(Tax4FunOutput)

AbundanceProfile <- Tax4FunOutput$Tax4FunProfile

AbundanceProfile <- data.frame(t(AbundanceProfile))

#save as tsv to open in excel

write.table(AbundanceProfile,"Tax4FunOutput.tsv",sep="\t")

Hi all,

I’m trying to use Tax4Fun too, but I got the same error as Cecile: Error in rowsum.default(as.matrix(taxProfile), ModSilvaIds) :
incorrect length for ‘group’

I noticed that the biom file created is still in “format”: “Biological Observation Matrix 0.9.1”. Is this format version 0.9.1 or 1.0? make.biom wiki (http://www.mothur.org/wiki/Make.biom) did mention that mothur support format version 1.0.

So I wonder if you can use the mothur created biom file directly or there are further steps in order to import to R/Tax4Fun?

Thanks,
Soon

Hi there,
Just wondering if there has been any update on solutions to use mothur .biom tables in Tax4Fun.
Thanks a lot!
Julia

Sorry, we don’t use Tax4Fun and have no experience with it. It would help if the biom standard people would stop changing the standard :). I’d encourage you to reach out to the Tax4Fun people to see what the bug might be.

Pat

Hi,
Have anybody never succeed to use mothur and then tax4Fun?
I converted my mothur biom file to a tsv file as follows in QIIME:
biom convert -i *biom -o otu_table.txt --header-key taxonomy --table-type “OTU table” --to-tsv
The otu_table.txt file was then used with Tax4Fun:
data<-importQIIMEData(“otu_table.txt”)
folderReferenceData<- “/r_packages/Tax4Fun/SILVA123/”
results <- Tax4Fun(data,folderReferenceData)

However I get the following error message: Error in dimnames(x)<- dn: length of ‘dimnames’ [1] not equal to array extent

Somebody suggested to use raw taxonomy file (raw_tawonomy.txt), but is it possible in mothur? I think mothur wants taxonomy files to be taxonomy files not txt files or what is this raw taxonomy means?

Thank you for any suggestion!

Hi

The solution I found was a combination of all the above mentioned processes so:


I converted my mothur biom file to a tsv file as follows in QIIME:

biom convert -i D5.biom -o D5.txt --to-tsv --header-key taxonomy

To stop getting the error message:

Error in dimnames(x)<- dn: length of ‘dimnames’ [1] not equal to array extent

You need to replace the Taxonomy at the end of the D5.txt file with the Taxonomy from the *.user.label.cons.taxonomy file produced in mothur during their SOP.

I done this in excel and then remove the numbers in brackets with
Ctrl+H and replace (*) with nothing

then remove the " to
Ctrl+H and replace " with nothing

then create a space after the semi colon separating the taxonomic levels
Ctrl+H and replace ; with ; Space

resave the file and follow the SOP as below.

The otu_table.txt file was then used with Tax4Fun:

library(Tax4Fun)
file<-importQIIMEData(“D5.txt”)
folderReferenceData<- “C:\Users\b3038917\Desktop\SILVA123”
file_collapsed<-Tax4Fun(file,folderReferenceData,fctProfiling = FALSE, refProfile = “UProC”,shortReadMode = TRUE,normCopyNo = TRUE)
Tax4FunProfile_c<- file_collapsed$Tax4FunProfile
Tax4FunProfile_c <-data.frame(t(file_collapsed$Tax4FunProfile))
write.table(Tax4FunProfile_c,“Tax4fun_collapsed.csv”,sep=";")

Hope this saves somebody some time as I spent days trying to solve it.