Question: Error in file(con, “r”) : cannot open the connection
0
gravatar for moanam
4.2 years ago by
moanam0
New Zealand
moanam0 wrote:

Using R 3.2.2 in Windows 8.1, I'm trying to import a qiime otu table file, using this code:

biom_otu_tax <- import_biom("D:/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom")

However, I get the error message:

Error in file(con, "r") : cannot open the connection

I have tried every combination of:

  • First running setInternet2(TRUE) (this fixes it for most people)
  • Setting my working directory to the file location
  • Running it in R, rather than RStudio
  • Opening R/RStudio as an administrator
  • Restarting my computer

Nothing seems to fix it.

phyloseq R import_biom otu qiime • 13k views
ADD COMMENTlink modified 4.2 years ago by mcmurdie20 • written 4.2 years ago by moanam0

I feel like such an idiot, I got the file path wrong - missed a "/". However, when I corrected it I still got an error:

> biom_otu_tax <- import_biom("D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom")

Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input

The D drive is an external hard drive plugged into my laptop. Once I corrected the file path, everything else in your post worked as expected.

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_New Zealand.1252  LC_CTYPE=English_New Zealand.1252    LC_MONETARY=English_New Zealand.1252
[4] LC_NUMERIC=C                         LC_TIME=English_New Zealand.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_1.0.1   phyloseq_1.14.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.1         plyr_1.8.3          XVector_0.10.0      iterators_1.0.8     tools_3.2.2         zlibbioc_1.16.0    
 [7] digest_0.6.8        gtable_0.1.2        nlme_3.1-122        lattice_0.20-33     mgcv_1.8-7          Matrix_1.2-2       
[13] foreach_1.4.3       igraph_1.0.1        parallel_3.2.2      proto_0.3-10        stringr_1.0.0       cluster_2.0.3      
[19] Biostrings_2.38.0   S4Vectors_0.8.0     IRanges_2.4.0       stats4_3.2.2        ade4_1.7-2          multtest_2.26.0    
[25] grid_3.2.2          Biobase_2.30.0      data.table_1.9.6    survival_2.38-3     RJSONIO_1.3-0       reshape2_1.4.1     
[31] magrittr_1.5        scales_0.3.0        codetools_0.2-14    MASS_7.3-44         BiocGenerics_0.16.0 splines_3.2.2      
[37] permute_0.8-4       colorspace_1.2-6    ape_3.3             stringi_0.5-5       munsell_0.4.2       biom_0.3.12        
[43] chron_2.3-47        vegan_2.3-1
ADD REPLYlink written 4.2 years ago by moanam0

OK, this indicates (possibly) that the file does not have the contents that import_biom() expects.

I'm not sure exactly beyond that. I'll ask the phyloseq maintainer to have a look at this. They may ask you to share your file so that they can try and reproduce the problem.

ADD REPLYlink written 4.2 years ago by Dan Tenenbaum8.2k

file.choose() provides a point-and-click way of choosing files; also, tab completion works on file paths.

ADD REPLYlink written 4.2 years ago by Martin Morgan ♦♦ 24k

It worked!! Thank you!!!

ADD REPLYlink written 4.2 years ago by moanam0

This seems to have caused problems further down the line with the otu table not being read properly

ADD REPLYlink written 4.2 years ago by moanam0

When you say "this", do you mean choosing the file with file.choose() and/or tab-completion? What is the error you are getting? Is it the same one you reported earlier (invalid JSON input)? It would be helpful if you could post the complete session--all the commands you tried and R's response.

ADD REPLYlink written 4.2 years ago by Dan Tenenbaum8.2k

I meant file.choose(). Yes, I have been getting the same JSON error. I found another thread that suggests that this may be due to newer versions of qiime producing biom files in a different format which is not read correctly into phyloseq.
https://github.com/joey711/phyloseq/issues/443

I'll check my qiime version later (I didn't use this computer) and see if I can fix it as suggested in that thread. If not, you'll be hearing more from me soon! Thanks so much for all your help.

For reference, here is my console so far:

R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(phyloseq)
> library(ggplot2)
> biom_otu_tax <- import_biom("D:/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom")
Error in file(con, "r") : cannot open the connection
> setwd("~/Uni/2015/ECOL491/Hard drive/from_qiime/micro/results/otus_open_ref_R1")
> biom_otu_tax <- import_biom("C:/Users/Moana/Documents/Uni/2015/ECOL491/Hard drive/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom")
Error in file(con, "r") : cannot open the connection
> file.exists("D:/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom")
[1] FALSE
> file.exists("C:/Users/Moana/Documents/Uni/2015/ECOL491/Hard drive/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom")
[1] FALSE
> file.exists("C:/Users/Moana/Documents/Uni/2015/ECOL491/Hard drive/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom")
[1] TRUE
> biom_otu_tax <- import_biom("D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom")
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> uzdir <- "D:/from_qiime/micro/results/otus_open_ref_R1"
> otutable_biom_file <- paste(uzdir, "otu_table_mc2_w_tax_no_pynast_failures.biom", sep = "")
> vzdir <- "D:/Qiime_files"
> map_file <- paste(vzdir, "BaltarsurveymapR.txt", sep = "")
> biom_otu_tax <- import_biom(otutable_biom_file)
Error in file(con, "r") : cannot open the connection
> uzdir <- "D:/from_qiime/micro/results/otus_open_ref_R1/"
> otutable_biom_file <- paste(uzdir, "otu_table_mc2_w_tax_no_pynast_failures.biom", sep = "")
> biom_otu_tax <- import_biom(otutable_biom_file)
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> file.info("D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom")
                                                                                            size isdir mode
D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom 1729602 FALSE  666
                                                                                                       mtime
D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom 2015-10-13 17:10:28
                                                                                                       ctime      atime exe
D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom 2015-10-13 17:10:28 2015-10-16  no
> head(readLines("D:/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom"))
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file 'D:/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom': No such file or directory
> head(readLines("D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom"))
[1] "‰HDF"
> example(import_biom)

imprt_> # An included example of a rich dense biom file
imprt_> rich_dense_biom  <- system.file("extdata", "rich_dense_otu_table.biom",  package="phyloseq")

imprt_> import_biom(rich_dense_biom,  parseFunction=parse_taxonomy_greengenes)
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 5 taxa and 6 samples ]
sample_data() Sample Data:       [ 6 samples by 4 sample variables ]
tax_table()   Taxonomy Table:    [ 5 taxa by 7 taxonomic ranks ]

imprt_> # An included example of a sparse dense biom file
imprt_> rich_sparse_biom <- system.file("extdata", "rich_sparse_otu_table.biom", package="phyloseq")

imprt_> import_biom(rich_sparse_biom, parseFunction=parse_taxonomy_greengenes)
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 5 taxa and 6 samples ]
sample_data() Sample Data:       [ 6 samples by 4 sample variables ]
tax_table()   Taxonomy Table:    [ 5 taxa by 7 taxonomic ranks ]

imprt_> # # # Example code for importing large file with parallel backend
imprt_> # library("doParallel")
imprt_> # registerDoParallel(cores=6)
imprt_> # import_biom("my/file/path/file.biom", parseFunction=parse_taxonomy_greengenes, parallel=TRUE)
imprt_> 
imprt_> 
imprt_> 
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_New Zealand.1252  LC_CTYPE=English_New Zealand.1252    LC_MONETARY=English_New Zealand.1252
[4] LC_NUMERIC=C                         LC_TIME=English_New Zealand.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_1.0.1   phyloseq_1.14.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.1         plyr_1.8.3          XVector_0.10.0      iterators_1.0.8     tools_3.2.2         zlibbioc_1.16.0    
 [7] digest_0.6.8        gtable_0.1.2        nlme_3.1-122        lattice_0.20-33     mgcv_1.8-7          Matrix_1.2-2       
[13] foreach_1.4.3       igraph_1.0.1        parallel_3.2.2      proto_0.3-10        stringr_1.0.0       cluster_2.0.3      
[19] Biostrings_2.38.0   S4Vectors_0.8.0     IRanges_2.4.0       stats4_3.2.2        ade4_1.7-2          multtest_2.26.0    
[25] grid_3.2.2          Biobase_2.30.0      data.table_1.9.6    survival_2.38-3     RJSONIO_1.3-0       reshape2_1.4.1     
[31] magrittr_1.5        scales_0.3.0        codetools_0.2-14    MASS_7.3-44         BiocGenerics_0.16.0 splines_3.2.2      
[37] permute_0.8-4       colorspace_1.2-6    ape_3.3             stringi_0.5-5       munsell_0.4.2       biom_0.3.12        
[43] chron_2.3-47        vegan_2.3-1        
> biomot = import_biom("D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom", parseFunction = parse_taxonomy_qiime)
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> biomot = import_biom(otutable_biom_file, parseFunction = parse_taxonomy_qiime)
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> print(otutable_biom_file)
[1] "D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom"
> library(RCurl)
Error in library(RCurl) : there is no package called ‘RCurl’
> library(RJSONIO)
> biomot = import_biom("D:/from_qiime/micro/results/otus_open_ref_R1/otu_table_mc2_w_tax_no_pynast_failures.biom", parseFunction = parse_taxonomy_qiime)
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> file.choose()
[1] "C:\\Users\\Moana\\Documents\\Uni\\2015\\ECOL491\\Hard drive\\from_qiime\\micro\\results\\otus_open_ref_R1\\otu_table_mc2_w_tax_no_pynast_failures.biom"
> biom_otu_tax <- file.choose()
> bmsd <- import_qiime_sample_data(map_file)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file 'D:/Qiime_filesBaltarsurveymapR.txt': No such file or directory
> vzdir <- "D:/Qiime_files/"
> map_file <- paste(vzdir, "BaltarsurveymapR.txt", sep = "")
> bmsd <- import_qiime_sample_data(map_file)
> class(bmsd)
[1] "sample_data"
attr(,"package")
[1] "phyloseq"
> dim(bmsd)
[1] 18 27
> hlep(dim)
Error: could not find function "hlep"
> help(dim)
> View(bmsd)
> View(bmsd)
> sample_data(bmsd)
Sample Data:        [18 samples by 27 sample variables]:
     SampleID BarcodeSequence   LinkerPrimerSequence   Depth Code Station Station_depth         Zone SiteReplicate
S1.1     S1.1    AACCGATGTACC CCGGACTACHVGGGTWTCTAAT Surface S1.1       1             1      Neritic          S1.1
S1.2     S1.2    TCGATTGGCCGT CCGGACTACHVGGGTWTCTAAT Surface S1.2       1             1      Neritic          S1.2
S2.1     S2.1    GCATTACTGGAC CCGGACTACHVGGGTWTCTAAT Surface S2.1       2             2  SubTropical          S2.1
S2.2     S2.2    TTGGGCCACATA CCGGACTACHVGGGTWTCTAAT Surface S2.2       2             2  SubTropical          S2.2
S3.1     S3.1    CACACAAAGTCA CCGGACTACHVGGGTWTCTAAT Surface S3.1       3             3  SubTropical          S3.1
S3.2     S3.2    GCCAAGGATAGG CCGGACTACHVGGGTWTCTAAT Surface S3.2       3             3  SubTropical          S3.2
S4.1     S4.1    CGCCACGTGTAT CCGGACTACHVGGGTWTCTAAT Surface S4.1       4             4        Front          S4.1
S4.2     S4.2    GCAACCGATTGT CCGGACTACHVGGGTWTCTAAT Surface S4.2       4             4        Front          S4.2
S5.1     S5.1    CATGTGCTTAGG CCGGACTACHVGGGTWTCTAAT Surface S5.1       5             5        Front          S5.1
S5.2     S5.2    GTTCCTCCATTA CCGGACTACHVGGGTWTCTAAT Surface S5.2       5             5        Front          S5.2
S6.1     S6.1    ACCTGTCCTTTC CCGGACTACHVGGGTWTCTAAT Surface S6.1       6             6 SubAntarctic          S6.1
S6.2     S6.2    GTTCACGCCCAA CCGGACTACHVGGGTWTCTAAT Surface S6.2       6             6 SubAntarctic          S6.2
S7.1     S7.1    CGATCGAACACT CCGGACTACHVGGGTWTCTAAT Surface S7.1       7             7 SubAntarctic          S7.1
S7.2     S7.2    CATGCCAACATG CCGGACTACHVGGGTWTCTAAT Surface S7.2       7             7 SubAntarctic          S7.2
S8.1     S8.1    GAGTACAGTCTA CCGGACTACHVGGGTWTCTAAT Surface S8.1       8             8 SubAntarctic          S8.1
S8.2     S8.2    CCTACATGAGAC CCGGACTACHVGGGTWTCTAAT Surface S8.2       8             8 SubAntarctic          S8.2
d8.1     d8.1    TCCGTGGTATAG CCGGACTACHVGGGTWTCTAAT    Deep d8.1       8            8d         Deep         SD8.1
d8.2     d8.2    TCTACGGCACGT CCGGACTACHVGGGTWTCTAAT    Deep d8.2       8            8d         Deep         SD8.2
     distance_km_from_Taiaroa_Head Temperature_C Salinity_psu Nitrate_umol_m_3 Phosphate_umol_m_3 Silicate_umol_m_3  N_P  Si_N
S1.1                         15.20          14.4       34.319              0.5               0.15               1.0  3.3 2.074
S1.2                         15.20          14.4       34.319              0.5               0.15               1.0  3.3 2.074
S2.1                         23.39          13.5       34.714              2.3               0.25               0.6  9.1 0.278
S2.2                         23.39          13.5       34.714              2.3               0.25               0.6  9.1 0.278
S3.1                         30.36          12.5       34.541              7.1               0.59               0.2 11.9 0.028
S3.2                         30.36          12.5       34.541              7.1               0.59               0.2 11.9 0.028
S4.1                         37.46          12.0       34.343              8.1               0.63               0.1 12.8 0.010
S4.2                         37.46          12.0       34.343              8.1               0.63               0.1 12.8 0.010
S5.1                         43.86          12.3       34.323              8.4               0.70               0.1 11.9 0.016
S5.2                         43.86          12.3       34.323              8.4               0.70               0.1 11.9 0.016
S6.1                         50.64          12.5       34.261              9.2               0.77               0.3 12.0 0.034
S6.2                         50.64          12.5       34.261              9.2               0.77               0.3 12.0 0.034
S7.1                         58.39          12.4       34.276              9.2               0.75               0.2 12.2 0.027
S7.2                         58.39          12.4       34.276              9.2               0.75               0.2 12.2 0.027
S8.1                         65.37          12.6       34.279             10.6               0.70               0.4 15.2 0.037
S8.2                         65.37          12.6       34.279             10.6               0.70               0.4 15.2 0.037
d8.1                         65.37            NA           NA             19.1               1.30               7.5 14.6 0.394
d8.2                         65.37            NA           NA             19.1               1.30               7.5 14.6 0.394
     Bacterial_abundance_cells__ml Bacteiral_production_ugC_l_d Community_respiration_ugC_l_d
S1.1                        855000                        15.20                        124.66
S1.2                        855000                        15.20                        124.66
S2.1                        864000                        11.20                         69.51
S2.2                        864000                        11.20                         69.51
S3.1                        828000                        12.96                         42.40
S3.2                        828000                        12.96                         42.40
S4.1                            NA                         4.92                         31.51
S4.2                            NA                         4.92                         31.51
S5.1                        936000                        11.01                         44.47
S5.2                        936000                        11.01                         44.47
S6.1                        828000                         2.49                         39.62
S6.2                        828000                         2.49                         39.62
S7.1                        774000                         8.36                         69.28
S7.2                        774000                         8.36                         69.28
S8.1                        918000                         8.84                         66.73
S8.2                        918000                         8.84                         66.73
d8.1                        189000                         0.41                            NA
d8.2                        189000                         0.41                            NA
     Bacterial_0.8_0.2_um_respiration_ugC_l_d morethan_0.8_um_respiration_ugC_l_d Contribution_of_bacterial_to_CR_percent
S1.1                                 8.341782                           116.32151                                    6.69
S1.2                                 8.341782                           116.32151                                    6.69
S2.1                                12.976105                            56.53874                                   18.67
S2.2                                12.976105                            56.53874                                   18.67
S3.1                                12.512673                            29.89138                                   29.51
S3.2                                12.512673                            29.89138                                   29.51
S4.1                                12.976105                            18.53729                                   41.18
S4.2                                12.976105                            18.53729                                   41.18
S5.1                                21.086171                            23.38746                                   47.41
S5.2                                21.086171                            23.38746                                   47.41
S6.1                                28.501088                            11.12238                                   71.93
S6.2                                28.501088                            11.12238                                   71.93
S7.1                                38.233166                            31.04997                                   55.18
S7.2                                38.233166                            31.04997                                   55.18
S8.1                                66.734254                             0.00000                                  100.00
S8.2                                66.734254                             0.00000                                  100.00
d8.1                                       NA                                  NA                                      NA
d8.2                                       NA                                  NA                                      NA
     Cell_specific_production_fmolC_cell_d Cell_sp_BR_fmolC_cell_d X_Bacterioplankton_Growth_Efficiency_percent Description
S1.1                             1.4810822                    0.81                                           65        S1.1
S1.2                             1.4810822                    0.81                                           65        S1.2
S2.1                             1.0803283                    1.25                                           46        S2.1
S2.2                             1.0803283                    1.25                                           46        S2.2
S3.1                             1.3045297                    1.26                                           51        S3.1
S3.2                             1.3045297                    1.26                                           51        S3.2
S4.1                                    NA                      NA                                           28        S4.1
S4.2                                    NA                      NA                                           28        S4.2
S5.1                             0.9801063                    1.88                                           34        S5.1
S5.2                             0.9801063                    1.88                                           34        S5.2
S6.1                             0.2508221                    2.87                                            8        S6.1
S6.2                             0.2508221                    2.87                                            8        S6.2
S7.1                             0.9000342                    4.12                                           18        S7.1
S7.2                             0.9000342                    4.12                                           18        S7.2
S8.1                             0.8024910                    6.06                                           12        S8.1
S8.2                             0.8024910                    6.06                                           12        S8.2
d8.1                             0.1823963                      NA                                           NA        d8.1
d8.2                             0.1823963                      NA                                           NA        d8.2
> head(bmsd)
Sample Data:        [6 samples by 27 sample variables]:
     SampleID BarcodeSequence   LinkerPrimerSequence   Depth Code Station Station_depth        Zone SiteReplicate
S1.1     S1.1    AACCGATGTACC CCGGACTACHVGGGTWTCTAAT Surface S1.1       1             1     Neritic          S1.1
S1.2     S1.2    TCGATTGGCCGT CCGGACTACHVGGGTWTCTAAT Surface S1.2       1             1     Neritic          S1.2
S2.1     S2.1    GCATTACTGGAC CCGGACTACHVGGGTWTCTAAT Surface S2.1       2             2 SubTropical          S2.1
S2.2     S2.2    TTGGGCCACATA CCGGACTACHVGGGTWTCTAAT Surface S2.2       2             2 SubTropical          S2.2
S3.1     S3.1    CACACAAAGTCA CCGGACTACHVGGGTWTCTAAT Surface S3.1       3             3 SubTropical          S3.1
S3.2     S3.2    GCCAAGGATAGG CCGGACTACHVGGGTWTCTAAT Surface S3.2       3             3 SubTropical          S3.2
     distance_km_from_Taiaroa_Head Temperature_C Salinity_psu Nitrate_umol_m_3 Phosphate_umol_m_3 Silicate_umol_m_3  N_P  Si_N
S1.1                         15.20          14.4       34.319              0.5               0.15               1.0  3.3 2.074
S1.2                         15.20          14.4       34.319              0.5               0.15               1.0  3.3 2.074
S2.1                         23.39          13.5       34.714              2.3               0.25               0.6  9.1 0.278
S2.2                         23.39          13.5       34.714              2.3               0.25               0.6  9.1 0.278
S3.1                         30.36          12.5       34.541              7.1               0.59               0.2 11.9 0.028
S3.2                         30.36          12.5       34.541              7.1               0.59               0.2 11.9 0.028
     Bacterial_abundance_cells__ml Bacteiral_production_ugC_l_d Community_respiration_ugC_l_d
S1.1                        855000                        15.20                        124.66
S1.2                        855000                        15.20                        124.66
S2.1                        864000                        11.20                         69.51
S2.2                        864000                        11.20                         69.51
S3.1                        828000                        12.96                         42.40
S3.2                        828000                        12.96                         42.40
     Bacterial_0.8_0.2_um_respiration_ugC_l_d morethan_0.8_um_respiration_ugC_l_d Contribution_of_bacterial_to_CR_percent
S1.1                                 8.341782                           116.32151                                    6.69
S1.2                                 8.341782                           116.32151                                    6.69
S2.1                                12.976105                            56.53874                                   18.67
S2.2                                12.976105                            56.53874                                   18.67
S3.1                                12.512673                            29.89138                                   29.51
S3.2                                12.512673                            29.89138                                   29.51
     Cell_specific_production_fmolC_cell_d Cell_sp_BR_fmolC_cell_d X_Bacterioplankton_Growth_Efficiency_percent Description
S1.1                              1.481082                    0.81                                           65        S1.1
S1.2                              1.481082                    0.81                                           65        S1.2
S2.1                              1.080328                    1.25                                           46        S2.1
S2.2                              1.080328                    1.25                                           46        S2.2
S3.1                              1.304530                    1.26                                           51        S3.1
S3.2                              1.304530                    1.26                                           51        S3.2
> bmsd
Sample Data:        [18 samples by 27 sample variables]:
     SampleID BarcodeSequence   LinkerPrimerSequence   Depth Code Station Station_depth         Zone SiteReplicate
S1.1     S1.1    AACCGATGTACC CCGGACTACHVGGGTWTCTAAT Surface S1.1       1             1      Neritic          S1.1
S1.2     S1.2    TCGATTGGCCGT CCGGACTACHVGGGTWTCTAAT Surface S1.2       1             1      Neritic          S1.2
S2.1     S2.1    GCATTACTGGAC CCGGACTACHVGGGTWTCTAAT Surface S2.1       2             2  SubTropical          S2.1
S2.2     S2.2    TTGGGCCACATA CCGGACTACHVGGGTWTCTAAT Surface S2.2       2             2  SubTropical          S2.2
S3.1     S3.1    CACACAAAGTCA CCGGACTACHVGGGTWTCTAAT Surface S3.1       3             3  SubTropical          S3.1
S3.2     S3.2    GCCAAGGATAGG CCGGACTACHVGGGTWTCTAAT Surface S3.2       3             3  SubTropical          S3.2
S4.1     S4.1    CGCCACGTGTAT CCGGACTACHVGGGTWTCTAAT Surface S4.1       4             4        Front          S4.1
S4.2     S4.2    GCAACCGATTGT CCGGACTACHVGGGTWTCTAAT Surface S4.2       4             4        Front          S4.2
S5.1     S5.1    CATGTGCTTAGG CCGGACTACHVGGGTWTCTAAT Surface S5.1       5             5        Front          S5.1
S5.2     S5.2    GTTCCTCCATTA CCGGACTACHVGGGTWTCTAAT Surface S5.2       5             5        Front          S5.2
S6.1     S6.1    ACCTGTCCTTTC CCGGACTACHVGGGTWTCTAAT Surface S6.1       6             6 SubAntarctic          S6.1
S6.2     S6.2    GTTCACGCCCAA CCGGACTACHVGGGTWTCTAAT Surface S6.2       6             6 SubAntarctic          S6.2
S7.1     S7.1    CGATCGAACACT CCGGACTACHVGGGTWTCTAAT Surface S7.1       7             7 SubAntarctic          S7.1
S7.2     S7.2    CATGCCAACATG CCGGACTACHVGGGTWTCTAAT Surface S7.2       7             7 SubAntarctic          S7.2
S8.1     S8.1    GAGTACAGTCTA CCGGACTACHVGGGTWTCTAAT Surface S8.1       8             8 SubAntarctic          S8.1
S8.2     S8.2    CCTACATGAGAC CCGGACTACHVGGGTWTCTAAT Surface S8.2       8             8 SubAntarctic          S8.2
d8.1     d8.1    TCCGTGGTATAG CCGGACTACHVGGGTWTCTAAT    Deep d8.1       8            8d         Deep         SD8.1
d8.2     d8.2    TCTACGGCACGT CCGGACTACHVGGGTWTCTAAT    Deep d8.2       8            8d         Deep         SD8.2
     distance_km_from_Taiaroa_Head Temperature_C Salinity_psu Nitrate_umol_m_3 Phosphate_umol_m_3 Silicate_umol_m_3  N_P  Si_N
S1.1                         15.20          14.4       34.319              0.5               0.15               1.0  3.3 2.074
S1.2                         15.20          14.4       34.319              0.5               0.15               1.0  3.3 2.074
S2.1                         23.39          13.5       34.714              2.3               0.25               0.6  9.1 0.278
S2.2                         23.39          13.5       34.714              2.3               0.25               0.6  9.1 0.278
S3.1                         30.36          12.5       34.541              7.1               0.59               0.2 11.9 0.028
S3.2                         30.36          12.5       34.541              7.1               0.59               0.2 11.9 0.028
S4.1                         37.46          12.0       34.343              8.1               0.63               0.1 12.8 0.010
S4.2                         37.46          12.0       34.343              8.1               0.63               0.1 12.8 0.010
S5.1                         43.86          12.3       34.323              8.4               0.70               0.1 11.9 0.016
S5.2                         43.86          12.3       34.323              8.4               0.70               0.1 11.9 0.016
S6.1                         50.64          12.5       34.261              9.2               0.77               0.3 12.0 0.034
S6.2                         50.64          12.5       34.261              9.2               0.77               0.3 12.0 0.034
S7.1                         58.39          12.4       34.276              9.2               0.75               0.2 12.2 0.027
S7.2                         58.39          12.4       34.276              9.2               0.75               0.2 12.2 0.027
S8.1                         65.37          12.6       34.279             10.6               0.70               0.4 15.2 0.037
S8.2                         65.37          12.6       34.279             10.6               0.70               0.4 15.2 0.037
d8.1                         65.37            NA           NA             19.1               1.30               7.5 14.6 0.394
d8.2                         65.37            NA           NA             19.1               1.30               7.5 14.6 0.394
     Bacterial_abundance_cells__ml Bacteiral_production_ugC_l_d Community_respiration_ugC_l_d
S1.1                        855000                        15.20                        124.66
S1.2                        855000                        15.20                        124.66
S2.1                        864000                        11.20                         69.51
S2.2                        864000                        11.20                         69.51
S3.1                        828000                        12.96                         42.40
S3.2                        828000                        12.96                         42.40
S4.1                            NA                         4.92                         31.51
S4.2                            NA                         4.92                         31.51
S5.1                        936000                        11.01                         44.47
S5.2                        936000                        11.01                         44.47
S6.1                        828000                         2.49                         39.62
S6.2                        828000                         2.49                         39.62
S7.1                        774000                         8.36                         69.28
S7.2                        774000                         8.36                         69.28
S8.1                        918000                         8.84                         66.73
S8.2                        918000                         8.84                         66.73
d8.1                        189000                         0.41                            NA
d8.2                        189000                         0.41                            NA
     Bacterial_0.8_0.2_um_respiration_ugC_l_d morethan_0.8_um_respiration_ugC_l_d Contribution_of_bacterial_to_CR_percent
S1.1                                 8.341782                           116.32151                                    6.69
S1.2                                 8.341782                           116.32151                                    6.69
S2.1                                12.976105                            56.53874                                   18.67
S2.2                                12.976105                            56.53874                                   18.67
S3.1                                12.512673                            29.89138                                   29.51
S3.2                                12.512673                            29.89138                                   29.51
S4.1                                12.976105                            18.53729                                   41.18
S4.2                                12.976105                            18.53729                                   41.18
S5.1                                21.086171                            23.38746                                   47.41
S5.2                                21.086171                            23.38746                                   47.41
S6.1                                28.501088                            11.12238                                   71.93
S6.2                                28.501088                            11.12238                                   71.93
S7.1                                38.233166                            31.04997                                   55.18
S7.2                                38.233166                            31.04997                                   55.18
S8.1                                66.734254                             0.00000                                  100.00
S8.2                                66.734254                             0.00000                                  100.00
d8.1                                       NA                                  NA                                      NA
d8.2                                       NA                                  NA                                      NA
     Cell_specific_production_fmolC_cell_d Cell_sp_BR_fmolC_cell_d X_Bacterioplankton_Growth_Efficiency_percent Description
S1.1                             1.4810822                    0.81                                           65        S1.1
S1.2                             1.4810822                    0.81                                           65        S1.2
S2.1                             1.0803283                    1.25                                           46        S2.1
S2.2                             1.0803283                    1.25                                           46        S2.2
S3.1                             1.3045297                    1.26                                           51        S3.1
S3.2                             1.3045297                    1.26                                           51        S3.2
S4.1                                    NA                      NA                                           28        S4.1
S4.2                                    NA                      NA                                           28        S4.2
S5.1                             0.9801063                    1.88                                           34        S5.1
S5.2                             0.9801063                    1.88                                           34        S5.2
S6.1                             0.2508221                    2.87                                            8        S6.1
S6.2                             0.2508221                    2.87                                            8        S6.2
S7.1                             0.9000342                    4.12                                           18        S7.1
S7.2                             0.9000342                    4.12                                           18        S7.2
S8.1                             0.8024910                    6.06                                           12        S8.1
S8.2                             0.8024910                    6.06                                           12        S8.2
d8.1                             0.1823963                      NA                                           NA        d8.1
d8.2                             0.1823963                      NA                                           NA        d8.2
> biom_otu_tax
[1] "D:\\from_qiime\\micro\\results\\otus_open_ref_R1\\otu_table_mc2_w_tax_no_pynast_failures.biom"
> Fede_phyloseq <- merge_phyloseq(biom_otu_tax, bmsd)
> Fede_phyloseq
Sample Data:        [18 samples by 27 sample variables]:
     SampleID BarcodeSequence   LinkerPrimerSequence   Depth Code Station Station_depth         Zone SiteReplicate
S1.1     S1.1    AACCGATGTACC CCGGACTACHVGGGTWTCTAAT Surface S1.1       1             1      Neritic          S1.1
S1.2     S1.2    TCGATTGGCCGT CCGGACTACHVGGGTWTCTAAT Surface S1.2       1             1      Neritic          S1.2
S2.1     S2.1    GCATTACTGGAC CCGGACTACHVGGGTWTCTAAT Surface S2.1       2             2  SubTropical          S2.1
S2.2     S2.2    TTGGGCCACATA CCGGACTACHVGGGTWTCTAAT Surface S2.2       2             2  SubTropical          S2.2
S3.1     S3.1    CACACAAAGTCA CCGGACTACHVGGGTWTCTAAT Surface S3.1       3             3  SubTropical          S3.1
S3.2     S3.2    GCCAAGGATAGG CCGGACTACHVGGGTWTCTAAT Surface S3.2       3             3  SubTropical          S3.2
S4.1     S4.1    CGCCACGTGTAT CCGGACTACHVGGGTWTCTAAT Surface S4.1       4             4        Front          S4.1
S4.2     S4.2    GCAACCGATTGT CCGGACTACHVGGGTWTCTAAT Surface S4.2       4             4        Front          S4.2
S5.1     S5.1    CATGTGCTTAGG CCGGACTACHVGGGTWTCTAAT Surface S5.1       5             5        Front          S5.1
S5.2     S5.2    GTTCCTCCATTA CCGGACTACHVGGGTWTCTAAT Surface S5.2       5             5        Front          S5.2
S6.1     S6.1    ACCTGTCCTTTC CCGGACTACHVGGGTWTCTAAT Surface S6.1       6             6 SubAntarctic          S6.1
S6.2     S6.2    GTTCACGCCCAA CCGGACTACHVGGGTWTCTAAT Surface S6.2       6             6 SubAntarctic          S6.2
S7.1     S7.1    CGATCGAACACT CCGGACTACHVGGGTWTCTAAT Surface S7.1       7             7 SubAntarctic          S7.1
S7.2     S7.2    CATGCCAACATG CCGGACTACHVGGGTWTCTAAT Surface S7.2       7             7 SubAntarctic          S7.2
S8.1     S8.1    GAGTACAGTCTA CCGGACTACHVGGGTWTCTAAT Surface S8.1       8             8 SubAntarctic          S8.1
S8.2     S8.2    CCTACATGAGAC CCGGACTACHVGGGTWTCTAAT Surface S8.2       8             8 SubAntarctic          S8.2
d8.1     d8.1    TCCGTGGTATAG CCGGACTACHVGGGTWTCTAAT    Deep d8.1       8            8d         Deep         SD8.1
d8.2     d8.2    TCTACGGCACGT CCGGACTACHVGGGTWTCTAAT    Deep d8.2       8            8d         Deep         SD8.2
     distance_km_from_Taiaroa_Head Temperature_C Salinity_psu Nitrate_umol_m_3 Phosphate_umol_m_3 Silicate_umol_m_3  N_P  Si_N
S1.1                         15.20          14.4       34.319              0.5               0.15               1.0  3.3 2.074
S1.2                         15.20          14.4       34.319              0.5               0.15               1.0  3.3 2.074
S2.1                         23.39          13.5       34.714              2.3               0.25               0.6  9.1 0.278
S2.2                         23.39          13.5       34.714              2.3               0.25               0.6  9.1 0.278
S3.1                         30.36          12.5       34.541              7.1               0.59               0.2 11.9 0.028
S3.2                         30.36          12.5       34.541              7.1               0.59               0.2 11.9 0.028
S4.1                         37.46          12.0       34.343              8.1               0.63               0.1 12.8 0.010
S4.2                         37.46          12.0       34.343              8.1               0.63               0.1 12.8 0.010
S5.1                         43.86          12.3       34.323              8.4               0.70               0.1 11.9 0.016
S5.2                         43.86          12.3       34.323              8.4               0.70               0.1 11.9 0.016
S6.1                         50.64          12.5       34.261              9.2               0.77               0.3 12.0 0.034
S6.2                         50.64          12.5       34.261              9.2               0.77               0.3 12.0 0.034
S7.1                         58.39          12.4       34.276              9.2               0.75               0.2 12.2 0.027
S7.2                         58.39          12.4       34.276              9.2               0.75               0.2 12.2 0.027
S8.1                         65.37          12.6       34.279             10.6               0.70               0.4 15.2 0.037
S8.2                         65.37          12.6       34.279             10.6               0.70               0.4 15.2 0.037
d8.1                         65.37            NA           NA             19.1               1.30               7.5 14.6 0.394
d8.2                         65.37            NA           NA             19.1               1.30               7.5 14.6 0.394
     Bacterial_abundance_cells__ml Bacteiral_production_ugC_l_d Community_respiration_ugC_l_d
S1.1                        855000                        15.20                        124.66
S1.2                        855000                        15.20                        124.66
S2.1                        864000                        11.20                         69.51
S2.2                        864000                        11.20                         69.51
S3.1                        828000                        12.96                         42.40
S3.2                        828000                        12.96                         42.40
S4.1                            NA                         4.92                         31.51
S4.2                            NA                         4.92                         31.51
S5.1                        936000                        11.01                         44.47
S5.2                        936000                        11.01                         44.47
S6.1                        828000                         2.49                         39.62
S6.2                        828000                         2.49                         39.62
S7.1                        774000                         8.36                         69.28
S7.2                        774000                         8.36                         69.28
S8.1                        918000                         8.84                         66.73
S8.2                        918000                         8.84                         66.73
d8.1                        189000                         0.41                            NA
d8.2                        189000                         0.41                            NA
     Bacterial_0.8_0.2_um_respiration_ugC_l_d morethan_0.8_um_respiration_ugC_l_d Contribution_of_bacterial_to_CR_percent
S1.1                                 8.341782                           116.32151                                    6.69
S1.2                                 8.341782                           116.32151                                    6.69
S2.1                                12.976105                            56.53874                                   18.67
S2.2                                12.976105                            56.53874                                   18.67
S3.1                                12.512673                            29.89138                                   29.51
S3.2                                12.512673                            29.89138                                   29.51
S4.1                                12.976105                            18.53729                                   41.18
S4.2                                12.976105                            18.53729                                   41.18
S5.1                                21.086171                            23.38746                                   47.41
S5.2                                21.086171                            23.38746                                   47.41
S6.1                                28.501088                            11.12238                                   71.93
S6.2                                28.501088                            11.12238                                   71.93
S7.1                                38.233166                            31.04997                                   55.18
S7.2                                38.233166                            31.04997                                   55.18
S8.1                                66.734254                             0.00000                                  100.00
S8.2                                66.734254                             0.00000                                  100.00
d8.1                                       NA                                  NA                                      NA
d8.2                                       NA                                  NA                                      NA
     Cell_specific_production_fmolC_cell_d Cell_sp_BR_fmolC_cell_d X_Bacterioplankton_Growth_Efficiency_percent Description
S1.1                             1.4810822                    0.81                                           65        S1.1
S1.2                             1.4810822                    0.81                                           65        S1.2
S2.1                             1.0803283                    1.25                                           46        S2.1
S2.2                             1.0803283                    1.25                                           46        S2.2
S3.1                             1.3045297                    1.26                                           51        S3.1
S3.2                             1.3045297                    1.26                                           51        S3.2
S4.1                                    NA                      NA                                           28        S4.1
S4.2                                    NA                      NA                                           28        S4.2
S5.1                             0.9801063                    1.88                                           34        S5.1
S5.2                             0.9801063                    1.88                                           34        S5.2
S6.1                             0.2508221                    2.87                                            8        S6.1
S6.2                             0.2508221                    2.87                                            8        S6.2
S7.1                             0.9000342                    4.12                                           18        S7.1
S7.2                             0.9000342                    4.12                                           18        S7.2
S8.1                             0.8024910                    6.06                                           12        S8.1
S8.2                             0.8024910                    6.06                                           12        S8.2
d8.1                             0.1823963                      NA                                           NA        d8.1
d8.2                             0.1823963                      NA                                           NA        d8.2
> plot_richness(Fede_phyloseq, x = "Zone", color = "km_from_Taiaroa_Head") + geom_boxplot()
Error in .nextMethod(.Object = .Object, ... = ...) : 
  argument "taxa_are_rows" is missing, with no default
In addition: Warning message:
In as.matrix.data.frame(from) :
  Setting class(x) to NULL;   result will no longer be an S4 object
> View(Fede_phyloseq)
> View(Fede_phyloseq)
> help("plot_richness")
> setwd("D:/from_qiime/micro/results/otus_open_ref_R1")
> file <-import_biom(biom_otu_tax)
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> map <-import_qiime_sampleData(final_otu_map)
Error in read.table(file = mapfilename, header = TRUE, sep = "\t", comment.char = "") : 
  object 'final_otu_map' not found
In addition: Warning message:
'import_qiime_sampleData' is deprecated.
Use 'import_qiime_sample_data' instead.
See help("Deprecated") and help("phyloseq-deprecated"). 
> map <-import_qiime_sampleData(map_file)
Warning message:
'import_qiime_sampleData' is deprecated.
Use 'import_qiime_sample_data' instead.
See help("Deprecated") and help("phyloseq-deprecated"). 
> map <-import_qiime_sample_data(map_file)
> treefile <- read.tree("rep_set.tre")
Error: could not find function "read.tree"
> help(read.tree)
> read.tree(file = "rep_set.tre")
Error: could not find function "read.tree"
> library(ape)
> read.tree(file = "rep_set.tre")

Phylogenetic tree with 5608 tips and 5606 internal nodes.

Tip labels:
	New.CleanUp.ReferenceOTU1149, New.CleanUp.ReferenceOTU5290, New.CleanUp.ReferenceOTU19359, New.CleanUp.ReferenceOTU9154, New.CleanUp.ReferenceOTU10636, New.CleanUp.ReferenceOTU8157, ...
Node labels:
	, 0.837, 0.983, 0.834, 0.790, 0.886, ...

Unrooted; includes branch lengths.
> treefile <- read.tree(file = "rep_set.tre")
> run1 <-merge_phyloseq(file,map,treefile)
Error in validObject(.Object) : invalid class “phyloseq” object: 
 An otu_table is required for most analysis / graphics in the phyloseq-package
> help (merge_phylose)
No documentation for ‘merge_phylose’ in specified packages and libraries:
you could try ‘??merge_phylose’
> help (merge_phyloseq)
> file <-biom_otu_tx
Error: object 'biom_otu_tx' not found
> file <-biom_otu_tax
> run1 <-merge_phyloseq(file,map,treefile)
Error in validObject(.Object) : invalid class “phyloseq” object: 
 An otu_table is required for most analysis / graphics in the phyloseq-package
> file <-import_biom("otu_table_mc2_w_tax_no_pynast_failures.biom")
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> file <-import_biom(file = "otu_table_mc2_w_tax_no_pynast_failures.biom")
Error in import_biom(file = "otu_table_mc2_w_tax_no_pynast_failures.biom") : 
  argument "BIOMfilename" is missing, with no default
> file <-import_biom(BIOMfilename = "otu_table_mc2_w_tax_no_pynast_failures.biom")
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> help (import_biom)
> file <-import_biom(BIOMfilename="otu_table_mc2_w_tax_no_pynast_failures.biom", treefilename="rep_set.tre")
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> setwd("D:/from_qiime/micro/results/otus_open_ref_R1/")
> file <-import_biom(BIOMfilename="otu_table_mc2_w_tax_no_pynast_failures.biom", treefilename="rep_set.tre")
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> setwd("D:\\from_qiime\\micro\\results\\otus_open_ref_R1\\")
> file <-import_biom(BIOMfilename="otu_table_mc2_w_tax_no_pynast_failures.biom", treefilename="rep_set.tre")
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> file <-import_biom(BIOMfilename="otu_table_mc2_w_tax_no_pynast_failures.biom", treefilename="rep_set.tre")
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> biom_file = system.file("extdata", "otu_table_mc2_w_tax_no_pynast_failures.biom", package = "biom")
> x = read_biom(biom_file)
Error: could not find function "read_biom"
> help(read_biom)
> file <-import_biom(BIOMfilename="otu_table_mc2_w_tax_no_pynast_failures.biom", treefilename="rep_set.tre")
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> help("install.packages")
> install.packages(biom)
Error in install.packages : object 'biom' not found
> install.packages(BIOM)
Error in install.packages : object 'BIOM' not found

Restarting R session...

Loading required package: phyloseq
> install.packages("biom")
Error in install.packages : Updating loaded packages

Restarting R session...

Loading required package: phyloseq
> install.packages("biom")
Error in install.packages : Updating loaded packages

Restarting R session...

Loading required package: phyloseq
> install.packages("biom")
Error in install.packages : Updating loaded packages
> install.packages("biom")
Installing package into ‘C:/Users/Moana/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/biom_0.3.12.zip'
Content type 'application/zip' length 158345 bytes (154 KB)
downloaded 154 KB

package ‘biom’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Moana\AppData\Local\Temp\RtmpYl8FoV\downloaded_packages
> biom_file = system.file("extdata", "otu_table_mc2_w_tax_no_pynast_failures.biom", package = "biom")
> x = read_biom(biom_file)
Error: could not find function "read_biom"
> library(biom)
> biom_file = system.file("extdata", "otu_table_mc2_w_tax_no_pynast_failures.biom", package = "biom")
> x = read_biom(biom_file)
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.2 (BiocInstaller 1.20.0), ?biocLite for help
> biocLite("biom")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.2 (BiocInstaller 1.20.0), R 3.2.2 (2015-08-14).
Installing package(s) ‘biom’
Warning: package ‘biom’ is in use and will not be installed
Old packages: 'class', 'foreign', 'MASS', 'nlme', 'nnet', 'spatial'
Update all/some/none? [a/s/n]: 
a
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/class_7.3-14.zip'
Content type 'application/zip' length 99925 bytes (97 KB)
downloaded 97 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/foreign_0.8-66.zip'
Content type 'application/zip' length 288676 bytes (281 KB)
downloaded 281 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/MASS_7.3-44.zip'
Content type 'application/zip' length 1088435 bytes (1.0 MB)
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/nlme_3.1-122.zip'
Content type 'application/zip' length 2140460 bytes (2.0 MB)
downloaded 2.0 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/nnet_7.3-11.zip'
Content type 'application/zip' length 121019 bytes (118 KB)
downloaded 118 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/spatial_7.3-11.zip'
Content type 'application/zip' length 151920 bytes (148 KB)
downloaded 148 KB

package ‘class’ successfully unpacked and MD5 sums checked
package ‘foreign’ successfully unpacked and MD5 sums checked
package ‘MASS’ successfully unpacked and MD5 sums checked
package ‘nlme’ successfully unpacked and MD5 sums checked
package ‘nnet’ successfully unpacked and MD5 sums checked
package ‘spatial’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Moana\AppData\Local\Temp\RtmpYl8FoV\downloaded_packages
> library(biom)
> biom_file = system.file("extdata", "otu_table_mc2_w_tax_no_pynast_failures.biom", package = "biom")
> x = read_biom(biom_file)
Error in fromJSON(content, handler, default.size, depth, allowComments,  : 
  invalid JSON input
ADD REPLYlink written 4.2 years ago by moanam0
Answer: Error in file(con, “r”) : cannot open the connection
1
gravatar for Dan Tenenbaum
4.2 years ago by
Dan Tenenbaum8.2k
United States
Dan Tenenbaum8.2k wrote:

setInternet2(TRUE) 

will only help if you are trying to access a resource on the internet, but you are trying to access a local file. (Is D: a local or networked drive, btw?)

Does the file exist?

run

file.exists("D:/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom")

If it says FALSE then the file does not exist. If it says TRUE, then try

file.info("D:/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom")

...to get information about the file that might explain why you can't open it (for example, maybe its size is 0 bytes).

If it still looks ok, you could also read the first few lines of the file in to see if they are what you expect:

head(readLines("D:/from_qiime/micro/results/otus_open_ref_R1otu_table_mc2_w_tax_no_pynast_failures.biom"))

You might also try the example for import_biom() to see that it works as expected:

library(phyloseq)
example(import_biom)

If that works without errors then it's likely the problem is with your file. Perhaps it is not the format that import_biom() expects.

Finally, please update your post to include the output of sessionInfo() after you load the phyloseq package, this will help us troubleshoot.

 

 

 

ADD COMMENTlink written 4.2 years ago by Dan Tenenbaum8.2k
Answer: Error in file(con, “r”) : cannot open the connection
1
gravatar for mcmurdie
4.2 years ago by
mcmurdie20
United States
mcmurdie20 wrote:

Please refer to the answers posted and linked-to on the phyloseq issue tracker, addressing this same question:

https://github.com/joey711/phyloseq/issues/540

 

Please also see the section on biom files on the new phyloseq-FAQ.

ADD COMMENTlink modified 3.7 years ago • written 4.2 years ago by mcmurdie20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 226 users visited in the last hour