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

error class2tree output #929

Open
jrigbr opened this issue Apr 8, 2024 · 1 comment
Open

error class2tree output #929

jrigbr opened this issue Apr 8, 2024 · 1 comment

Comments

@jrigbr
Copy link

jrigbr commented Apr 8, 2024

Hello, I am facing this error while running class2tree

> sp_worms_id
[1] 138474 138677 104108 494795 138710 125332 130722 144784 129686 231858 369350 124208 127031 133913 273021 123987 124963 132487 140389
[20] 141855

cl <- classification(sp_worms_id, db = 'worms')

head(cl, 3)
$138474

A tibble: 11 × 3

name rank id

1 Animalia Kingdom 2
2 Mollusca Phylum 51
3 Bivalvia Class 105
4 Autobranchia Subclass 1424948
5 Heteroconchia Infraclass 1424949
6 Euheterodonta Subterclass 382296
7 Imparidentia Superorder 869600
8 Cardiida Order 869602
9 Tellinoidea Superfamily 14636
10 Semelidae Family 1781
11 Abra Genus 138474

$138677

A tibble: 11 × 3

name rank id

1 Animalia Kingdom 2
2 Mollusca Phylum 51
3 Polyplacophora Class 55
4 Neoloricata Subclass 57
5 Chitonida Order 382003
6 Acanthochitonina Suborder 90
7 Cryptoplacoidea Superfamily 385402
8 Acanthochitonidae Family 91
9 Acanthochitoninae Subfamily 1353774
10 Acanthochitona Genus 137613
11 Acanthochitona fascicularis Species 138677

$104108

A tibble: 10 × 3

name rank id

1 Animalia Kingdom 2
2 Arthropoda Phylum 1065
3 Crustacea Subphylum 1066
4 Multicrustacea Superclass 845959
5 Copepoda Class 1080
6 Neocopepoda Infraclass 155876
7 Gymnoplea Superorder 155877
8 Calanoida Order 1100
9 Acartiidae Family 104074
10 Acartia Genus 104108

tr <- class2tree(cl)
Get all ranks and their taxIDs
Erreur dans $<-.data.frame(*tmp*, "rank_df", value = character(0)) :
le tableau de remplacement a 0 lignes, le tableau remplacé en a 11

Thank you if you can help me

@trvinh
Copy link
Contributor

trvinh commented Apr 9, 2024

Hello @jrigbr ,
class2tree() currently accepts a list of data frames as input, not a list of tibbles.
I have tried to convert your cl list to data frames and it worked.

> sp_worms_id <- c(138474,138677,104108,494795,138710,125332,130722,144784,129686,231858,369350,124208,127031,133913,273021,123987,124963,132487,140389,141855)
> cl <- classification(sp_worms_id, db = 'worms')
> cl <- lapply(cl, as.data.frame)
> tr <- class2tree(cl)
Get all ranks and their taxIDs
Align taxonomy hierarchies...
Taxonomy alignment done!
Calculate distance matrix
Add node labels
> tr$phylo

Phylogenetic tree with 20 tips and 11 internal nodes.

Tip labels:
  Abra, Acanthochitona fascicularis, Acartia, Acetabularia acetabulum, Aeolidiella alderi, Alcyonium coralloides, ...
Node labels:
  NA, Plantae, Animalia, Demospongiae, Teleostei, Echinodermata, ...

Unrooted; includes branch lengths.

I hope it will help you!
Best,
Vinh

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

2 participants