Created
          November 20, 2012 17:08 
        
      - 
      
- 
        Save aaronwolen/4119307 to your computer and use it in GitHub Desktop. 
    Example: loading data from a bigWig file
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library(IRanges) | |
| library(GenomicRanges) | |
| library(rtracklayer) | |
| # Select a BigWig file | |
| bw.dir <- "/home/chromatin/roadmap/DNase_hypersensitivity/brain_fetal" | |
| bw.file <- dir(bw.dir, full.names = TRUE, pattern = "*.bigWig")[1] | |
| # Specify a genomic range | |
| selection <- GRanges(seqnames = "chr4", | |
| ranges = IRanges(start = 46251581, end = 46392421)) | |
| # Extract BigWig data | |
| bw.data <- import.bw(con = BigWigFile(bw.file), | |
| selection = BigWigSelection(selection)) | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment