/usr/lib/R/site-library/GenomicFeatures/unitTests/test_makeTxDbFromGFF.R is in r-bioc-genomicfeatures 1.30.0+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | gffFile <- system.file("extdata","GFF3_files","a.gff3",package="GenomicFeatures")
gtfFile <- system.file("extdata","GTF_files","Aedes_aegypti.partial.gtf",
package="GenomicFeatures")
flyFile <- system.file("extdata","GFF3_files","dmel-1000-r5.11.filtered.gff",
package="GenomicFeatures")
## bad bacterial GFFs require use of special argument to ignore most of data.
gffB <- system.file("extdata","GFF3_files","NC_011025.gff",package="GenomicFeatures")
## Test that outputs match what is expected. ## BOOM
test_makeTxDbFromGFF <- function(){
## wanted
gffDBFile <- system.file("extdata", "GFF3_files", "a.sqlite",
package="GenomicFeatures")
txdb_gff <- loadDb(gffDBFile)
## generated
txdb1 <- makeTxDbFromGFF(file=gffFile,
dataSource="partial GFF file for Tomatoes for testing",
organism="Solanum lycopersicum",
circ_seqs=character(0))
## test
checkTrue(GenomicFeatures:::compareTxDbs(txdb1, txdb_gff))
## wanted
gtfDBFile <- system.file("extdata", "GTF_files",
"Aedes_aegypti.partial.sqlite",
package="GenomicFeatures")
txdb_gtf <- loadDb(gtfDBFile)
## generated
chrominfo <- data.frame(chrom = c('supercont1.1','supercont1.2'),
length=c(5220442, 5300000),
is_circular=c(FALSE, FALSE))
txdb2 <- makeTxDbFromGFF(file=gtfFile,
chrominfo= chrominfo,
dataSource=paste("ftp://ftp.ensemblgenomes.org/pub/metazoa/",
"release-13/gtf/aedes_aegypti/",sep=""),
organism="Aedes aegypti")
## test
checkTrue(GenomicFeatures:::compareTxDbs(txdb2, txdb_gtf))
## wanted
flyDBFile <- system.file("extdata", "GFF3_files",
"dmel-1000-r5.11.filtered.sqlite",
package="GenomicFeatures")
txdb_fly <- loadDb(flyDBFile)
txdb3 <- makeTxDbFromGFF(file=flyFile,
dataSource="gff file from flybase",
organism="Drosophila melanogaster",
circ_seqs=character(0))
checkTrue(GenomicFeatures:::compareTxDbs(txdb3, txdb_fly))
## test for broken NCBI bacterial GFFs (that only seem to have
## reliable gene info and little else)
chrominfoBac <- data.frame(chrom = c('NC_011025.1'),
length=c(830000), ## placeholder = iow it big enough
is_circular=c(TRUE))
## mostly I want to see if if can run this:
txdb_bac <- makeTxDbFromGFF(file = gffB,
chrominfo = chrominfoBac,
dataSource = "NCBI",
organism = "Mycoplasma arthritidis")
## Tests
checkTrue(class(txdb_bac)=="TxDb")
checkTrue(length(transcripts(txdb_bac)) > 100)
}
|