Closed plijnzaad closed 6 years ago
I quickly concocted a work around, maybe this is of use to anyone (too much in a hurry to do this a as a proper pull request, sorry :-)
.ensid <- function(gene){
gsub(perl=TRUE, "\\.\\d+$","",
unlist(lapply(strsplit(gene, "\\^"), function(p)p[2])))
}
addEnsemblIds <- function(file, fusions) {
## Specific to STAR-fusion output
## import misses the ens id's, add them here
## Usage: fusions <- addEnsemblIds(file,fusions)
table <- read.table(file=file,
sep="\t", as.is=TRUE, quote="", header=TRUE,
comment.char="", row.names=NULL)
if(nrow(table) != length(fusions))
stop("Number of fusions found in ", file,
" unequal to that in fusions argument")
if (is.null(table$LeftGene) || is.null(table$RightGene))
stop("Missing columns LeftGene and/or RightGene in ", file)
ensA <- .ensid(table$LeftGene)
ensB <- .ensid(table$RightGene)
sapply(1:length(fusions), function(i) {
f <- fusions[[i]]
f@geneA@ensemblId <- ensA[i]
f@geneB@ensemblId <- ensB[i]
f
})
} #addEnsemblIds
Thank you!:) I've pushed a fix for this which will be available in chimeraviz version 1.4.2 of the release version of Bioconductor, and chimeraviz version 1.5.4 of the devel version of Bioconductor.
Hi,
in the latest version of
importStarfusion
function does not fill in theensemblId
slot of the fusion partners. Would be nice to have. This is using output from STAR-fusion 1.2.0 (run CentOS 7, 3.10.0-693.11.6.el7.x86_64), analyzed on Mac OSX (Darwin PMC-GEN003 15.6.0 Darwin Kernel Version 15.6.0: Tue Jan 9 20:12:05 PST 2018; root:xnu-3248.73.5~1/RELEASE_X86_64 x86_64 i386 MacBookPro12).The
LeftGene
andRightGene
columns of thestar-fusion.fusion_predictions.abridged.tsv
file look likeMT-ATP6^ENSG00000198899.2