Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/R
- # Importing transcript abundance datasets with tximport
- library(tximportData)
- dir <- 'dwhelper/1/quants/quants'
- dir_quants <- '/home/prabat/dwhelper/1/quants'
- setwd(dir)
- samples <- read.csv('SraRunTable_1.csv', header = T)
- samples$condition <- factor(rep(c('A', 'B'), each = 9))
- rownames(samples) <- samples$Run_s
- files <- file.path(dir_quants, samples$Run_s, 'quant.sf')
- names(files) <- samples$Run_s
- names(files)
- files
- all(file.exists(files))
- library(biomaRt)
- library(GenomicFeatures)
- # mart <- useMart(biomart = 'plants_mart', host = 'plants.ensembl.org')
- # datasets <- listDatasets(mart)
- # datasets[1:6, 1:2]
- #
- # idx <- grep('oryza', datasets$description, ignore.case = T)
- # datasets[idx, 1:2]
- txdb <- makeTxDbFromBiomart(biomart="plants_mart",
- dataset="osativa_eg_gene",
- host="plants.ensembl.org")
- k <- keys(txdb, keytype = 'GENEID')
- df <- select(txdb, keys = k, keytype = 'GENEID', columns = 'TXNAME')
- tx2gene <- df[,2:1]
- head(tx2gene)
- write.csv(x = tx2gene, file = 'tx2gene.csv')
- save(txdb, file = 'txdb')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement