methylkit correlation unite min.per.group NA

687 views
Skip to first unread message

Linda Molla

unread,
Oct 21, 2017, 10:29:02 PM10/21/17
to methylkit_...@googlegroups.com
I am using the function below 

#for the CpG site to be considered it has to be covered in at least 3 out of 5 BR

meth = unite(myobj,min.per.group=3L)

and then

getCorrelation(meth, plot = FALSE)

The correlation table value I get has NA values. 
I am wondering why is this happening/ what am I doing wrong.

Linda

_______________

table:

       G_d1 G_2 G_3 G_4 G_5 A_1 A_d2 A_3 A_4 A_5
G_1      1     NA     NA     NA     NA     NA     NA     NA     NA     NA
G_2     NA      1     NA     NA     NA     NA     NA     NA     NA     NA
G_3     NA     NA      1     NA     NA     NA     NA     NA     NA     NA
G_4     NA     NA     NA      1     NA     NA     NA     NA     NA     NA
G_5     NA     NA     NA     NA      1     NA     NA     NA     NA     NA
A_1     NA     NA     NA     NA     NA      1     NA     NA     NA     NA
A_2     NA     NA     NA     NA     NA     NA      1     NA     NA     NA
A_3     NA     NA     NA     NA     NA     NA     NA      1     NA     NA
A_4     NA     NA     NA     NA     NA     NA     NA     NA      1     NA
A_5     NA     NA     NA     NA     NA     NA     NA     NA     NA      1

Altuna Akalin

unread,
Oct 25, 2017, 8:43:33 AM10/25/17
to methylkit_...@googlegroups.com
don't use min.per.group when you want to check correlation between samples, that should resolve it.  NA values in methyKit objects creates a problem for the correlation function, although this could be fixed, we never got around to it. 

Best,
Altuna

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_discussion@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

Linda Molla

unread,
Oct 31, 2017, 4:22:09 PM10/31/17
to methylkit_discussion
Related to the above error most likely 
I am trying to run regionCounts on the meth object above, which contains NA(s). And it throws an error at the calculateDiffMeth step. 

meth = unite(myobj,min.per.group=3L)
   methfeature=regionCounts(meth,genomicfeature,cov.bases = 3)
    myDifffeatrure = calculateDiffMeth(methfeature, num.cores = 4)

Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 
  0 (non-NA) cases
In addition: Warning messages:
1: glm.fit: fitted probabilities numerically 0 or 1 occurred 
2: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
To post to this group, send email to methylkit_...@googlegroups.com.

Altuna Akalin

unread,
Nov 1, 2017, 3:17:59 AM11/1/17
to methylkit_...@googlegroups.com
This could be sth else, please send a reproducible example 

To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discus...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discus...@googlegroups.com.

To post to this group, send email to methylkit_...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.
--
Sent from mobile, excuse the brevity

Linda Molla

unread,
Nov 1, 2017, 6:01:21 PM11/1/17
to methylkit_discussion
Ran this with the example of the vignette and a different error shows up

file.list=list( system.file("extdata", "test1.myCpG.txt", package = "methylKit"),
+                 system.file("extdata", "test2.myCpG.txt", package = "methylKit"),
+                 system.file("extdata", "control1.myCpG.txt", package = "methylKit"),
+                 system.file("extdata", "control2.myCpG.txt", package = "methylKit") )


myobj=methRead( file.list,          sample.id=list("test1","test2","ctrl1","ctrl2"),assembly="hg18",treatment=c(1,1,0,0))


filtered.myobj=filterByCoverage(myobj,lo.count=10,lo.perc=NULL,
                                      hi.count=NULL,hi.perc=99.9)


meth=unite(filtered.myobj, destrand=TRUE,min.per.group=1L)


myDiffFiltered = getMethylDiff(myDiff)

gene.obj=readTranscriptFeatures(system.file("extdata", "refseq.hg18.bed.txt", 
                                           package = "methylKit"))

promoters=regionCounts(meth,gene.obj$promoters,cov.bases = 3)

> myDiffpromoters = calculateDiffMeth(promoters, num.cores = 4)
Error in if (any(y < 0 | y > 1)) stop("y values must be 0 <= y <= 1") : 
  missing value where TRUE/FALSE needed

______

> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X Mavericks 10.9.5

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
 [1] grid      stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] TxDb.Mmusculus.UCSC.mm10.ensGene_3.2.2 GenomicFeatures_1.24.5                
 [3] AnnotationDbi_1.34.4                   Biobase_2.32.0                        
 [5] BiocInstaller_1.22.3                   bindrcpp_0.2                          
 [7] dplyr_0.7.4                            reshape2_1.4.2                        
 [9] ggplot2_2.2.1                          edmr_0.6.4.1                          
[11] devtools_1.13.3                        methylKit_0.99.2                      
[13] genomation_1.4.2                       GenomicRanges_1.24.3                  
[15] GenomeInfoDb_1.8.7                     IRanges_2.6.1                         
[17] S4Vectors_0.10.3                       BiocGenerics_0.18.0                   
[19] biomaRt_2.28.0                        

loaded via a namespace (and not attached):
 [1] mixtools_1.1.0             httr_1.3.1                 bit64_0.9-7                splines_3.3.3             
 [5] R.utils_2.5.0              gtools_3.5.0               assertthat_0.2.0           blob_1.1.0                
 [9] BSgenome_1.40.1            Rsamtools_1.24.0           impute_1.46.0              numDeriv_2016.8-1         
[13] RSQLite_2.0                lattice_0.20-35            glue_1.2.0                 limma_3.28.21             
[17] bbmle_1.0.20               digest_0.6.12              XVector_0.12.1             qvalue_2.4.2              
[21] colorspace_1.3-2           Matrix_1.2-11              R.oo_1.21.0                plyr_1.8.4                
[25] pkgconfig_2.0.1            XML_3.98-1.9               emdbook_1.3.9              zlibbioc_1.18.0           
[29] scales_0.5.0               BiocParallel_1.6.6         git2r_0.19.0               tibble_1.3.4              
[33] seqPattern_1.4.0           withr_2.0.0                SummarizedExperiment_1.2.3 lazyeval_0.2.1            
[37] survival_2.41-3            magrittr_1.5               mclust_5.3                 memoise_1.1.0             
[41] R.methodsS3_1.7.1          MASS_7.3-47                segmented_0.5-2.2          tools_3.3.3               
[45] data.table_1.10.4-3        hms_0.3                    matrixStats_0.52.2         gridBase_0.4-7            
[49] stringr_1.2.0              munsell_0.4.3              plotrix_3.6-6              Biostrings_2.40.2         
[53] fastseg_1.18.0             rlang_0.1.2                RCurl_1.95-4.8             labeling_0.3              
[57] bitops_1.0-6               gtable_0.2.0               DBI_0.7                    curl_3.0                  
[61] R6_2.2.2                   GenomicAlignments_1.8.4    knitr_1.17                 rtracklayer_1.32.2        
[65] bit_1.1-12                 bindr_0.1                  KernSmooth_2.23-15         readr_1.1.1               
[69] stringi_1.1.5              Rcpp_0.12.13               coda_0.19-1               
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.

To post to this group, send email to methylkit_...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

Altuna Akalin

unread,
Nov 2, 2017, 5:10:10 AM11/2/17
to methylkit_...@googlegroups.com
can you update your methylKit to the latest version and retry your example, this might have been fixed in the latest version:

library(devtools)
install_github("al2na/methylKit", build_vignettes=FALSE, 
  repos=BiocInstaller::biocinstallRepos(),
  dependencies=TRUE)

To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsubscrib...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsubscrib...@googlegroups.com.

To post to this group, send email to methylkit_...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.
--
Sent from mobile, excuse the brevity

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_discussion@googlegroups.com.

Linda Molla

unread,
Nov 9, 2017, 3:05:43 PM11/9/17
to methylkit_discussion
Sorry for the delay, 
With the new version this error does not show up anymore

methylKit_1.3.8
R version 3.4.2

thanks

> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS

Matrix products: default
BLAS: /usr/local/lib/R/lib/libRblas.so
LAPACK: /usr/local/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
 [1] grid      parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] bindrcpp_0.2         devtools_1.13.3      dplyr_0.7.4          reshape2_1.4.2       ggplot2_2.2.1        genomation_1.8.0     biomaRt_2.32.1      
 [8] edmr_0.6.4.1         methylKit_1.3.8      GenomicRanges_1.28.6 GenomeInfoDb_1.12.3  IRanges_2.10.5       S4Vectors_0.14.7     BiocGenerics_0.22.1 

loaded via a namespace (and not attached):
 [1] Biobase_2.36.2             mixtools_1.1.0             bit64_0.9-7                splines_3.4.2              R.utils_2.5.0             
 [6] gtools_3.5.0               assertthat_0.2.0           blob_1.1.0                 BSgenome_1.44.2            GenomeInfoDbData_0.99.0   
[11] Rsamtools_1.28.0           yaml_2.1.14                impute_1.50.1              numDeriv_2016.8-1          RSQLite_2.0               
[16] lattice_0.20-35            glue_1.2.0                 limma_3.32.10              bbmle_1.0.20               digest_0.6.12             
[21] XVector_0.16.0             qvalue_2.8.0               colorspace_1.3-2           Matrix_1.2-11              R.oo_1.21.0               
[26] plyr_1.8.4                 pkgconfig_2.0.1            XML_3.98-1.9               emdbook_1.3.9              zlibbioc_1.22.0           
[31] scales_0.5.0               BiocParallel_1.10.1        tibble_1.3.4               withr_2.1.0                seqPattern_1.8.0          
[36] SummarizedExperiment_1.6.5 lazyeval_0.2.1             survival_2.41-3            magrittr_1.5               mclust_5.3                
[41] memoise_1.1.0              R.methodsS3_1.7.1          MASS_7.3-47                segmented_0.5-2.2          tools_3.4.2               
[46] data.table_1.10.4-3        hms_0.3                    matrixStats_0.52.2         gridBase_0.4-7             stringr_1.2.0             
[51] munsell_0.4.3              plotrix_3.6-6              DelayedArray_0.2.7         AnnotationDbi_1.38.2       Biostrings_2.44.2         
[56] compiler_3.4.2             fastseg_1.22.0             rlang_0.1.2                RCurl_1.95-4.8             labeling_0.3              
[61] bitops_1.0-6               gtable_0.2.0               DBI_0.7                    R6_2.2.2                   GenomicAlignments_1.12.2  
[66] rtracklayer_1.36.6         bit_1.1-12                 bindr_0.1                  KernSmooth_2.23-15         readr_1.1.1               
[71] stringi_1.1.5              Rcpp_0.12.13               coda_0.19-1               
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.
--
Sent from mobile, excuse the brevity

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages