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

Add differential expression #50

Merged
merged 4 commits into from
Dec 5, 2024
Merged

Add differential expression #50

merged 4 commits into from
Dec 5, 2024

Conversation

asizemore
Copy link
Member

@asizemore asizemore commented Oct 23, 2024

The goal is to get the current implementation of deseq up and running. Improvements should be a new issue/PR

To Dos:

  • Copy files
  • Change classes. AbsoluteAbundanceData -> CountData.
  • Decide what to do with AbundanceData class
  • Move default pvalue floor and such to veupathUtils
  • Add test data
  • Decide what to do with maaslin
  • Fix imports and such so that differentialExpression works
  • Get tests passing

Decided to leave microbiomeComputations totally alone. We can update its imports and such at a later date but for now they're left alone. The only update it would need is to import deseq from veupathutils (and it's classes and such). It should also use veupathUtils's default floors.

Copy link
Member

@bobular bobular left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Managed to poke around in RStudio 🎉

Can step through the test files adequately.

Tried to set debug(differentialExpression) and couldn't step through the actual "setMethod" function. Will try to figure this out.

Sending these comments now so they don't get lost!

# The comparator must be ordinal, binary, or categorical
groupAValues <- getGroupLabels(comparator, "groupA")
groupBValues <- getGroupLabels(comparator, "groupB")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check that groupAValues and groupBValues are mutually exclusive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact we already do! The check is in the class-Comparator.R file. So someone can't even create a Comparator object to give to our function if the groupAValues and groupBValues overlap.


result <- differentialExpression(testCollection, comparator=comparatorVariable, method='DESeq', verbose=F)
expect_equal(length(result@droppedColumns), 0)
dt <- result@data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a 288 row table with one column - SampleID.

Is this useful for anything? If it had a second column with groupA/B membership, maybe it would?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a 288 row table with one column - SampleID.

Yup!

Is this useful for anything? If it had a second column with groupA/B membership, maybe it would?

It's not being used right now, but it's supposed to help us tell the user which samples get thrown out in the computation because of bad data or whatever the reason. I like the idea of adding the groupA/groupB membership there. Not sure yet where it would be used, but when the need comes I'm glad to know we. have a natural place to add that information.

@bobular
Copy link
Member

bobular commented Nov 23, 2024

Managed to poke around in RStudio 🎉

Can step through the test files adequately.

Tried to set debug(differentialExpression) and couldn't step through the actual "setMethod" function. Will try to figure this out.

Sending these comments now so they don't get lost!

Yay I worked it out.

debug(differentialExpression, signature=c("CollectionWithMetadata", "Comparator"))
# thanks to https://stackoverflow.com/questions/1708074/debugging-generic-functions-in-r
# then step IN first and then step next-line once the main function is highlighted

@asizemore asizemore requested a review from bobular November 26, 2024 13:50
@asizemore asizemore merged commit d443d99 into main Dec 5, 2024
0 of 5 checks passed
@asizemore asizemore deleted the add-differential-expression branch December 5, 2024 21:51
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 this pull request may close these issues.

2 participants