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

Interpreting earlyDE test when # of knots is not equal among lineages #264

Open
beazors opened this issue Aug 30, 2024 · 2 comments
Open

Comments

@beazors
Copy link

beazors commented Aug 30, 2024

Hello,

I'm having trouble understanding what exactly is being compared when you specify knots using earlyDE (depending on number and placement of knots).

For example, in the attached example, there are 3 lineages, each of different lengths:

Lineage 1: 3 knots
Lineage 2: 5 knots
Lineage 3: 6 knots

example

(1) Lineage 2 and 3 appear to share knot 2 (or have very close 2nd knots), while lineage 1 has a different knot 2. Therefore, is it incorrect to run earlyDETest(sce, knots = c(2,3)), since the starting points aren't the same?

(2) If I run earlyDETest(sce, knots = c(3,4)), am I essentially now only running a comparison between lineages 2 and 3, since they are the only lineages that have a 4th knot? Or is lineage 1 still being used in the comparison?

(3) Following that, if I wanted to look at the branch point between lineages 2 and 3, could I use earlyDETest(sce, knots = c(2,3)) but exclude lineage 1?

@Alexis-Varin
Copy link

Hi, not from dev team but from my own personal experience, tradeSeq compares the knots at the same pseudotime between all lineages. The values are stored in metadata(your_fitGAM_object)$tradeSeq$knots, you should see 6 values ranging from 0 to 100%. These are the pseudotime values used as reference for all lineages regardless of how long they are, when you do an earlyDETest 3 vs 4, tradeSeq will compare the fitGAM at pseudotime value 3 in that metadata slot (the same value for each lineage) vs pseudotime value 4 on all lineages. If one of the knot supplied to earlyDE exceeds the number of knots in your lineage (from example, wanting knot 6) and therefore the pseudotime value exceeds the highest pseudotime value for that particular lineage, tradeSeq seems to take the end knot of that lineage instead (so 3 or 5 for your lineages 1 and 2) and so the max(pseudotime.lineageX).

If you compare knot 3 vs 4 in pairwise, tradeSeq will compare lineage 1 knot 3 vs lineage 2 knot 3, and lineage 1 knot 3 vs lineage 2 knot 4, etc, basically it will always take the end point of a lineage if the asked knot exceeds the number of knots of that lineage.

@beazors
Copy link
Author

beazors commented Sep 23, 2024

@Alexis-Varin Thank you, this makes sense given the TradeSeq outputs I got--the behavior matches what you describe. I really appreciate your taking the time to reply, this helps a lot!

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

No branches or pull requests

2 participants