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

Using DMRcate::DMR.plot() after finding DMRs with dmrff::dmrff() #5

Open
samuel-carleial opened this issue Nov 25, 2021 · 3 comments
Open

Comments

@samuel-carleial
Copy link

samuel-carleial commented Nov 25, 2021

Hi,
after running an EWAS and getting an eBayes(lmFit()) object, I ran the function dmrff and found some DMRs:

chr start end n B S estimate se z p.value p.adjust
339 chr21 43982165 43982560 3 -0.0076364 0.0014123 -0.0076364 0.0014123 -5.406970 1e-07 0.0248778
351 chr3 44465202 44465646 3 -0.0054155 0.0008902 -0.0054155 0.0008902 -6.083507 0e+00 0.0004563
355 chr4 84257182 84257282 2 -0.0094295 0.0010579 -0.0094295 0.0010579 -8.912986 0e+00 0.0000000
405 chr8 134306801 134307105 2 -0.0058260 0.0010349 -0.0058260 0.0010349 -5.629692 0e+00 0.0070066

These DMRs could be mapped to some sites:

region site chr pos UCSC_RefGene_Name estimate p.value dmr.start dmr.end dmr.z dmr.p.adjust
354807 1 354807 chr21 43982165 SLC37A1 -0.0028612 0.0115771 43982165 43982560 -5.406970 0.0248778
354808 1 354808 chr21 43982270 SLC37A1;SLC37A1 -0.0014308 0.0853719 43982165 43982560 -5.406970 0.0248778
354809 1 354809 chr21 43982560 SLC37A1 -0.0030894 0.0019277 43982165 43982560 -5.406970 0.0248778
68242 2 68242 chr3 44465202 -0.0018421 0.0288792 44465202 44465646 -6.083507 0.0004563
68243 2 68243 chr3 44465567 -0.0036571 0.0003185 44465202 44465646 -6.083507 0.0004563
68244 2 68244 chr3 44465646 -0.0017130 0.0497925 44465202 44465646 -6.083507 0.0004563
93196 3 93196 chr4 84257182 HPSE;HPSE;HPSE;HPSE -0.0034672 0.0000125 84257182 84257282 -8.912986 0.0000000
93197 3 93197 chr4 84257282 HPSE;HPSE;HPSE;HPSE -0.0034962 0.0011262 84257182 84257282 -8.912986 0.0000000
179771 4 179771 chr8 134306801 NDRG1;NDRG1 -0.0025517 0.0092720 134306801 134307105 -5.629692 0.0070066
179772 4 179772 chr8 134307105 NDRG1;NDRG1 -0.0018520 0.0364748 134306801 134307105 -5.629692 0.0070066

Now, I would like to simply plot these DMRs using the DMR.plot function, but I am having a hard time including the arguments of the function. I keep receiving the error message: Error in nwrap[!needsWrapping] <- nn[!needsWrapping] : NAs are not allowed in subscripted assignments. The genomic ranges was made manually and look like this:

GRanges object with 4 ranges and 3 metadata columns:
      seqnames              ranges strand |   no.cpgs min_smoothed_fdr overlapping.genes
         <Rle>           <IRanges>  <Rle> | <numeric>        <numeric>       <character>
  [1]    chr21   43982165-43982560      * |         3      2.48778e-02           SLC37A1
  [2]     chr3   44465202-44465646      * |         3      4.56346e-04                  
  [3]     chr4   84257182-84257282      * |         2      1.92799e-13              HPSE
  [4]     chr8 134306801-134307105      * |         2      7.00664e-03             NDRG1
  -------
  seqinfo: 4 sequences from an unspecified genome; no seqlengths

Beta matrix and phenotype trait are referring to the lmFit above. The function I am using is like this:

DMR.plot(ranges=g2, dmr=1, CpGs=beta_vals, what="Beta",
         arraytype = "EPIC", phen.col=pheno_BL$group, genome="hg19")

Any help is appreciated

@AgiaJorda
Copy link

Did you ever resolve this error? It is something I am now running into :)

@AgiaJorda
Copy link

Update I have found that clearing the workspace, history etc. quitting and restarting R seems to resolve the error temporarily. But the error does return at random.

@perishky
Copy link
Owner

Could you send me an example that I can try myself? I haven't been able to reproduce the error, but that's likely because I'm doing something different or have different data!

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

3 participants