Skip to content

Commit

Permalink
UCSC changed some stuff
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/git/bioc-data.hedgehog.fhcrc.org/trunk/experiment/pkgs/geneLenDataBase@3913 db2202da-8704-0410-b924-b125b3cd84ef
  • Loading branch information
Anthony Hawkins committed Sep 29, 2016
1 parent 2e6c06e commit c19387f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions R/supportedGeneIDs.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
supportedGeneIDs=function(){
base=unfactor(GenomicFeatures:::supportedUCSCtables())
#Having the db entries as row names gets confusing, so fix that
base$db=rownames(base)
base=base[,c(ncol(base),1:(ncol(base)-1))]
rownames(base)=1:nrow(base)
#Old version of GenomicFeatures
#txname2gene_mapinfo=GenomicFeatures:::.UCSC_TXNAME2GENEID_MAPINFO

#Current version
txname2gene_mapinfo=GenomicFeatures:::.UCSC_TXNAME2GENEID_MAPDEFS
base$GeneID=""

#Old version
#tmp=unlist(sapply(txname2gene_mapinfo[base$db],function(u){u[4]}))
tmp=unlist(lapply(txname2gene_mapinfo[base$db],function(u){u[[2]]}))
base$GeneID[match(names(tmp),base$db)]=as.character(tmp)
#tmp=unlist(lapply(txname2gene_mapinfo[base$db],function(u){u[[2]]}))
#base$GeneID[match(names(tmp),base$db)]=as.character(tmp)

#NEW Ant 28/09/16
tmp=unlist(lapply(txname2gene_mapinfo[base$tablename],function(u){u[[2]]}))
base$GeneID = sapply(base$tablename,function(u){ifelse(u %in% names(tmp),tmp[u],"")})
base$GeneID[match(names(tmp),base$tablename)]=as.character(tmp)

#Add in gene symbol
base[nrow(base)+1,]=c("geneSymbol",'refGene','refFlat',"Gene Symbol","")
base[nrow(base)+1,]=c("geneSymbol",'refGene','refFlat',"Gene Symbol")
base$AvailableGenomes=""
repo=grep(".*\\..*\\.LENGTH",as.data.frame(data(package="geneLenDataBase")$results,stringsAsFactors=FALSE)$Item,ignore.case=TRUE,value=TRUE)
repo=matrix(unlist(strsplit(repo,"\\.")),ncol=3,byrow=TRUE)
Expand Down

0 comments on commit c19387f

Please sign in to comment.