...
|
...
|
@@ -311,20 +311,25 @@ NULL
|
311
|
311
|
call. = FALSE)
|
312
|
312
|
}
|
313
|
313
|
|
314
|
|
- # Subset and rename rows of the assay to correspond node_labs
|
|
314
|
+ # Subset rows of the assay to correspond node_labs (if there are any NAs
|
|
315
|
+ # in node labels)
|
315
|
316
|
if( !is.null(node.label) && any(is.na(node.label)) ){
|
316
|
|
- # Subset
|
317
|
|
- if( !any(is.na(node.label)) ){
|
318
|
|
- warning(
|
319
|
|
- "The tree named does not include all the ",
|
320
|
|
- "rows. 'x' is subsetted.", call. = FALSE)
|
321
|
|
- mat <- mat[ !is.na(node.label), ]
|
322
|
|
- node.label <- node.label[ !is.na(node.label) ]
|
323
|
|
- }
|
324
|
|
- # Rename
|
|
317
|
+ warning(
|
|
318
|
+ "The tree named does not include all the ",
|
|
319
|
+ "rows. 'x' is subsetted.", call. = FALSE)
|
|
320
|
+ mat <- mat[ !is.na(node.label), ]
|
|
321
|
+ node.label <- node.label[ !is.na(node.label) ]
|
|
322
|
+ }
|
|
323
|
+ # If there are node labels (any TreeSE should have because they are rowLinks
|
|
324
|
+ # by default), rename the features in matrix to match with labels found in
|
|
325
|
+ # tree.
|
|
326
|
+ if( !is.null(node.label) ){
|
325
|
327
|
rownames(mat) <- node.label
|
326
|
328
|
}
|
327
|
|
- # To calculate faith, the assay must have rownames
|
|
329
|
+
|
|
330
|
+ # To calculate faith, the assay must have rownames. TreeSE has always
|
|
331
|
+ # rownames at this point, but if the object is SE, it might be that it is
|
|
332
|
+ # missing rownames.
|
328
|
333
|
if( is.null(rownames(mat)) ){
|
329
|
334
|
stop("'x' must have rownames.", call. = FALSE)
|
330
|
335
|
}
|