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

propagate counts considering part_of and other relationships #117

Closed
dgpinheiro opened this issue Dec 18, 2018 · 7 comments
Closed

propagate counts considering part_of and other relationships #117

dgpinheiro opened this issue Dec 18, 2018 · 7 comments

Comments

@dgpinheiro
Copy link

The same way as already mentioned by other colleagues, we are also interested in an implementation considering relationships, such as part_of, to propagate counts on them.

@dvklopfenstein
Copy link
Collaborator

I will take a look at this this week.

Thank you for taking your time to contact us regarding propagate counts using relationships.

@dvklopfenstein
Copy link
Collaborator

dvklopfenstein commented Jul 16, 2019

FYI: I just completed adding functionality for #126, which is a prerequisite for addressing your issue.

Withe #126 functionality implemented, I will now work on this issue.

Thank you very much for your interest in GOATOOLS, taking the time to write us, and for your patience. I look forward to implementing this issue.

@dvklopfenstein
Copy link
Collaborator

dvklopfenstein commented Jul 26, 2019

GOATOOLS now supports traversing optional relationships, like part_of and regulates, when propagating counts using these two new arguments in scripts/find_enrichment.py:

  -r, --relationship    Propagate counts up all relationships (default: False)
  --relationships [RELATIONSHIPS [RELATIONSHIPS ...]]
                        Propagate counts up user-specified relationships
                        (default: None)

You can specify all relationships using the -r argument. Or you can select specific relationships to use in propagate counts using the --relationships argument:

        # NO --relationships arg            -> None
        # --relationships part_of regulates -> relationships=['part_of', 'regulates']
        # --relationships=part_of           -> relationships=['part_of']
        # --relationships=part_of,regulates -> relationships=['part_of', 'regulates']
        # --relationships=part_of regulates -> NOT VALID

If you are running GOEAs from your own scripts, access this new functionality using the relationships keyword argument in an instance of GOEnrichmentStudy:

    goeaobj = GOEnrichmentStudy(
        geneids_population,
        assoc_geneid2gos,
        godag,
        propagate_counts=propagate_counts,
        relationships=VALUE,
        alpha=0.05,
        methods=['fdr_bh'])
    results = goeaobj.run_study(geneids_study, prt=prt)

Where VALUE is a set of relationships or a bool:

relationships=False  # Only required is_a relationships are traversed
relationships=True   # All optional relationships are used in propagate counts

# Traverse only the user-specified optional relationships:
relationships={'regulates', 'negatively_regulates', 'positively_regulates'}
relationships={'part_of'}

@dvklopfenstein
Copy link
Collaborator

@tanghaibao , Can you release a new version of GOATOOLS? All the tests are passing and this new version will include a substantial increase in functionality in using the optional GODAG relationships.

@tanghaibao
Copy link
Owner

@dvklopfenstein
Just upgraded to v0.9.7. let me know if there's an issue.

@Melnorme1984
Copy link

Maybe the update_association method here should be updated to use this new functionality: https://github.com/tanghaibao/goatools/blob/master/goatools/obo_parser.py

@dvklopfenstein
Copy link
Collaborator

dvklopfenstein commented Jul 29, 2019

@Melnorme1984 FYI: the update_association function in GODag will deprecated and has been replaced by the faster version in the GOEAs. The older version will be removed in a later release after deprecation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants