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

Find which sets are mutually exclusive #68

Open
llrs opened this issue Feb 6, 2024 · 0 comments
Open

Find which sets are mutually exclusive #68

llrs opened this issue Feb 6, 2024 · 0 comments

Comments

@llrs
Copy link
Member

llrs commented Feb 6, 2024

If we want to select elements that have some mutually exclusive variables/set what would be the best way to do so?

For instance:
These variables describe the positions of methylation. Some of them are exclusive (if one position is in a shelf it is not in an intron).

c("inter", "intergenic", "1to5kb", "intron", "shore", "exon", 
"exonintronboundary", "intronexonboundary", "shelf", "promoter", 
"3UTR", "island", "CDS", "enhancer", "5UTR")

If these are encoded in a matrix (like it would in BaseSet), how could one find those that are mutually exclusive?

structure(list(inter = c(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE), 
    intergenic = c(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE), 
    `1to5kb` = c(FALSE, TRUE, FALSE, FALSE, FALSE, FALSE), intron = c(FALSE, 
    TRUE, TRUE, TRUE, TRUE, TRUE), shore = c(FALSE, FALSE, FALSE, 
    FALSE, FALSE, FALSE), exon = c(FALSE, FALSE, FALSE, FALSE, 
    FALSE, FALSE), exonintronboundary = c(FALSE, FALSE, FALSE, 
    FALSE, FALSE, FALSE), intronexonboundary = c(FALSE, FALSE, 
    FALSE, FALSE, FALSE, FALSE), shelf = c(FALSE, FALSE, FALSE, 
    FALSE, FALSE, FALSE), promoter = c(FALSE, FALSE, FALSE, FALSE, 
    FALSE, FALSE), `3UTR` = c(FALSE, FALSE, FALSE, FALSE, FALSE, 
    FALSE), island = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
    ), CDS = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), enhancer = c(FALSE, 
    FALSE, FALSE, FALSE, FALSE, FALSE), `5UTR` = c(FALSE, FALSE, 
    FALSE, FALSE, FALSE, FALSE)), row.names = c(NA, 6L), class = "data.frame")

In this case the data doesn't show it up, but the shelf, promoter, island, shore and 1to5kb are mutually exclusive.
Similarly the intron, exon, exonintronboundary, intronexonboundary.

Probably a combination of combn with a function making use of any(A & B).

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

1 participant