overlaps with character arguments as seqlevels?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- r
- Ambito
- bioinformatics
Direzione di ricerca
Inizia leggendo i metodi overlapsAny() esistenti e l'infrastruttura degli overlap di GRanges/GRangesList. Verifica come vengono distribuiti gli argomenti character e come vengono rappresentati i seqlevels. Il lavoro è completato quando overlapsAny(gr, "chr1") e overlapsAny(grl, "chr1") restituiscono gli stessi risultati logici della query GRanges costruita esplicitamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I was recently in the situation where I needed to write some code that would detect whether a GRanges or GRangesList contained elements on a particular chromosome. Well, no problem, I'll just look at the seqnames:
example(GenomicRanges, echo=FALSE)
as.logical(seqnames(gr) %in% "chr1")
## [1] FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE
So far so good. But then I realized that the same approach would not work properly for GRangesLists:
set.seed(10)
grl <- split(gr, sample(3, length(gr), replace=TRUE))
seqnames(grl) %in% "chr1"
## RleList of length 3
## $`1`
## logical-Rle of length 1 with 1 run
## Lengths: 1
## Values : FALSE
##
## $`2`
## logical-Rle of length 2 with 2 runs
## Lengths: 1 1
## Values : FALSE TRUE
##
## $`3`
## logical-Rle of length 7 with 3 runs
## Lengths: 2 1 4
## Values : FALSE TRUE FALSE
Which breaks the GRanges* abstraction that I was hoping to use. As such, I need to write GRanges and GRangesList-specific code to check whether the entries contain any intervals in my desired chromosome - not great.
However, it occurred to me that an elegant solution would be to repurpose overlapsAny(), which always returns a logical vector. To wit, the following gives me the desired result for both objects:
chr1 <- GRanges("chr1:1-1000")
overlapsAny(gr, chr1)
## [1] FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE
overlapsAny(grl, chr1)
## [1] FALSE TRUE TRUE
The above is not quite perfect as it still requires us to construct chr1, which requires knowledge of the range of entries on chromosome 1. A user-friendlier version of the above would allow us to just do:
overlapsAny(gr, "chr1")
overlapsAny(grl, "chr1")
To achieve the same effect. This would simply require new methods for GRanges(List),character, with the understanding that all character arguments are interpreted as seqlevels by the GenomicRanges overlap infrastructure.
- Lingua principale
- R
- Stelle
- 47
- Fork
- 22
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Bioconductor/GenomicRanges
-
MemoryAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
Bioconductor/GenomicRanges#95 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
Bioconductor/GenomicRanges#94 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Tutte le issue di Bioconductor/GenomicRanges
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
datacarpentry/semester-biology#1266 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
REditorSupport/vscode-R#1785 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
ImperialCollegeLondon/ve_data_science#666 · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 13 giorni