-
Notifications
You must be signed in to change notification settings - Fork 28
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 with parse_tax_data and installation issues #334
Comments
Can you give me part of the input data so I can see how it is formatted?
If you are just trying to split taxonomy column in to 6 per-rank columns and don't need to use other library(tidyr)
separate(feature-table-with-taxonomyl6, taxonomy, c("Kingdom", "Class", "Order", "etc..."), sep = ';') |
I did the following: my_table <- read_csv("file.csv", col_names = TRUE) # readr function
GT <- separate(my_table, taxonomy, c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"), sep = ";")
head(GT) I got this error:
Any recommendations here! |
What does the table look like? |
It is feature table with taxonomy as txt file then I converted it into csv. Thank you! |
Yea, it would be helpful if you emailed the file to me or attached it here. |
You have a column at the end named taxonomy too. Since you have two columns with the same name library(readr)
library(tidyr)
my_table <- read_csv("~/Downloads/feature-table-with-taxonomyl6.csv", col_names = TRUE) # readr function
#> New names:
#> * taxonomy -> taxonomy...1
#> * taxonomy -> taxonomy...58
#> Rows: 308 Columns: 58
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (1): taxonomy...1
#> dbl (56): 1P-GH-R1, 1P-GH-R2, P1, P10, P11, P12b, P13, P14b, P15, P16, P17, ...
#> lgl (1): taxonomy...58
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
GT <- separate(my_table, "taxonomy...1", c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus"), sep = ";") # No species rank in data
GT # Dont need to use head for tibbles
#> # A tibble: 308 × 63
#> Kingdom Phylum Class Order Family Genus `1P-GH-R1` `1P-GH-R2` P1 P10
#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 d__Bacteria p__Pr… c__G… o__E… f__Er… g__P… 0 0 8276 6048
#> 2 d__Bacteria __ __ __ __ __ 0 0 0 2
#> 3 d__Bacteria p__Ch… c__D… o__S… f__S0… g__S… 0 0 0 53
#> 4 d__Bacteria p__Ba… c__B… o__S… f__Sp… g__S… 0 0 0 0
#> 5 d__Bacteria p__Fi… c__B… o__B… f__Ba… g__B… 0 0 0 1283
#> 6 d__Bacteria p__Ba… c__B… o__C… __ __ 0 0 0 0
#> 7 d__Bacteria p__Fi… c__S… o__S… f__Sy… g__C… 0 0 0 0
#> 8 d__Bacteria p__Ba… c__B… o__C… f__Cy… g__S… 0 0 26 11
#> 9 d__Bacteria p__Pr… c__G… __ __ __ 0 0 0 0
#> 10 d__Bacteria p__Ba… c__B… o__F… f__We… g__C… 0 0 34 32
#> # … with 298 more rows, and 53 more variables: P11 <dbl>, P12b <dbl>,
#> # P13 <dbl>, P14b <dbl>, P15 <dbl>, P16 <dbl>, P17 <dbl>, P19 <dbl>,
#> # P2 <dbl>, P20 <dbl>, P21 <dbl>, P22 <dbl>, P23 <dbl>, P24 <dbl>, P25 <dbl>,
#> # P26 <dbl>, P27 <dbl>, P28 <dbl>, P29 <dbl>, P31 <dbl>, P32 <dbl>,
#> # P33 <dbl>, P34b <dbl>, P35 <dbl>, P36b <dbl>, P37 <dbl>, P38 <dbl>,
#> # P39b <dbl>, P40b <dbl>, P41 <dbl>, P42 <dbl>, P43 <dbl>, P44 <dbl>,
#> # P45 <dbl>, P46 <dbl>, P47 <dbl>, P48 <dbl>, P49 <dbl>, P4b <dbl>, … Created on 2022-03-02 by the reprex package (v2.0.1) |
@zachary-foster |
No problem! Glad its working |
Dear Zachary, I hope you are well. I am trying to use metacoder but can't create the taxmap object. I tried using parse_phyloseq() as well as manual options, without success. When I run parse_tax_data, tax_data is empty, and there is no OTU data (the counts). Would it be possible to get some help? |
Hi @mlvermeire, sorry for the delay. Do you still need help? |
Dear Zachary, thank you for your answer. Unfortunately I couldn't solve the problem. Do you know what could cause it ? |
Can you attach a sample of your data that reproduces the problem? |
Transferred from ropensci/taxa#210 for @emankhalaf
I have a feature table with taxonomy collapsed to the genus level, where the first column is the taxonomy (ranks separated by ;), then the rest of columns represents samples_id showing the read count of each feature. I need to split the taxonomy column into 6 taxonomic ranks using parse_tax_data function.
I used this code:
then I got this error:
However, I already loaded taxa package but I have a problem when installed devtools.
Thanks!
Eman
The text was updated successfully, but these errors were encountered: