Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-12 Thread Bhagwat, Aditya
Thankyou Bernat! -Original Message- From: Bernat Gel Moreno Sent: Donnerstag, 12. September 2019 11:26 To: bioc-devel@r-project.org Subject: Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)? I have updated karyoploteR and it's now (from version 1.11.9

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-12 Thread Bhagwat, Aditya
bioc-devel@r-project.org Subject: Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)? Hi all, I'm the developer of karyoploteR. @Michael: I never though about using seqinfo as the source for the genome information. I'll add this as an option to define the genom

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-12 Thread Bernat Gel Moreno
;>>> >>>>chromranges <- as(bsegenome, "GRanges") >>>>kp <- karyoploteR::plotKaryotype(chromranges) >>>> karyoploteR::kpPlotRegions(kp, crispr_target_sites) >>>> >>>> Or do you see any al

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-12 Thread Bhagwat, Aditya
: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)? Or more accurately: as(seqinfo(bsgenome)[seqlevelsInUse(grl)], "GRanges") since not all seqlevels are necessarily "in use" (i.e. not necessarily represented in seqnames(grl)). H. On 9/11/1

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-12 Thread Bernat Gel Moreno
kp <- karyoploteR::plotKaryotype(chromranges) >>> karyoploteR::kpPlotRegions(kp, crispr_target_sites) >>> >>> Or do you see any alternative for this purpose too? >>> >>> Aditya >>> >>>

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-12 Thread Bernat Gel Moreno
reading material to deepen my understanding of the core >>> BioC software design philosophy? >>> I am trying to understand that better (which was the context for asking >>> recently why there are three Vector -> data.frame coercers in S4Vectors >>> <http

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Michael Lawrence via Bioc-devel
> #' require(magrittr) > >>> #' BSgenome.Mmusculus.UCSC.mm10::BSgenome.Mmusculus.UCSC.mm10 %>% > >>> #' as('GRanges') > >>> #' @importClassesFrom BSgenome BSgenome > >>> #' @export > >>> methods::setAs( &

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Pages, Herve
e does not >>> need a BSgenome -> GRanges coercer. >>> >>> The karyoploteR use case still requires it, though, to allow plotting of >>> only the chromosomal BSgenome portions: >>> >>> chromranges <- as(bsegenome, "GRanges")

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Pages, Herve
gt; just doing as(seqinfo(bsgenome), "GRanges"). >>> >>> On Wed, Sep 11, 2019 at 3:59 AM Bhagwat, Aditya >>> wrote: >>>> >>>> Hi Herve, >>>> >>>> Thank you for your responses. >>>>  From your response, it is clear that the vcountPDict use case does >

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Michael Lawrence via Bioc-devel
llow plotting of > > only the chromosomal BSgenome portions: > > > > chromranges <- as(bsegenome, "GRanges") > > kp <- karyoploteR::plotKaryotype(chromranges) > > karyoploteR::kpPlotRegions(kp, crispr_target_sites) > > > > Or do you see any alternative for this purpose too? >

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Bhagwat, Aditya
t: Wednesday, September 11, 2019 2:31 PM To: Bhagwat, Aditya Cc: Pages, Herve; bioc-devel@r-project.org Subject: Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)? I'm pretty surprised that the karyoploteR package does not accept a Seqinfo since it is plottin

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Michael Lawrence via Bioc-devel
Herve [hpa...@fredhutch.org] > Sent: Wednesday, September 11, 2019 12:24 PM > To: Bhagwat, Aditya; bioc-devel@r-project.org > Subject: Re: [Bioc-devel] Import BSgenome class without attaching > BiocGenerics (and others)? > > Hi Aditya, > > On 9/11/19 01:31, Bhagwat, Adit

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Bhagwat, Aditya
esday, September 11, 2019 12:24 PM To: Bhagwat, Aditya; bioc-devel@r-project.org Subject: Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)? Hi Aditya, On 9/11/19 01:31, Bhagwat, Aditya wrote: > Hi Herve, > > > > It feels that a coercion method

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Pages, Herve
Afqt84VtBcfhQ=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA=FGFwBT0tJu3lfRS_rafeatLzrPxK7PEM0aanQY4M6wY=nBHdQoTrd1Mfu4VTMgtkPyUQ0Ju2NLeX-0X1Ny3fSeg=>) > > Cheers, > > Aditya > > > > > ____ > From: Pages, Herve [hpa...@fredhutch

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-11 Thread Bhagwat, Aditya
y there are three Vector -> data.frame coercers in S4Vectors<https://support.bioconductor.org/p/124491>) Cheers, Aditya From: Pages, Herve [hpa...@fredhutch.org] Sent: Tuesday, September 10, 2019 6:45 PM To: Bhagwat, Aditya; bioc-devel@r-p

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-10 Thread Pages, Herve
Hi Aditya, It feels that a coercion method from BSgenome to GRanges should rather be defined in the BSgenome package itself. Patch/PR welcome on GitHub. More generally speaking, coercion methods should be defined in a place that is "as close as possible" to the "from" or "to" classes rather

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Bhagwat, Aditya
x <- as.vector(x) > > as.data.frame(x, row.names=row.names, optional=optional, ...) > > }) > > > > > > > > From: Kasper Daniel Hansen > Sent: Freitag, 6. September 2019 17:49 > To: Michael Lawrence &g

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Michael Lawrence via Bioc-devel
me(x, row.names=row.names, optional=optional, ...) > > }) > > > > > > > > From: Kasper Daniel Hansen > Sent: Freitag, 6. September 2019 17:49 > To: Michael Lawrence > Cc: Bhagwat, Aditya ; bioc-devel@r-project.org > Subject: Re: [Bioc-devel] Import

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Bhagwat, Aditya
LSE, ...) { x <- as.vector(x) as.data.frame(x, row.names=row.names, optional=optional, ...) }) From: Kasper Daniel Hansen Sent: Freitag, 6. September 2019 17:49 To: Michael Lawrence Cc: Bhagwat, Aditya ; bioc-devel@r-project.org Subject: R

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Kasper Daniel Hansen
because these dependencies are needed to provide for all > required S4 methods for the BSgenome class, am I right? > > > > Is there a way to define a methods::setAs without loading the class > definition? > > > > Aditya > > > > > > > > > > ________

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Michael Lawrence via Bioc-devel
ethods::setAs without loading the class > definition? > > Aditya > > > > > > From: Michael Lawrence [lawrence.mich...@gene.com] > Sent: Friday, September 06, 2019 1:09 PM > To: Bhagwat, Aditya > Cc: bioc-devel@r-proje

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Bhagwat, Aditya
2:47 PM To: Michael Lawrence Cc: bioc-devel@r-project.org Subject: RE: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)? Thank you Michael, Appreciate your time for helping me fill the gaps in my understanding of the S4 flow :-). It all started when I defined

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Bhagwat, Aditya
define a methods::setAs without loading the class definition? Aditya From: Michael Lawrence [lawrence.mich...@gene.com] Sent: Friday, September 06, 2019 1:09 PM To: Bhagwat, Aditya Cc: bioc-devel@r-project.org Subject: Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and o

Re: [Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Michael Lawrence via Bioc-devel
The way to keep a "clean namespace" is to selectively import symbols into your namespace, not to import _nothing_ into your namespace. Otherwise, your code will fill with namespace qualifications that distract from what is more important to communicate: the intent of the code. And no, there's no

[Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

2019-09-06 Thread Bhagwat, Aditya
Dear Bioc devel, Is it possible to import the BSgenome class without attaching BiocGenerics (to keep a clean namespace during the development of multicrispr). BSgenome <- methods::getClassDef('BSgenome', package = 'BSgenome') (Posted