phyloseq merge_samples attempt to set rownames on an object with no dimensions
Entering edit mode
newmanss • 0
Last seen 3.7 years ago
United States

Hi,  I cannot resolve the source of this error when I attempt to merge samples using phyloseq.  The command is:

> phymerge <- merge_samples(physeq, "expvar")
Error in `rownames<-`(`*tmp*`, value = c("PBRC_LR_BM4218", "PBRC_LR_BM4787",  : 
  attempt to set 'rownames' on an object with no dimensions


I downloaded the Global Patterns example and performed the command successfully with the example dataset.  Here is a snapshot of my data.

Thanks for taking a look,


> head(otu_table(physeq))
OTU Table:          [6 taxa and 4 samples]
                     taxa are rows
        PBRC_LR_BM4218 PBRC_LR_BM4787 PBRC_LR_BM8329 PBRC_LR_BM9418
OTU_43              61             10             10             18
OTU_65              11              5              6              3
OTU_110              6              0              0              1
OTU_85               0              0              0             13
OTU_15               5              1             11           1438
OTU_51              16              3              3             15
Taxonomy Table:     [6 taxa by 6 taxonomic ranks]:
        Domain     Phylum           Class                 Order             Family            
OTU_43  "Bacteria" "Actinobacteria" "Actinobacteria"      "Coriobacteridae" "Coriobacteriales"
OTU_65  "Bacteria" "Firmicutes"     "Bacilli"             "Lactobacillales" "Streptococcaceae"
OTU_110 "Bacteria" "Actinobacteria" "Actinobacteria"      "Coriobacteridae" "Coriobacteriales"
OTU_85  "Bacteria" "Proteobacteria" "Alphaproteobacteria" "Caulobacterales" "Caulobacteraceae"
OTU_15  "Bacteria" "Proteobacteria" "Gammaproteobacteria" "Pseudomonadales" "Moraxellaceae"   
OTU_51  "Bacteria" "Actinobacteria" "Actinobacteria"      "Coriobacteridae" "Coriobacteriales"
OTU_43  "Coriobacterineae"
OTU_65  "Streptococcus"   
OTU_110 "Coriobacterineae"
OTU_85  "Brevundimonas"   
OTU_15  "Acinetobacter"   
OTU_51  "Coriobacterineae"



Sample Data:        [4 samples by 1 sample variables]:


PBRC_LR_BM4218      A

PBRC_LR_BM4787      A

PBRC_LR_BM8329      B

PBRC_LR_BM9418      B


> str(x)
'data.frame':  4 obs. of  1 variable:
Formal class 'sample_data' [package "phyloseq"] with 4 slots
  ..@ .Data    :List of 1
  .. ..$ : Factor w/ 2 levels "A","B": 1 1 2 2
  ..@ names    : chr "expvar"
  ..@ row.names: chr  "PBRC_LR_BM4218" "PBRC_LR_BM4787" "PBRC_LR_BM8329" "PBRC_LR_BM9418"
  ..@ .S3Class : chr "data.frame"



R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    
attached base packages:
 [1] stats4    parallel  grid      stats     graphics  grDevices utils     datasets  methods  
[10] base     
other attached packages:
 [1] DESeq2_1.12.2              SummarizedExperiment_1.2.2 Biobase_2.32.0            
 [4] GenomicRanges_1.24.2       GenomeInfoDb_1.8.2         IRanges_2.6.0             
 [7] S4Vectors_0.10.1           BiocGenerics_0.18.0        shiny_0.13.2              
[10] vegan_2.4-0                lattice_0.20-33            permute_0.9-0             
[13] tidyr_0.5.1                doParallel_1.0.10          iterators_1.0.8           
[16] foreach_1.4.3              dplyr_0.5.0                plyr_1.8.4                
[19] scales_0.4.0               ggplot2_2.1.0              ape_3.5                   
[22] phyloseq_1.16.2           
loaded via a namespace (and not attached):
 [1] jsonlite_1.0         splines_3.3.1        Formula_1.2-1        assertthat_0.1      
 [5] latticeExtra_0.6-28  yaml_2.1.13          RSQLite_1.0.0        chron_2.3-47        
 [9] digest_0.6.9         RColorBrewer_1.1-2   XVector_0.12.0       colorspace_1.2-6    
[13] htmltools_0.3.5      httpuv_1.3.3         Matrix_1.2-6         XML_3.98-1.4        
[17] genefilter_1.54.2    zlibbioc_1.18.0      xtable_1.8-2         BiocParallel_1.6.2  
[21] tibble_1.1           annotate_1.50.0      mgcv_1.8-12          nnet_7.3-12         
[25] survival_2.39-4      magrittr_1.5         mime_0.5             nlme_3.1-128        
[29] MASS_7.3-45          foreign_0.8-66       tools_3.3.1          data.table_1.9.6    
[33] formatR_1.4          stringr_1.0.0        munsell_0.4.3        locfit_1.5-9.1      
[37] cluster_2.0.4        AnnotationDbi_1.34.3 Biostrings_2.40.1    ade4_1.7-4          
[41] rhdf5_2.16.0         biomformat_1.0.2     igraph_1.0.1         gtable_0.2.0        
[45] codetools_0.2-14     multtest_2.28.0      DBI_0.4-1            reshape2_1.4.1      
[49] R6_2.1.2             gridExtra_2.2.1      knitr_1.13           Hmisc_3.17-4        
[53] stringi_1.1.1        Rcpp_0.12.5          geneplotter_1.50.0   rpart_4.1-10        
[57] acepack_1.3-3.3     


phyloseq merge_samples rownames error • 1.3k views
Entering edit mode

Update:  I ran the command using a larger number of samples.  Problem solved.


Login before adding your answer.

Traffic: 496 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6