==27339== Memcheck, a memory error detector ==27339== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==27339== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==27339== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R -f test-all.R --restore --save --no-readline --vanilla ==27339== R Under development (unstable) (2020-01-11 r77654) -- "Unsuffered Consequences" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > > ##============================================================================## > ## A Load prerequisites > ##============================================================================## > > require(refGenome) Loading required package: refGenome Loading required package: doBy Loading required package: RSQLite > > > ##============================================================================## > ## B Initialize example data > ##============================================================================## > > ensfile <- system.file("extdata", + "hs.ensembl.62.small.RData", + package = "refGenome", mustWork=TRUE) > > ##----------------------------------------------------------------------------## > ## B.1 Load Ensembl genome > ##----------------------------------------------------------------------------## > ens <- loadGenome(ensfile) > enex<-refExons(ens) [refExons.refGenome] Extracting tables. [refExons.refGenome] Adding 'CDS'. [refExons.refGenome] Adding 'start_codon'. [refExons.refGenome] Adding 'stop_codon'. [refExons.refGenome] Finished. > gp <- getGenePositions(ens) > junc<-getSpliceTable(ens) > > > > ##============================================================================## > ## C Run tests > ##============================================================================## > > ##----------------------------------------------------------------------------## > ## C.1 Test overlap juncs > ##----------------------------------------------------------------------------## > > ## ## > ## Requires: Initialized objects (as done by test-all.R header) > ## ## > > ## ## > ## C.1.1 Overlap juncs > ## ## > > ## 1 2 3 4 5 6 7 ## > qry<-data.frame(id = 1:7, seqid = "1", + lstart = c(10100L, 11800L, 12220L, 12220L, 12220L, 32000L, 40000L), + lend = c(10100L, 12000L, 12225L, 12227L, 12227L, 32100L, 40100L), + rstart = c(10200L, 12200L, 12057L, 12613L, 12650L, 32200L, 40200L), + rend = c(10300L, 12250L, 12179L, 12620L, 12700L, 32300L, 40300L)) > ## 1 2 3 4 5 6 7 ## > > ## ## > ## C.1.2 > ## ## > res<-overlapJuncs(qry,junc) [overlapJuncs] Input preparation. [overlapJuncs] Query size : 7 Ref size : 92 [overlapJuncs] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [overlapJuncs] i: 1 seqid: 1 query set: 7 ref set: 82 [overlapJuncs] Result assemly. [overlapJuncs] Finished. > res qid refid ldiff rdiff nref sod first_refid last_refid nadv nrev strand 1 1 0 NA NA 0 NA 0 0 0 0 * 2 2 41 -57 21 5 78 46 42 1 0 + 3 3 41 168 -122 4 290 46 42 0 4 + 4 4 46 0 0 9 0 46 63 0 4 + 5 5 46 0 37 9 37 46 63 0 8 + 6 6 0 NA NA 0 NA 0 0 71 0 * 7 7 0 NA NA 0 NA 0 0 0 0 * gene_id transcript_id gene_name 1 2 ENSG00000223972 ENST00000450305 DDX11L1 3 ENSG00000223972 ENST00000450305 DDX11L1 4 ENSG00000223972 ENST00000456328 DDX11L1 5 ENSG00000223972 ENST00000456328 DDX11L1 6 7 > > #if(! all(is.na(res$sod)==c(TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE)) ) > # stop("[test_overlap_juncs] Wrong res$sod NA's.") > > #if(sum(res$nref) != 27) > # stop("[test_overlap_juncs] Wrong sum of res$nref.") > > > ## ## > ## C.1.3 Test overhang codes (No requirements) > ## ## > rid <- 1L > rLstart <- 1000L > rLend <- 2000L > rRstart <- 3000L > rRend <- 4000L > rMaxEnd <- 4000L > # > qLstart <- as.integer(c(0700, 0800, 0900, 1000, 1000, 1000, 1000)) > qLend <- as.integer(c(0800, 0900, 2000, 2000, 2000, 2000, 5000)) > qRstart <- as.integer(c(0900, 3000, 3000, 3000, 3000, 5000, 6000)) > qRend <- as.integer(c(4000, 4000, 4000, 4000, 5000, 7000, 7000)) > qid <- as.integer(1:length(qLstart)) > dfr <- .Call(refGenome:::C_gap_overlap, qid, qLstart, qLend, qRstart, qRend, + rid, rLstart, rLend, rRstart, rRend, rMaxEnd) ==27339== Invalid read of size 4 ==27339== at 0x1FF63C48: gap_overlap (packages/tests-vg/refGenome/src/refGenome.cpp:1647) ==27339== by 0x49B9B5: R_doDotCall (svn/R-devel/src/main/dotcode.c:645) ==27339== by 0x49BFD4: do_dotcall (svn/R-devel/src/main/dotcode.c:1280) ==27339== by 0x4E87DA: Rf_eval (svn/R-devel/src/main/eval.c:791) ==27339== by 0x4ECD01: do_set (svn/R-devel/src/main/eval.c:2920) ==27339== by 0x4E85E4: Rf_eval (svn/R-devel/src/main/eval.c:763) ==27339== by 0x517C8C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==27339== by 0x517C8C: Rf_ReplIteration (svn/R-devel/src/main/main.c:200) ==27339== by 0x517FC7: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==27339== by 0x518054: run_Rmainloop (svn/R-devel/src/main/main.c:1113) ==27339== by 0x417717: main (svn/R-devel/src/main/Rmain.c:29) ==27339== Address 0x1f6fdad4 is 2,692 bytes inside a block of size 7,960 alloc'd ==27339== at 0x483880B: malloc (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:309) ==27339== by 0x5223E0: GetNewPage (svn/R-devel/src/main/memory.c:946) ==27339== by 0x5241A9: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2633) ==27339== by 0x4B7D13: Rf_allocVector (svn/R-devel/src/include/Rinlinedfuns.h:593) ==27339== by 0x4B7D13: do_missing (svn/R-devel/src/main/envir.c:2341) ==27339== by 0x4D166F: bcEval (svn/R-devel/src/main/eval.c:7074) ==27339== by 0x4E8197: Rf_eval (svn/R-devel/src/main/eval.c:688) ==27339== by 0x4E9D56: R_execClosure (svn/R-devel/src/main/eval.c:1853) ==27339== by 0x4EAB33: Rf_applyClosure (svn/R-devel/src/main/eval.c:1779) ==27339== by 0x4DB64D: bcEval (svn/R-devel/src/main/eval.c:7022) ==27339== by 0x4E8197: Rf_eval (svn/R-devel/src/main/eval.c:688) ==27339== by 0x4E9D56: R_execClosure (svn/R-devel/src/main/eval.c:1853) ==27339== by 0x4EAB33: Rf_applyClosure (svn/R-devel/src/main/eval.c:1779) ==27339== > > if(!all(dfr$ovhl==c("inp","int","ext",rep("no",4)))) + stop("[test_overlap_juncs] Wrong ovhl codes") > if(!all(dfr$ovhr==c(rep("no",4),"ext","int","inp"))) + stop("[test_overlap_juncs] Wrong ovhr codes") > > > > ##----------------------------------------------------------------------------## > ## C.2 Test read.gtf features > ##----------------------------------------------------------------------------## > > ##----------------------------------------------------------------------------## > ## hs.ensembl.76.small.gtf > ## contains the first 100 lines of file > ## ftp://ftp.ensembl.org/pub/release-76/gtf/ > ## homo_sapiens/Homo_sapiens.GRCh38.76.gtf.gz > ##----------------------------------------------------------------------------## > > ens76 <- system.file("extdata", + "hs.ensembl.76.small.gtf", package = "refGenome", mustWork=TRUE) > > en76 <- ensemblGenome() > basedir(en76) <- dirname(ens76) > read.gtf(en76, basename(ens76)) [read.gtf.refGenome] Reading file 'hs.ensembl.76.small.gtf'. [GTF] 100 lines processed. [read.gtf.refGenome] Extracting genes table. [read.gtf.refGenome] Found 14 gene records. [read.gtf.refGenome] Finished. > > if(!exists("genes", where=en76@ev, inherits=FALSE)) + stop("[test_read_gtf] 'genes' table does not exist") > > if(!all(getGeneTable(en76)$gene_name[1:2]==c("DDX11L1","WASH7P"))) + stop("[test_read_gtf] Wrong gene names in 'genes' table.") > > > ##----------------------------------------------------------------------------## > ## C.3 Test unify ranges > ##----------------------------------------------------------------------------## > > ##----------------------------------------------------------------------------## > ## Output consistency of unify Ranges: > ## Consecutive ranges must not ovelap. > ##----------------------------------------------------------------------------## > > urg <- unifyRanges(enex) > clevels <- levels(urg@ev$gtf$seqid) > n <- length(clevels) > > for(i in 1:n) + { + xtr <- urg@ev$gtf[urg@ev$gtf$seqid == clevels[i], ] + xb <- c(xtr$begin, 0) + xe <- c(0,xtr$end) + diff <- xb - xe + if(table(diff > 0)[1] > 1) + stop("[unifyRanges] inconsistent output!") + } > > ##----------------------------------------------------------------------------## > ## C.4 Test unify juncs > ##----------------------------------------------------------------------------## > > > ##----------------------------------------------------------------------------## > # Artificially added transcript_biotype data from ensembl version 80 > # For transcript_id's which are not found idn ensembl 80, > # the transcript_biotype is manually set to "nonsense_mediated_decay". > ##----------------------------------------------------------------------------## > # ensfile <- system.file("extdata", "hs.ensembl.62.small.RData", > # package = "refGenome", mustWork=TRUE) > # ens <- loadGenome(ensfile) > # jtn <- ens@ev$gtf$transcript_id > # mtc <- match(jtn, en80@ev$gtf$transcript_id) > # biot <- en80@ev$gtf$transcript_biotype[mtc] > # biot[is.na(biot)] <- "nonsense_mediated_decay" > # ens@ev$gtf$transcript_biotype <- biot > # saveGenome(ens, > # file="~/projects/R/refGenome/inst/extdata/hs.ensembl.62.small.RData", > # useBasedir=FALSE) > # > ##----------------------------------------------------------------------------## > > > uj <- unifyJuncs(junc) > > if(! all(uj@ev$gtf$cnNmd >= 0) ) + stop("[test_unify_juncs] All cnNmd must be >= 0") > > if(! all(uj@ev$gtf$cnNmd <= uj@ev$gtf$nSites) ) + stop("[test_unify_juncs] All cnNmd must be <= nSites") > > rm(uj) > > > ##============================================================================## > ## D Cleanup > ##============================================================================## > > > rm(ensfile, ens, gp, junc) > gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 1886544 100.8 3702960 197.8 2581608 137.9 Vcells 3236407 24.7 8388608 64.0 5415630 41.4 > > cat("[refGenome] rest-all.R tests finished.\n") [refGenome] rest-all.R tests finished. > > > ##============================================================================## > ## END OF FILE > ##============================================================================## > > proc.time() user system elapsed 132.336 0.662 132.332 ==27339== ==27339== HEAP SUMMARY: ==27339== in use at exit: 192,349,402 bytes in 40,858 blocks ==27339== total heap usage: 134,737 allocs, 93,879 frees, 384,792,737 bytes allocated ==27339== ==27339== LEAK SUMMARY: ==27339== definitely lost: 0 bytes in 0 blocks ==27339== indirectly lost: 0 bytes in 0 blocks ==27339== possibly lost: 0 bytes in 0 blocks ==27339== still reachable: 192,349,402 bytes in 40,858 blocks ==27339== suppressed: 0 bytes in 0 blocks ==27339== Reachable blocks (those to which a pointer was found) are not shown. ==27339== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==27339== ==27339== For lists of detected and suppressed errors, rerun with: -s ==27339== ERROR SUMMARY: 7 errors from 1 contexts (suppressed: 0 from 0)