geneUsage and Diversity function
Closed this issue · 4 comments
Hi, I would like to see the frequency of the gene usage. Is there an option of telling .quant to use the column "proportions".
Moreover, I am interested in the Shannon-Wiener Index for a cloneset (list) and the entropy function only allows choosing 1 column from 1 data.frame. Is there a way around that?
Thanks a lot!
Hi, sorry for the late reply!
For proportions you just need to pass "count" for .quant and supply the ".norm=T" argument.
Can you please elaborate a little bit on the second question? Do you mean entropy for proportions of clonotypes for all data frames? If so, than you need to do that via plain R, for example:
entropy_list = sapply(your_data_list, function (x) entropy(x$Proportion))
Hi ,I can't understand the meaning of "value" in the entropy function. Can you explain it exactly? In another way I don't know how to calculate Shannon entropy and what kind of data to input. How to calculate Shannon-Wiener Index ? Thanks a lot!
Hi,
Shannon entropy should be applied to distribution of any values to measure how much they are diverse, so to say. https://en.wikipedia.org/wiki/Entropy
So you need to apply the entropy function to vectors with distributions of any value, for example, gene usage. Shannon-Wiener Index is calculated in the similar manner, you just need to provide another base.
# Entropy
a = immunarch::entropy(c(1,2,3,4), )
# Shannon-Wiener Index
b = immunarch::entropy(c(1,2,3,4), exp(1))
Hi, I will close this issue for now, please feel free to re-open if any questions arise.