traitecoevo/fungaltraits

Input file format and R script?

Opened this issue · 5 comments

Hi,
I just came across this program and it feels it will be super helpful and I can use it to assign functions to my ITS dataset. I installed the package but I am wondering that how can I use my counts or taxonomy file to do the analysis? Is there any manual where I can find how the input file will look like and what are the options or codes to do the analysis and assign functions. Any help will be really appreciated.

Thanks,
Sandipan

Following.

you could use dplyr filter function to filter through the db with a vector of your taxa eg:

db %>%
filter(., genus %in% taxa$genus)

db...object with funfun db
taxa...object with you taxonomies

Thanks for the reply but sorry @matevzl533 that I couldn't understand it. Right now I have a count file (counts.tsv) and a taxonomy file (taxa.tsv). So how shall I proceed if I want to use FungalTraits with my data. Can I assign functions to each ASV ? Can you write the code in a bit detail. I am not an expert in R so its difficult for me to understand and I apologize for that.

Appreciate your help.

Sandipan

ok.

Funfun db
db is the object into which you have loaded the fungal traits file with:

db <- fungal _traits()

Genus is the column in db that contains the fungal genera. You can check it with:

db$Genus

Your taxonomy file
taxa is the object into which you load taxa.tsv file - I guess it has columns with different taxonomic levels (eg. family, genus, species)`. With taxa$genus you select the column in taxa object that contains fungal genera.

Filtering method
then you just run the code from above:

db %>%
 filter(., Genus %in% taxa$genus)

this will list the fungal traits db, but only rows that contain the same fungal genera as your taxa object.

Possible additional problem
If your taxonomic names are clean eg. Glomus, then it works as described above. If you have additional parts denominating taxonomic level like f__Glomeraceae, g__Glomus (GreenGenes format), then you have to remove the first part with something like:

taxa <- taxa %>%
 mutate(genus = str_split_fixed(genus, “__”, 2)[2]

str_split_fixed is a function from library stringr. filter and mutate functions are from dplyr library.

WOW @matevzl533 . That worked. Thank you so much. I appreciate your help.

Sandipan