To practice we are going to be working with the RA data again to investigate associations with global, site-specific, and regional changes in methylation. I have created a workflow here.  Below are some follow-up questions to explore.

 

Questions

  1. How does adjusting for batch impact these results? You can try this multiple ways.
  2. How does adjusting for cell distribution impact the results? Was this expected?
  3. If you detect any regional changes, where are they occurring? Try  to plot the differentially methylated region.

 

 

1 Comment

  1. #plotting top DMR code
    ##############################################

    # creating temp annotation object to work with
    holdannot< -getAnnotation(RAdataGenome) # getting the CpG loci in the top DMR topdmrinfo<-holdannot[ which(holdannot$chr==lookingatbumps$chr[1] & holdannot$pos>=lookingatbumps$start[1] &
    holdannot$pos<=lookingatbumps$end[1] ),] topdmrinfo<-as.data.frame(topdmrinfo) # getting methylation values for CpGs in top DMR DMRbetas<-getBeta(RAdataGenome)[rownames(topdmrinfo),] DMRbetas<-as.data.frame(DMRbetas) # adding position information to this data frame DMRbetas$chr<-topdmrinfo$chr DMRbetas$pos<-topdmrinfo$pos DMRbetas$CpG<-rownames(DMRbetas) # changing wide data to long data DMRbetas<-melt(DMRbetas,id=c("CpG","chr","pos")) colnames(DMRbetas)[which(colnames(DMRbetas)=="variable")]<-"Basename" # getting sample information for plot DMRsampleinfo<-pData(RAdataGenome)[,c("Basename","diseasestate")] # merge methylation values and sample information DMRbetas<-merge(DMRbetas,DMRsampleinfo,by="Basename") DMRbetas<-as.data.frame(DMRbetas) # plot the methylation values across the DMR by disease state ggplot(DMRbetas,aes(pos,value,group=diseasestate,col=diseasestate))+ geom_jitter()+ stat_smooth(size=1,se=FALSE)+ theme_bw()+ xlab("Position")+ ylab("Methylation Level\n(beta-value)")+ theme(axis.title=element_text(face="bold"))+ scale_color_brewer(palette="Set2")

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*