[Bioc-devel] as.data.frame for GRanges when one meta column is a data frame

Jialin Ma m@rlin- @ending from gmx@cn
Wed Jul 4 22:38:39 CEST 2018


Dear all,

It seems that the devel branch of Bioconductor has made
changes/improvements on the behavior of as.data.frame. In the case that
input is a GRanges with a meta column of data frame, as.data.frame in
devel will flatten the nested data frame. I made an example below:

 library(GenomicRanges)
 gr <- GRanges("chr2", IRanges(1:6, width = 2))
 gr$df <- data.frame(x = runif(6))
 str(as.data.frame(gr))

which shows:

  'data.frame':	6 obs. of  6 variables:
  $ seqnames: Factor w/ 1 level "chr2": 1 1 1 1 1 1
  $ start   : int  1 2 3 4 5 6
  $ end     : int  2 3 4 5 6 7
  $ width   : int  2 2 2 2 2 2
  $ strand  : Factor w/ 3 levels "+","-","*": 3 3 3 3 3 3
  $ x       : num  0.55 0.058 0.966 0.75 0.764 ...

with session info:

  R version 3.5.0 (2018-04-23)
  Platform: x86_64-suse-linux-gnu (64-bit)
  Running under: openSUSE Tumbleweed

  attached base packages:
  [1] parallel  stats4    stats     graphics  grDevices
utils     datasets 
  [8] methods   base     
  
  other attached packages:
  [1] GenomicRanges_1.33.6 GenomeInfoDb_1.17.1  IRanges_2.15.14     
  [4] S4Vectors_0.19.17    BiocGenerics_0.27.1  magrittr_1.5        
  
  loaded via a namespace (and not attached):
  [1]
zlibbioc_1.27.0        compiler_3.5.0         XVector_0.21.3        
  [4] tools_3.5.0            GenomeInfoDbData_1.1.0 RCurl_1.95-
4.10       
  [7] yaml_2.1.19            bitops_1.0-6            
  

While in the old version, the same code have the following results:

  'data.frame':	6 obs. of  6 variables:
  $ seqnames: Factor w/ 1 level "chr2": 1 1 1 1 1 1
  $ start   : int  1 2 3 4 5 6
  $ end     : int  2 3 4 5 6 7
  $ width   : int  2 2 2 2 2 2
  $ strand  : Factor w/ 3 levels "+","-","*": 3 3 3 3 3 3
  $ df      :Classes ‘AsIs’ and 'data.frame':	6 obs. of  1
variable:
    ..$ x: num  0.935 0.577 0.245 0.687 0.194 ...

with session info:

  R version 3.5.0 (2018-04-23)
  Platform: x86_64-suse-linux-gnu (64-bit)
  Running under: openSUSE Tumbleweed
  
  attached base packages:
  [1] parallel  stats4    stats     graphics  grDevices
utils     datasets 
  [8] methods   base     
  
  other attached packages:
  [1] GenomicRanges_1.32.3 GenomeInfoDb_1.17.1  IRanges_2.14.10     
  [4] S4Vectors_0.18.3     BiocGenerics_0.27.1  magrittr_1.5        
  
  loaded via a namespace (and not attached):
  [1]
zlibbioc_1.27.0        compiler_3.5.0         BiocInstaller_1.30.0  
  [4]
XVector_0.21.3         tools_3.5.0            GenomeInfoDbData_1.1.0
  [7] RCurl_1.95-4.10        yaml_2.1.19            bitops_1.0-
6          
  

I personally feel that automatically flattening the nested data frame
may not be the right behavior. I am not sure about it but I would like
to suggest to keep data frame column as is when using as.data.frame
(also do not add "AsIs" class as it will cause error showing the
converted data frame).

Any thoughts?

Best regards,
Jialin



-------- Forwarded Message --------
From: "Shepherd, Lori" <Lori.Shepherd using RoswellPark.org>
To: marlin- using gmx.cn <marlin- using gmx.cn>
Subject: failing Bioconductor package TnT
Date: Tue, 3 Jul 2018 12:25:20 +0000

> Dear TnT maintainer,
> 
> I'd like to bring to your attention that the TnT package is failing
> to pass 'R CMD build' on all platforms in the devel version of
> Bioconductor (i.e. BioC 3.8):
> 
> http://bioconductor.org/checkResults/devel/bioc-LATEST/TnT
> 
> Would you mind taking a look at this? Don't hesitate to ask on the bi
> oc-devel using r-project.org mailing list if you have any question or need
> help.
> 
> 
> While devel is a place to experiment with new features, we expect
> packages to build and check cleanly in a reasonable time period and
> not stay broken for
> any extended period of time.   The package has been failing since
> 06/11/18
> 
> If no action is taken over the next few weeks we will begin the
> deprecation process for your package.  
> 
> 
> Thank you for your time and effort, and your continued contribution
> to Bioconductor.
> 
> Pleae be advised that Bioconductor has switched from svn to Git. Some
> helpful links can be found here: 
> https://bioconductor.org/developers/how-to/git/
> http://bioconductor.org/developers/how-to/git/bug-fix-in-release-and-
> devel/
> 
> 
> 
> Lori Shepherd
> Bioconductor Core Team
> Roswell Park Cancer Institute
> Department of Biostatistics & Bioinformatics
> Elm & Carlton Streets
> Buffalo, New York 14263
> 
> This email message may contain legally privileged and/or confidential
> information. If you are not the intended recipient(s), or the
> employee or agent responsible for the delivery of this message to the
> intended recipient(s), you are hereby notified that any disclosure,
> copying, distribution, or use of this email message is prohibited. If
> you have received this message in error, please notify the sender
> immediately by e-mail and delete this email message from your
> computer. Thank you.



More information about the Bioc-devel mailing list