Skip to content

Commit aeea7bc

Browse files
Merge pull request #341 from jotech/master
Update parsers.R
2 parents d6bd2fa + 44eb0d7 commit aeea7bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/parsers.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ parse_phyloseq <- function(obj, class_regex = "(.*)",
6161
# Parse sample data
6262
if (! is.null(obj@sam_data)) {
6363
sam_data <- as.data.frame(as.list(obj@sam_data), stringsAsFactors = FALSE)
64-
if (! is.null(rownames(obj@sam_data))) {
64+
if (! is.null(rownames(obj@sam_data)) & !"sample_id" %in% colnames(obj@sam_data)) {
6565
sam_data <- cbind(sample_id = rownames(obj@sam_data), sam_data)
6666
}
6767
sam_data[] <- lapply(sam_data, as.character)

0 commit comments

Comments
 (0)