Browse code

Removed redundant code in cpgDensity function

Divyagash authored on 07/03/2018 14:54:31
Showing 2 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: scmeth
2 2
 Type: Package
3 3
 Title: Functions to conduct quality control analysis in methylation data
4
-Version: 0.99.21
4
+Version: 0.99.22
5 5
 Author: Divy Kangeyan <[email protected]>
6 6
 Maintainer: Divy Kangeyan <[email protected]>
7 7
 Depends: R (>= 3.5.0)
... ...
@@ -19,18 +19,15 @@
19 19
 
20 20
 cpgDensity <- function(bs,organism,windowLength=1000){
21 21
 
22
-    cov <- bsseq::getCoverage(bs)
23
-    gr <- GenomicRanges::granges(bs)
24 22
     #GenomeInfoDb::seqlevelsStyle(gr) <- GenomeInfoDb::seqlevelsStyle(organism)[1]
25
-
26 23
     cov <- bsseq::getCoverage(bs)
27 24
     gr <- GenomicRanges::granges(bs)
28 25
     cpg <- Biostrings::DNAString("CG")
29 26
     cpg_gr <- Biostrings::vmatchPattern(cpg, Hsapiens)
30 27
     cpg_gr <- GenomeInfoDb::keepStandardChromosomes(cpg_gr, pruning.mode= "coarse")
31 28
 
32
-    r_cpg_gr<-GenomicRanges::resize(cpg_gr,width=1000,fix='center')
33
-    cpgd<-GenomicRanges::countOverlaps(gr,r_cpg_gr)
29
+    r_cpg_gr <- GenomicRanges::resize(cpg_gr,width=1000,fix='center')
30
+    cpgd <- GenomicRanges::countOverlaps(gr,r_cpg_gr)
34 31
 
35 32
     #cpgd <- Repitools::cpgDensityCalc(gr, organism, window = windowLength)
36 33