Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Speed up rds creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jenzopr authored Oct 2, 2018
1 parent b67a62a commit 5f51977
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createSCE_kallisto.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ expression <- list(umi = umi_counts)
#
if (snakemake@config$container$annotate) {
ec_members %>%
lapply(function(m) {unique(tx2gene[m, "gene"])}) -> ec2gene
lapply(function(m) {unique(as.character(tx2gene[m, "gene"]))}) -> ec2gene

bm <- biomaRt::getBM(c(snakemake@config$container$biomart$filter, 'external_gene_name'),
filters = snakemake@config$container$biomart$filter,
Expand All @@ -51,7 +51,7 @@ if (snakemake@config$container$annotate) {
gene2symbol <- bm[, 'external_gene_name']
names(gene2symbol) <- bm[, snakemake@config$container$biomart$filter]

rowData_ <- data.frame(transcript_ids = sapply(ec_members, function(m) paste0(tx2gene[m, "transcript"], collapse = ",")),
rowData_ <- data.frame(transcript_ids = sapply(ec_members, function(m) paste0(as.character(tx2gene[m, "transcript"]), collapse = ",")),
gene_ids = sapply(ec2gene, function(m) paste0(m, collapse = ",")),
symbols = sapply(ec2gene, function(m) { paste0(unname(gene2symbol[m]), collapse = ",") }))
} else {
Expand Down

0 comments on commit 5f51977

Please sign in to comment.