leffj / mctoolsr

Microbial community analysis tools in R
http://leffj.github.io/mctoolsr/
20 stars 8 forks source link

Issue loading data #26

Closed nidhiv13 closed 6 months ago

nidhiv13 commented 7 years ago

I get an error every time I load the biom table and map.

Downloading GitHub repo leffj/mctoolsr@master from URL https://api.github.com/repos/leffj/mctoolsr/zipball/master Installing mctoolsr '/Library/Frameworks/R.framework/Resources/bin/R' \ --no-site-file --no-environ --no-save \ --no-restore --quiet CMD INSTALL \ '/private/var/folders/bt/j1th0gjn1mbdgcr1xh1x3bgw0000gn/T/RtmpmPeLAW/devtools1f2161915170/leffj-mctoolsr-2265f34' \ --library='/Library/Frameworks/R.framework/Versions/3.3/Resources/library' \ --install-tests

Attaching package: ‘mctoolsr’

The following object is masked from ‘package:phyloseq’:

plot_ordination

tax=system.file('fruits_veggies_taxa_table_wTax.biom', package = 'mctoolsr') mapp=system.file('fruits_veggies_metadata.txt',package = 'mctoolsr') inp=load_taxa_table(tax, mapp) Error in load_taxa_table(tax, mapp) : Input file must be either biom (.biom) or tab-delimited (.txt) format.

Any suggestions as to what may be going wrong will help.

R version:

version _
platform x86_64-apple-darwin13.4.0
arch x86_64
os darwin13.4.0
system x86_64, darwin13.4.0
status
major 3
minor 3.2
year 2016
month 10
day 31
svn rev 71607
language R
version.string R version 3.3.2 (2016-10-31) nickname Sincere Pumpkin Patch

Thanks!

leffj commented 7 years ago

Hi could you post the code you are running? Try detaching phyloseq before using mctoolsr: detach("package:phyloseq", unload=TRUE)

saltyk commented 7 years ago

I have the same problem. I am certain that my biom table and map file are formatted correctly (I've been using them in QIIME)

I successfully downloaded and installed mctoolsr today. I am using R version 3.3.0 (2016-05-03) on a Mac running OS Sierra. I've tried using the demo files as well as my own. My scripts:

tax_table_fp = system.file('extdata','otu_table_bacteria_3+.biom',package = 'mctoolsr') map_fp=system.file('extdata','AS_LS_16S_final_map.txt',package = 'mctoolsr') input=load_taxa_table(tax_table_fp,map_fp) Error in load_taxa_table(tax_table_fp, map_fp) : Input file must be either biom (.biom) or tab-delimited (.txt) format.

Any ideas would be most welcome

Thanks!

amoliverio commented 7 years ago

@saltyk - you might try something like this:

load package

library(mctoolsr)

set working directory to folder which contains files

setwd("/Users/YourUsername/desktop/ProjectFolder")

set tax_table_fp to name of tax table file and map_fp to map file name (they should both be within folder you set working directory to)

tax_table_fp = 'otu_table_bacteria_3+.biom' map_fp = 'AS_LS_16S_final_map.txt' input = load_taxa_table(tax_table_fp, map_fp)

let me know if that works! Also, not sure if using + symbol in file name throws an error, but could try changing file name if above doesn't fix.

nidhiv13 commented 7 years ago

It worked for me after I detached phyloseq and vegan and then re-loaded phyloseq again. Sometimes, unfortunately, if you restart R it will work again.