Last active
March 26, 2020 15:03
-
-
Save hyphaltip/9d7e978a330b7b263a06d7e101fff3b3 to your computer and use it in GitHub Desktop.
Use Genomic Ranges with Rice data
This file contains 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
curl -O ftp://ftp.ensemblgenomes.org/pub/release-46/plants/gff3/oryza_sativa/Oryza_sativa.IRGSP-1.0.46.gff3.gz | |
curl -O ftp://ftp.ensemblgenomes.org/pub/release-46/plants/gtf/oryza_sativa/Oryza_sativa.IRGSP-1.0.46.chr.gtf.gz | |
curl -O ftp://ftp.ensemblgenomes.org/pub/release-46/plants/fasta/oryza_sativa/dna/Oryza_sativa.IRGSP-1.0.dna_sm.toplevel.fa.gz |
This file contains 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(GenomicFeatures) | |
if( file.exists("MSU_7.db")){ | |
txdb = loadDb("MSU_7.db") | |
} else { | |
txdb <- makeTxDbFromGFF("/bigdata/wesslerlab/shared/Rice/GFF/MSU_r7/MSU_r7.all.gff3", | |
dataSource="MSU7", | |
organism="Oryza sativa") | |
saveDb(txdb,"MSU_7.db") | |
} | |
ebg <- exonsBy(txdb, by="gene") | |
gene_lengths = sum(width(reduce(ebg))) | |
summary(gene_lengths) | |
if( file.exists("IRGSP-1.0.db")){ | |
txdb = loadDb("IRGSP-1.0.db") | |
} else { | |
# can read from .gzip compressed also | |
txdb <- makeTxDbFromGFF("/bigdata/wesslerlab/shared/Rice/GFF/IRGSP-1.0/Oryza_sativa.IRGSP-1.0.46.gff3.gz", | |
dataSource="Ensembl", | |
organism="Oryza sativa") | |
saveDb(txdb,"IRGSP-1.0.db") | |
} | |
ebg <- exonsBy(txdb, by="gene") | |
gene_lengths = sum(width(reduce(ebg))) | |
summary(gene_lengths) | |
if( file.exists("IRGSP-1.0_gtf.db")){ | |
txdb = loadDb("IRGSP-1.0_gtf.db") | |
} else { | |
txdb <- makeTxDbFromGFF("/bigdata/wesslerlab/shared/Rice/GFF/IRGSP-1.0/Oryza_sativa.IRGSP-1.0.46.chr.gtf", | |
dataSource="Ensembl", | |
organism="Oryza sativa") | |
saveDb(txdb,"IRGSP-1.0_gtf.db") | |
} | |
ebg <- exonsBy(txdb, by="gene") | |
gene_lengths = sum(width(reduce(ebg))) | |
summary(gene_lengths) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment