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

geneUsage and Diversity function #2

Closed
dstatovci opened this issue Apr 5, 2019 · 4 comments
Closed

geneUsage and Diversity function #2

dstatovci opened this issue Apr 5, 2019 · 4 comments
Labels
type:Question Further information is requested

Comments

@dstatovci
Copy link

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!

@vadimnazarov vadimnazarov added the type:Question Further information is requested label Apr 16, 2019
@vadimnazarov
Copy link
Contributor

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))

@moyangpei
Copy link

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!

@vadimnazarov
Copy link
Contributor

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))

@vadimnazarov
Copy link
Contributor

Hi, I will close this issue for now, please feel free to re-open if any questions arise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants