BIOMdisplay: Display BIOM data in full or part

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Nicely print or summarize an object of class biom. A summary omits printing the data table.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S3 method for class 'biom'
str(object, ...)

## S3 method for class 'biom'
summary(object, ...)

## S3 method for class 'biom'
print(x, ...)

## S3 method for class 'biom'
head(x, n=5, p=n, ...)

## S3 method for class 'biom'
tail(x, n=5, p=n, ...)

Arguments

x

an object (biom)

object

an object (biom)

n

number of rows (single integer)

p

number of columns (single integer)

...

further arguments to default method (str() only)

Details

BIOM (Biological Observation Matrix) is a simple prescription for storing an annotated table of data. It may be described as a format, standard, or data structure.

The JSON (JavaScript Object Notation) standard for expressing general data objects as text is employed to define BIOM. Therefore the native form of BIOM data is structured text, conforming to the JSON specification in general and the BIOM specification in particular. Familiarity with BIOM is assumed here.

The S3 class biom and its methods facilitate analyses by expressing BIOM data as objects in the R environment. The functions above apply to an R object that is already of class biom.

print() and summary() show the contents of the object, with the difference that the latter omits printing the BIOM data table. The former always prints it in expanded (non-sparse) form.

str() shows the raw R structure of its argument using the default str() with pleasing options.

head() and tail() return the data table's initial or final few rows and columns.

Value

A matrix for head() and tail(). See note below.

For the others, nothing useful.

Note

When the object is "sparse" its data table is stored as a three-column sparse representation matrix. (See reference for details, and note that indices begin at zero.) Such data is displayed by print() in an expanded (non-sparse) form, but head() and tail() return parts of the sparse representation unexpanded.

Author(s)

Daniel T. Braithwaite

References

BIOM format
JSON

See Also

biom, dim.biom as.matrix.biom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
##  one toy example, one real example:
xx <- biom (dmat, quiet=TRUE)
yy <- biom (li4)

summary (xx)
print (xx)
head (xx)
tail (xx)
tail (xx, n=10, p=3)

tail (yy)
tail (yy, n=15)

##  biom class is just a list:
str (yy)

Example output

BIOM.utils (0.9 dbcb27)
[id:] 
[generated_by:] BIOM.utils (0.9) on [date:] 2019-12-01 20:22:11
[type:] dense OTU table (20x5)
[format:] Biological Observation Matrix 1.0
    A   B   C   D   E
a 101 121 141 161 181
b 102 122 142 162 182
c 103 123 143 163 183
d 104 124 144 164 184
e 105 125 145 165 185
f 106 126 146 166 186
g 107 127 147 167 187
h 108 128 148 168 188
i 109 129 149 169 189
j 110 130 150 170 190
k 111 131 151 171 191
l 112 132 152 172 192
m 113 133 153 173 193
n 114 134 154 174 194
o 115 135 155 175 195
p 116 136 156 176 196
q 117 137 157 177 197
r 118 138 158 178 198
s 119 139 159 179 199
t 120 140 160 180 200

[id:] 
[generated_by:] BIOM.utils (0.9) on [date:] 2019-12-01 20:22:11
[type:] dense OTU table (20x5)
[format:] Biological Observation Matrix 1.0
    A   B   C   D   E
a 101 121 141 161 181
b 102 122 142 162 182
c 103 123 143 163 183
d 104 124 144 164 184
e 105 125 145 165 185
    A   B   C   D   E
p 116 136 156 176 196
q 117 137 157 177 197
r 118 138 158 178 198
s 119 139 159 179 199
t 120 140 160 180 200
    C   D   E
k 151 171 191
l 152 172 192
m 153 173 193
n 154 174 194
o 155 175 195
p 156 176 196
q 157 177 197
r 158 178 198
s 159 179 199
t 160 180 200
    row col value
770 264   2    33
771 265   0   311
772 265   1   543
773 265   2   115
774 265   3    44
    row col value
760 260   3   117
761 261   0   647
762 261   1  2017
763 261   2   382
764 261   3   166
765 262   0     6
766 262   1    20
767 263   1     6
768 264   0     5
769 264   1   174
770 264   2    33
771 265   0   311
772 265   1   543
773 265   2   115
774 265   3    44
 $ rows   :List of 266
  ..$ :List of 1
  .. ..$ taxonomy: chr [1:5] "Bacteria" ...
  ..$ :List of 1
  .. ..$ taxonomy: chr [1:5] "Bacteria" ...
  ..$ :List of 1
  .. ..$ taxonomy: chr [1:5] "Bacteria" ...
  .. [list output truncated]
 $ columns:List of 4
  ..$ :List of 4
  .. ..$ env_package:List of 4
  .. ..$ project    :List of 4
  .. ..$ library    :List of 4
  .. .. [list output truncated]
  ..$ :List of 4
  .. ..$ env_package:List of 4
  .. ..$ project    :List of 4
  .. ..$ library    :List of 4
  .. .. [list output truncated]
  ..$ :List of 4
  .. ..$ env_package:List of 4
  .. ..$ project    :List of 4
  .. ..$ library    :List of 4
  .. .. [list output truncated]
  .. [list output truncated]
 $ data        : int [1:774, 1:3] 0 0 ...
 $ sparse      :List of 2
  ..$ dimnames:List of 2
  .. ..$ rows   : chr [1:266] "Acetobacteraceae" ...
  .. ..$ columns: chr [1:4] "mgm4447102.3" ...
  ..$ dim     : int [1:2] 266 4
 $ type        : chr "Taxon table"
 $ format      : chr "Biological Observation Matrix 1.0"
 $ date        : chr "2014-08-27T21:52:33"
 $ id          : chr "mgm4447102.3_mgm44"| __truncated__
 $ generated_by: chr "MG-RAST revision 3.3.8.3"

BIOM.utils documentation built on May 1, 2019, 7:32 p.m.