Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where is the s3 method groupOTU.phylo #34

Open
hs3434 opened this issue Dec 22, 2022 · 2 comments
Open

where is the s3 method groupOTU.phylo #34

hs3434 opened this issue Dec 22, 2022 · 2 comments

Comments

@hs3434
Copy link

hs3434 commented Dec 22, 2022

No description provided.

@hs3434 hs3434 changed the title where is the 盛 where is the s Dec 22, 2022
@hs3434 hs3434 changed the title where is the s where is the s3 method groupOTU.phylo Dec 22, 2022
@hs3434
Copy link
Author

hs3434 commented Dec 22, 2022

When I used the groupOTU , I found that the root node group was 0, so I looked at the code . I just found the groupOTU.tbl_tree and found that the method didn't group the root node. I'd like to see else such as groupOTU.phylo

@hs3434
Copy link
Author

hs3434 commented Dec 22, 2022

I tried to group the root node, but failed

### add group for tree by info
    info <- split(group$id, group$Taxon)
    tree <- groupOTU(tree, info)
    group_name <- 'group'
    .data <- as_tibble(tree)
    rn <- rootnode(.data)$node
    tmp1 <- .data[.data['parent'] == rn,]
    tmp1 <- tmp1[tmp1['node'] != rn,group_name][[1]][1]
    .data[[group_name]][rn] <- tmp1
    .data[[group_name]] <- factor(.data[[group_name]])
    tree <- as.phylo(.data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant