phyloFlash icon indicating copy to clipboard operation
phyloFlash copied to clipboard

phyloFlash_heatmap.R breaks when only one taxon present

Open kbseah opened this issue 9 years ago • 0 comments

I'm filing this report for Malin... Heatmap script breaks when only one taxon present in 'Eukaryota'. hclust requires at least 2 objects to cluster. Verbose output copied below...

$ phyloFlash_heatmap.R -v -d -o test01.png --library-name-from-file ./*.csv
Loading required package: optparse
Loading libraries 
Selected phyloFlash libraries: 
./Day00_01_new ./Day00_02_new ./Day00_03_new ./Day02_01_new ./Day02_02_new 
./Day02_03_new ./Day05_01_new ./Day05_02_new ./Day05_03_new ./Day14_01_new 
./Day14_02_new ./Day14_03_new 

Loading CSV files... 
Reading:  ./Day00_01_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day00_01_new.phyloFlash.report.csv 
Reading:  ./Day00_02_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day00_02_new.phyloFlash.report.csv 
Reading:  ./Day00_03_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day00_03_new.phyloFlash.report.csv 
Reading:  ./Day02_01_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day02_01_new.phyloFlash.report.csv 
Reading:  ./Day02_02_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day02_02_new.phyloFlash.report.csv 
Reading:  ./Day02_03_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day02_03_new.phyloFlash.report.csv 
Reading:  ./Day05_01_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day05_01_new.phyloFlash.report.csv 
Reading:  ./Day05_02_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day05_02_new.phyloFlash.report.csv 
Reading:  ./Day05_03_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day05_03_new.phyloFlash.report.csv 
Reading:  ./Day14_01_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day14_01_new.phyloFlash.report.csv 
Reading:  ./Day14_02_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day14_02_new.phyloFlash.report.csv 
Reading:  ./Day14_03_new.phyloFlash.NTUabundance.csv 
Reading:  ./Day14_03_new.phyloFlash.report.csv 
Splitting data according to regex  Eukaryota 
A total of 8 taxa were observed. Merging taxa with < 50 observations into " Other ". 
Removed taxa with < 50 observations. 7 taxa left. 
A total of 1 taxa were observed. Merging taxa with < 50 observations into " Other ". 
No taxa to merge 
Rescaling counts to percentages 
Clustering... 
The "ward" method has been renamed to "ward.D"; note new "ward.D2"
The "ward" method has been renamed to "ward.D"; note new "ward.D2"
The "ward" method has been renamed to "ward.D"; note new "ward.D2"
Error in hclust(dist(mat), method) : must have n >= 2 objects to cluster
Calls: pF_main ... cluster -> lapply -> FUN -> as.dendrogram -> hclust
=============================================================================
 ####  DEBUG Information -- please include with bug reports #### 
=============================================================================
 Encountered error: 
--------------------
Error in hclust(dist(mat), method) : must have n >= 2 objects to cluster
Calls: pF_main ... cluster -> lapply -> FUN -> as.dendrogram -> hclust

 Session Info: 
---------------
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 7 (wheezy)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] gtable_0.1.2    ggdendro_0.1-17 reshape2_1.4.1  ggplot2_2.0.0  
[5] optparse_1.3.2 

loaded via a namespace (and not attached):
 [1] MASS_7.3-45      colorspace_1.2-6 scales_0.3.0     magrittr_1.5    
 [5] plyr_1.8.3       tools_3.2.3      Rcpp_0.12.3      getopt_1.20.0   
 [9] stringi_1.0-1    stringr_1.0.0    munsell_0.4.2   
-----------------------------------------------------------------------------
 Call trace: 
-------------
  1: pF_main()
  2: cluster(pf, method = conf$options$"hclust-method")
  3: lapply(pf$data, mkdendro)
  4: FUN(X[[i]], ...)
  5: as.dendrogram(hclust(dist(mat), method))
  6: hclust(dist(mat), method)
  7: stop("must have n >= 2 objects to cluster")
=============================================================================

kbseah avatar Feb 11 '16 15:02 kbseah