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

Ordering samples before running branchPropTest() function #23

Open
ismailelshimy opened this issue Jan 23, 2024 · 0 comments · May be fixed by #25
Open

Ordering samples before running branchPropTest() function #23

ismailelshimy opened this issue Jan 23, 2024 · 0 comments · May be fixed by #25

Comments

@ismailelshimy
Copy link

ismailelshimy commented Jan 23, 2024

Dear @Winnie09 ,

I hope my message finds you fine. First, I would like to thank you very much for developing this extremely useful tool which addresses a very important aspect of single cell transcriptomics data sets i.e. the multi-sample multi-group study design. Your work and effort are greatly appreciated :)
Second, I would like to draw your attention to an issue with branchPropTest() function which tests the difference in the branch cell proportions between 2 groups (e.g. between males and females in the exemplary bone marrow dataset). I believe it is important to arrange the samples in the branch cell proportions matrix such that they have the same order as the order of samples in the design data frame specifically when running a t-test. This is illustrated in the following code:

design = data.frame(sample = paste0('BM', 1:8), sex = c(0, rep(1, 4), rep(0, 3))) # btw there is a typo in this line in the user manual; it is written paste0('BM', 1, 8), I corrected it here to 1:8

branchPropTest(data = data[,design[,1]], design = design)

For convenience, you could fix this in line 18 of the source code for the branchPropTest() function as follows:
res <- apply(data[,design[,1]], 1, function(i) t.test(i[id1], i[id2])$p.value)

In this way the user can apply the function directly without doing the reordering beforehand.

@ismailelshimy ismailelshimy linked a pull request Feb 2, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant