Answers.Body: <p>Have you checked out <a href="https://github.com/kwdunaway/WGBS_Tools" rel="nofollow noreferrer">WGBS Tools</a> on github? All of the custom scripts used in the paper that you referenced are in that repository. Each tool has a brief description of how to use it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-06T17:51:33.470Z
Answers.LastActivityDate: 2017-09-06T17:51:33.470Z
Answers.UserDisplayName: Kohl Kinning
Answers.Body: <p>Via <a href="http://bedops.readthedocs.io" rel="nofollow noreferrer">BEDOPS</a>:</p>
  
  <pre><code>$ bedmap —-echo —-echo-map-id-uniq &lt;(bam2bed &lt; reads.bam) &lt;(rmsk2bed &lt; repeats.rmsk) &gt; answer.bed
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-04T06:34:33.567Z
Answers.LastActivityDate: 2017-11-04T06:34:33.567Z
Answers.UserDisplayName: Alex Reynolds
Answers.Body: <p>After a more extensive search, I found a useful answer that I'll share in case anyone else wonders how to do this. I'm using <a href="https://github.com/al2na/methylKit" rel="nofollow noreferrer">MethylKit</a> package for differential methylation expression and it is quite easy to integrate with <a href="http://bioconductor.org/packages/release/bioc/html/GenomicRanges.html" rel="nofollow noreferrer">Genomic Ranges</a> and <a href="http://bioconductor.org/packages/release/bioc/html/rtracklayer.html" rel="nofollow noreferrer">rtracklayer</a> in R to extract particular element methylation differences:</p>
  
  <pre><code>element.of.interest &lt;- import.bed("FILENAME.bed") #download custom track from Genome Browser
  element.meth &lt;- diffmeth[as(diffmeth, "GRanges") %over% element.of.interest]
  </code></pre>
  
  <p>where "diffmeth" is the resulting MethylKit object from the differential methylation analysis.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-03T19:49:54.830Z
Answers.LastActivityDate: 2017-11-03T19:49:54.830Z
Answers.UserDisplayName: Kraken
Body: <p>I've been trying to figure out the correct way of extracting methylation status of particular elements from WGBS data, and found several possible approaches, but would like to discuss which one could be the best:</p>
  
  <ol>
  <li>using software dedicated to the extraction of these elements on WGS (like <a href="https://github.com/cancerit/TraFiC" rel="nofollow noreferrer">TraFiC</a> or <a href="http://melt.igs.umaryland.edu/" rel="nofollow noreferrer">MELT</a> and then quantify methylation (like <a href="https://www.bioinformatics.babraham.ac.uk/projects/bismark/" rel="nofollow noreferrer">Bismark</a>)</li>
  <li>using bedtools to scan bam file with a filtered version of <a href="https://genome.ucsc.edu/cgi-bin/hgTables" rel="nofollow noreferrer">UCSC RepeatMasker table</a> in bed format) and then quantify methylation</li>
  <li>I've seen the use of custom perl scripts on fastq files like in <a href="http://www.sciencedirect.com/science/article/pii/S221112471631631X#mmc1" rel="nofollow noreferrer">this paper</a>, in which the Supplemental Methods Section states: <em>"A custom Perl script was written to assay methylation of CpGs within a previously published motif of LINE-1 elements (Yang et al., 2004). Methylation levels for each of the four CpGs within the consensus LINE-1 element were determined globally for each WGBS sample prior to alignment using Line1_FASTQ.pl. Dup15q and control were compared and tested for significance using an unpaired t-test."</em> </li>
  </ol>
  
  <p>Any thoughts on this?</p>
  
Tags: <methylation><transposable-elements>
Title: Extract LINE-1 methylation status from WGBS data
ThreadText: # Extract LINE-1 methylation status from WGBS data
  
  (Asked by: username_0 on 2017-09-06)
  
  I've been trying to figure out the correct way of extracting methylation status of particular elements from WGBS data, and found several possible approaches, but would like to discuss which one could be the best:
  
  1. using software dedicated to the extraction of these elements on WGS (like [TraFiC](https://github.com/cancerit/TraFiC) or [MELT](http://melt.igs.umaryland.edu/) and then quantify methylation (like [Bismark](https://www.bioinformatics.babraham.ac.uk/projects/bismark/))
  2. using bedtools to scan bam file with a filtered version of [UCSC RepeatMasker table](https://genome.ucsc.edu/cgi-bin/hgTables) in bed format) and then quantify methylation
  3. I've seen the use of custom perl scripts on fastq files like in [this paper](http://www.sciencedirect.com/science/article/pii/S221112471631631X#mmc1), in which the Supplemental Methods Section states: *"A custom Perl script was written to assay methylation of CpGs within a previously published motif of LINE-1 elements (Yang et al., 2004). Methylation levels for each of the four CpGs within the consensus LINE-1 element were determined globally for each WGBS sample prior to alignment using Line1\_FASTQ.pl. Dup15q and control were compared and tested for significance using an unpaired t-test."*
  
  Any thoughts on this?
  
  **Tags:** methylation, transposable-elements
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2017-09-06. Score: 0 | Accepted answer
  
  Have you checked out [WGBS Tools](https://github.com/kwdunaway/WGBS_Tools) on github? All of the custom scripts used in the paper that you referenced are in that repository. Each tool has a brief description of how to use it.
  
  
  ---
  
  ### Answer by username_2 on 2017-11-04. Score: 1
  
  Via [BEDOPS](http://bedops.readthedocs.io):
  
  ```
  $ bedmap —-echo —-echo-map-id-uniq <(bam2bed < reads.bam) <(rmsk2bed < repeats.rmsk) > answer.bed
  
  ```
  
  
  ---
  
  ### Answer by username_0 on 2017-11-03. Score: 1
  
  After a more extensive search, I found a useful answer that I'll share in case anyone else wonders how to do this. I'm using [MethylKit](https://github.com/al2na/methylKit) package for differential methylation expression and it is quite easy to integrate with [Genomic Ranges](http://bioconductor.org/packages/release/bioc/html/GenomicRanges.html) and [rtracklayer](http://bioconductor.org/packages/release/bioc/html/rtracklayer.html) in R to extract particular element methylation differences:
  
  ```
  element.of.interest <- import.bed("FILENAME.bed") #download custom track from Genome Browser
  element.meth <- diffmeth[as(diffmeth, "GRanges") %over% element.of.interest]
  
  ```
  
  where "diffmeth" is the resulting MethylKit object from the differential methylation analysis.
  
  
  ---
  
  