question about Gviz
2
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 6 months ago
Palo Alto, CA, USA
Dear all, I am using the following code below in order to retrieve the gene annotations in Gviz package : please could advise on what shall I modify in order to display the HUGO gene symbol on each gene ? thanks ! library("GenomicFeatures") hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = "knownGene") saveDb(hg18db, file="hg18db_knownGene.sqlite") txdb <-loadDb("hg18db_knownGene.sqlite") txTr <- GeneRegionTrack(txdb,genome="hg18",chromosome="chr9",showId=TRUE,geneS ymbol=TRUE,name="UCSC") plotTracks(txTr,from=start,to=end) -- bogdan ------------------ [[alternative HTML version deleted]]
Gviz Gviz • 2.4k views
ADD COMMENT
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 6 months ago
Palo Alto, CA, USA
Dear all, I am using the following code below in order to retrieve the gene annotations in Gviz package : please could advise on what shall I modify in order to display the HUGO gene symbol on each gene ? thanks ! library("GenomicFeatures") hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = "knownGene") saveDb(hg18db, file="hg18db_knownGene.sqlite") txdb <-loadDb("hg18db_knownGene.sqlite") txTr <- GeneRegionTrack(txdb,genome="hg18",chromosome="chr9",showId=TRUE,geneS ymbol=TRUE,name="UCSC") plotTracks(txTr,from=start,to=end) -- bogdan ------------------ [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
Well, the main culprit here is really the TranscriptDB package. It does not seem to deal at all with gene symbols, so there is no way for Gviz to automatically fetch those. If you come up with a way to match the UCSC gene identifiers back to gene symbols you could stick those into the GeneRegionTrack using the 'symbol' replacement method. E.g., symbol(foo) <- mappingTable[match(transcript(foo), mappingTable$UCSCId),]) I am not sure how this mapping is supposed to be done in the Bioconductor world these days. You may be able to find a way using one of the org.db packages. Or maybe you will have to download a mapping table directly from the UCSC table browser. With the next release of Bioconductor (or already now if you are working with the devel branch), Gviz supports building tracks from a whole range of standard annotation files. You could then export the whole known.gene table from UCSC as a GTF file and import in again as a GeneRegionTrack object. Alternatively you may want to look into the BiomartGeneRegionTrack class which will fetch the gene models from Ensembl, but this includes the HUGO gene symbols. Florian -- On 2/7/13 10:51 AM, "Bogdan Tanasa" <tanasa at="" gmail.com=""> wrote: >Dear all, > >I am using the following code below in order to retrieve the gene >annotations in Gviz package : >please could advise on what shall I modify in order to display the HUGO >gene symbol on each gene ? thanks ! > >library("GenomicFeatures") >hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = >"knownGene") >saveDb(hg18db, file="hg18db_knownGene.sqlite") >txdb <-loadDb("hg18db_knownGene.sqlite") >txTr <- >GeneRegionTrack(txdb,genome="hg18",chromosome="chr9",showId=TRUE,gene Symbo >l=TRUE,name="UCSC") >plotTracks(txTr,from=start,to=end) > >-- bogdan >------------------ > > [[alternative HTML version deleted]] > >_______________________________________________ >Bioconductor mailing list >Bioconductor at r-project.org >https://stat.ethz.ch/mailman/listinfo/bioconductor >Search the archives: >http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
Well, here's one approach. I'll start from the constructed 'txtr' track. ## see ?select for more on the following ## library(Homo.sapiens) symbolMappings <- select(Homo.sapiens, cols=c('UCSCKG','ENTREZID','SYMBOL'), keys=symbol(txtr), keytype='UCSCKG') ## "pork out" the mappings table so that duplicates expand ## symbolMappings <- symbolMappings[match(symbol(txtr), symbolMappings$UCSCKG),] ## if NAs can be accepted as keys, this next step might be unnecessary ## however, it seems that not all UCSC known genes have a Hugo symbol? ## txtr <- txtr[ hasHugoSymbol ] symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] plotTracks(txtr) That works. On Mon, Feb 11, 2013 at 6:03 AM, Hahne, Florian <florian.hahne@novartis.com>wrote: > Well, the main culprit here is really the TranscriptDB package. It does > not seem to deal at all with gene symbols, so there is no way for Gviz to > automatically fetch those. If you come up with a way to match the UCSC > gene identifiers back to gene symbols you could stick those into the > GeneRegionTrack using the 'symbol' replacement method. E.g., > symbol(foo) <- mappingTable[match(transcript(foo), mappingTable$UCSCId),]) > I am not sure how this mapping is supposed to be done in the Bioconductor > world these days. You may be able to find a way using one of the org.db > packages. Or maybe you will have to download a mapping table directly from > the UCSC table browser. > With the next release of Bioconductor (or already now if you are working > with the devel branch), Gviz supports building tracks from a whole range > of standard annotation files. You could then export the whole known.gene > table from UCSC as a GTF file and import in again as a GeneRegionTrack > object. Alternatively you may want to look into the BiomartGeneRegionTrack > class which will fetch the gene models from Ensembl, but this includes the > HUGO gene symbols. > Florian > > > -- > > > > > > > On 2/7/13 10:51 AM, "Bogdan Tanasa" <tanasa@gmail.com> wrote: > > >Dear all, > > > >I am using the following code below in order to retrieve the gene > >annotations in Gviz package : > >please could advise on what shall I modify in order to display the HUGO > >gene symbol on each gene ? thanks ! > > > >library("GenomicFeatures") > >hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = > >"knownGene") > >saveDb(hg18db, file="hg18db_knownGene.sqlite") > >txdb <-loadDb("hg18db_knownGene.sqlite") > >txTr <- > >GeneRegionTrack(txdb,genome="hg18",chromosome="chr9",showId=TRUE,ge neSymbo > >l=TRUE,name="UCSC") > >plotTracks(txTr,from=start,to=end) > > > >-- bogdan > >------------------ > > > > [[alternative HTML version deleted]] > > > >_______________________________________________ > >Bioconductor mailing list > >Bioconductor@r-project.org > >https://stat.ethz.ch/mailman/listinfo/bioconductor > >Search the archives: > >http://news.gmane.org/gmane.science.biology.informatics.conductor > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > -- *A model is a lie that helps you see the truth.* * * Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Oops, critical step omitted. See below. ## see ?select for more on the following ## library(Homo.sapiens) symbolMappings <- select(Homo.sapiens, cols=c('UCSCKG','ENTREZID','SYMBOL'), keys=symbol(txtr), keytype='UCSCKG') ## "pork out" the mappings table so that duplicates expand ## symbolMappings <- symbolMappings[match(symbol(txtr), symbolMappings$UCSCKG),] ## if NAs could be accepted as keys, this next step might be unnecessary ## hasHugoSymbol <- !is.na(symbolMappings$SYMBOL) ## however, it seems that not all UCSC known genes have a Hugo symbol? ## txtr <- txtr[ hasHugoSymbol ] symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] plotTracks(txtr) The above (minus comments) is what I used to generate a test result. On Mon, Feb 11, 2013 at 11:34 AM, Tim Triche, Jr. <tim.triche@gmail.com>wrote: > Well, here's one approach. I'll start from the constructed 'txtr' track. > > ## see ?select for more on the following > ## > library(Homo.sapiens) > symbolMappings <- select(Homo.sapiens, > > cols=c('UCSCKG','ENTREZID','SYMBOL'), > keys=symbol(txtr), > keytype='UCSCKG') > > ## "pork out" the mappings table so that duplicates expand > ## > symbolMappings <- symbolMappings[match(symbol(txtr), > > symbolMappings$UCSCKG),] > > ## if NAs can be accepted as keys, this next step might be unnecessary > ## however, it seems that not all UCSC known genes have a Hugo symbol? > ## > txtr <- txtr[ hasHugoSymbol ] > symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] > plotTracks(txtr) > > That works. > > > > > On Mon, Feb 11, 2013 at 6:03 AM, Hahne, Florian < > florian.hahne@novartis.com> wrote: > >> Well, the main culprit here is really the TranscriptDB package. It does >> not seem to deal at all with gene symbols, so there is no way for Gviz to >> automatically fetch those. If you come up with a way to match the UCSC >> gene identifiers back to gene symbols you could stick those into the >> GeneRegionTrack using the 'symbol' replacement method. E.g., >> symbol(foo) <- mappingTable[match(transcript(foo), mappingTable$UCSCId),]) >> I am not sure how this mapping is supposed to be done in the Bioconductor >> world these days. You may be able to find a way using one of the org.db >> packages. Or maybe you will have to download a mapping table directly from >> the UCSC table browser. >> With the next release of Bioconductor (or already now if you are working >> with the devel branch), Gviz supports building tracks from a whole range >> of standard annotation files. You could then export the whole known.gene >> table from UCSC as a GTF file and import in again as a GeneRegionTrack >> object. Alternatively you may want to look into the BiomartGeneRegionTrack >> class which will fetch the gene models from Ensembl, but this includes the >> HUGO gene symbols. >> Florian >> >> >> -- >> >> >> >> >> >> >> On 2/7/13 10:51 AM, "Bogdan Tanasa" <tanasa@gmail.com> wrote: >> >> >Dear all, >> > >> >I am using the following code below in order to retrieve the gene >> >annotations in Gviz package : >> >please could advise on what shall I modify in order to display the HUGO >> >gene symbol on each gene ? thanks ! >> > >> >library("GenomicFeatures") >> >hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = >> >"knownGene") >> >saveDb(hg18db, file="hg18db_knownGene.sqlite") >> >txdb <-loadDb("hg18db_knownGene.sqlite") >> >txTr <- >> >> >GeneRegionTrack(txdb,genome="hg18",chromosome="chr9",showId=TRUE,g eneSymbo >> >l=TRUE,name="UCSC") >> >plotTracks(txTr,from=start,to=end) >> > >> >-- bogdan >> >------------------ >> > >> > [[alternative HTML version deleted]] >> > >> >_______________________________________________ >> >Bioconductor mailing list >> >Bioconductor@r-project.org >> >https://stat.ethz.ch/mailman/listinfo/bioconductor >> >Search the archives: >> >http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor@r-project.org >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> > > > > -- > *A model is a lie that helps you see the truth.* > * > * > Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> > -- *A model is a lie that helps you see the truth.* * * Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Cool, thanks. Just learned something again today :-) I will take a closer look at the Homo.sapiens package (and the other new organism annotation packages as well) to figure out how to integrate this more closely into the Gviz package. One should not have to jump through all these hoops to get gene symbols in there if all the necessary information is already on your fingertips. Florian -- From: "<tim triche="">", "Jr." <tim.triche@gmail.com<mailto:tim.triche@gmail.com>> Reply-To: "ttriche@usc.edu<mailto:ttriche@usc.edu>" <ttriche@usc.edu<mailto:ttriche@usc.edu>> Date: Monday, February 11, 2013 8:39 PM To: NIBR <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>> Cc: Bogdan Tanasa <tanasa@gmail.com<mailto:tanasa@gmail.com>>, Bioconductor mailing list <bioconductor@r-project.org<mailto:bioconductor@r-project.org>>, "bioc-sig-sequencing-request@r-project.org<mailto:bioc-sig-sequencing- request@r-project.org="">" <bioc-sig-sequencing- request@r-project.org<mailto:bioc-sig-sequencing-="" request@r-project.org="">> Subject: Re: [BioC] question about Gviz Oops, critical step omitted. See below. ## see ?select for more on the following ## library(Homo.sapiens) symbolMappings <- select(Homo.sapiens, cols=c('UCSCKG','ENTREZID','SYMBOL'), keys=symbol(txtr), keytype='UCSCKG') ## "pork out" the mappings table so that duplicates expand ## symbolMappings <- symbolMappings[match(symbol(txtr), symbolMappings$UCSCKG),] ## if NAs could be accepted as keys, this next step might be unnecessary ## hasHugoSymbol <- !is.na<http: is.na="">(symbolMappings$SYMBOL) ## however, it seems that not all UCSC known genes have a Hugo symbol? ## txtr <- txtr[ hasHugoSymbol ] symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] plotTracks(txtr) The above (minus comments) is what I used to generate a test result. On Mon, Feb 11, 2013 at 11:34 AM, Tim Triche, Jr. <tim.triche@gmail.com<mailto:tim.triche@gmail.com>> wrote: Well, here's one approach. I'll start from the constructed 'txtr' track. ## see ?select for more on the following ## library(Homo.sapiens) symbolMappings <- select(Homo.sapiens, cols=c('UCSCKG','ENTREZID','SYMBOL'), keys=symbol(txtr), keytype='UCSCKG') ## "pork out" the mappings table so that duplicates expand ## symbolMappings <- symbolMappings[match(symbol(txtr), symbolMappings$UCSCKG),] ## if NAs can be accepted as keys, this next step might be unnecessary ## however, it seems that not all UCSC known genes have a Hugo symbol? ## txtr <- txtr[ hasHugoSymbol ] symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] plotTracks(txtr) That works. On Mon, Feb 11, 2013 at 6:03 AM, Hahne, Florian <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>> wrote: Well, the main culprit here is really the TranscriptDB package. It does not seem to deal at all with gene symbols, so there is no way for Gviz to automatically fetch those. If you come up with a way to match the UCSC gene identifiers back to gene symbols you could stick those into the GeneRegionTrack using the 'symbol' replacement method. E.g., symbol(foo) <- mappingTable[match(transcript(foo), mappingTable$UCSCId),]) I am not sure how this mapping is supposed to be done in the Bioconductor world these days. You may be able to find a way using one of the org.db packages. Or maybe you will have to download a mapping table directly from the UCSC table browser. With the next release of Bioconductor (or already now if you are working with the devel branch), Gviz supports building tracks from a whole range of standard annotation files. You could then export the whole known.gene table from UCSC as a GTF file and import in again as a GeneRegionTrack object. Alternatively you may want to look into the BiomartGeneRegionTrack class which will fetch the gene models from Ensembl, but this includes the HUGO gene symbols. Florian -- On 2/7/13 10:51 AM, "Bogdan Tanasa" <tanasa@gmail.com<mailto:tanasa@gmail.com>> wrote: >Dear all, > >I am using the following code below in order to retrieve the gene >annotations in Gviz package : >please could advise on what shall I modify in order to display the HUGO >gene symbol on each gene ? thanks ! > >library("GenomicFeatures") >hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = >"knownGene") >saveDb(hg18db, file="hg18db_knownGene.sqlite") >txdb <-loadDb("hg18db_knownGene.sqlite") >txTr <- >GeneRegionTrack(txdb,genome="hg18",chromosome="chr9",showId=TRUE,gene Symbo >l=TRUE,name="UCSC") >plotTracks(txTr,from=start,to=end) > >-- bogdan >------------------ > > [[alternative HTML version deleted]] > >_______________________________________________ >Bioconductor mailing list >Bioconductor@r-project.org<mailto:bioconductor@r-project.org> >https://stat.ethz.ch/mailman/listinfo/bioconductor >Search the archives: >http://news.gmane.org/gmane.science.biology.informatics.conductor _______________________________________________ Bioconductor mailing list Bioconductor@r-project.org<mailto:bioconductor@r-project.org> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- A model is a lie that helps you see the truth. Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> -- A model is a lie that helps you see the truth. Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Thank you again gentlemen for your kind help ... On Mon, Feb 11, 2013 at 11:55 PM, Hahne, Florian <florian.hahne@novartis.com> wrote: > Cool, thanks. Just learned something again today :-) > I will take a closer look at the Homo.sapiens package (and the other new > organism annotation packages as well) to figure out how to integrate this > more closely into the Gviz package. One should not have to jump through all > these hoops to get gene symbols in there if all the necessary information > is already on your fingertips. > Florian > -- > > > From: "<tim triche="">", "Jr." <tim.triche@gmail.com> > Reply-To: "ttriche@usc.edu" <ttriche@usc.edu> > Date: Monday, February 11, 2013 8:39 PM > To: NIBR <florian.hahne@novartis.com> > Cc: Bogdan Tanasa <tanasa@gmail.com>, Bioconductor mailing list < > bioconductor@r-project.org>, "bioc-sig-sequencing- request@r-project.org" < > bioc-sig-sequencing-request@r-project.org> > Subject: Re: [BioC] question about Gviz > > Oops, critical step omitted. See below. > > ## see ?select for more on the following > ## > library(Homo.sapiens) > symbolMappings <- select(Homo.sapiens, > > cols=c('UCSCKG','ENTREZID','SYMBOL'), > keys=symbol(txtr), > keytype='UCSCKG') > > ## "pork out" the mappings table so that duplicates expand > ## > symbolMappings <- symbolMappings[match(symbol(txtr), > > symbolMappings$UCSCKG),] > > ## if NAs could be accepted as keys, this next step might be unnecessary > ## > hasHugoSymbol <- !is.na(symbolMappings$SYMBOL) > > ## however, it seems that not all UCSC known genes have a Hugo symbol? > ## > txtr <- txtr[ hasHugoSymbol ] > symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] > plotTracks(txtr) > > > The above (minus comments) is what I used to generate a test result. > > > > > On Mon, Feb 11, 2013 at 11:34 AM, Tim Triche, Jr. <tim.triche@gmail.com>wrote: > >> Well, here's one approach. I'll start from the constructed 'txtr' track. >> >> ## see ?select for more on the following >> ## >> library(Homo.sapiens) >> symbolMappings <- select(Homo.sapiens, >> >> cols=c('UCSCKG','ENTREZID','SYMBOL'), >> keys=symbol(txtr), >> keytype='UCSCKG') >> >> ## "pork out" the mappings table so that duplicates expand >> ## >> symbolMappings <- symbolMappings[match(symbol(txtr), >> >> symbolMappings$UCSCKG),] >> >> ## if NAs can be accepted as keys, this next step might be unnecessary >> ## however, it seems that not all UCSC known genes have a Hugo symbol? >> ## >> txtr <- txtr[ hasHugoSymbol ] >> symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] >> plotTracks(txtr) >> >> That works. >> >> >> >> >> On Mon, Feb 11, 2013 at 6:03 AM, Hahne, Florian < >> florian.hahne@novartis.com> wrote: >> >>> Well, the main culprit here is really the TranscriptDB package. It does >>> not seem to deal at all with gene symbols, so there is no way for Gviz to >>> automatically fetch those. If you come up with a way to match the UCSC >>> gene identifiers back to gene symbols you could stick those into the >>> GeneRegionTrack using the 'symbol' replacement method. E.g., >>> symbol(foo) <- mappingTable[match(transcript(foo), >>> mappingTable$UCSCId),]) >>> I am not sure how this mapping is supposed to be done in the Bioconductor >>> world these days. You may be able to find a way using one of the org.db >>> packages. Or maybe you will have to download a mapping table directly >>> from >>> the UCSC table browser. >>> With the next release of Bioconductor (or already now if you are working >>> with the devel branch), Gviz supports building tracks from a whole range >>> of standard annotation files. You could then export the whole known.gene >>> table from UCSC as a GTF file and import in again as a GeneRegionTrack >>> object. Alternatively you may want to look into the >>> BiomartGeneRegionTrack >>> class which will fetch the gene models from Ensembl, but this includes >>> the >>> HUGO gene symbols. >>> Florian >>> >>> >>> -- >>> >>> >>> >>> >>> >>> >>> On 2/7/13 10:51 AM, "Bogdan Tanasa" <tanasa@gmail.com> wrote: >>> >>> >Dear all, >>> > >>> >I am using the following code below in order to retrieve the gene >>> >annotations in Gviz package : >>> >please could advise on what shall I modify in order to display the HUGO >>> >gene symbol on each gene ? thanks ! >>> > >>> >library("GenomicFeatures") >>> >hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = >>> >"knownGene") >>> >saveDb(hg18db, file="hg18db_knownGene.sqlite") >>> >txdb <-loadDb("hg18db_knownGene.sqlite") >>> >txTr <- >>> >>> >GeneRegionTrack(txdb,genome="hg18",chromosome="chr9",showId=TRUE, geneSymbo >>> >l=TRUE,name="UCSC") >>> >plotTracks(txTr,from=start,to=end) >>> > >>> >-- bogdan >>> >------------------ >>> > >>> > [[alternative HTML version deleted]] >>> > >>> >_______________________________________________ >>> >Bioconductor mailing list >>> >Bioconductor@r-project.org >>> >https://stat.ethz.ch/mailman/listinfo/bioconductor >>> >Search the archives: >>> >http://news.gmane.org/gmane.science.biology.informatics.conductor >>> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor@r-project.org >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: >>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>> >> >> >> >> -- >> *A model is a lie that helps you see the truth.* >> * >> * >> Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> >> > > > > -- > *A model is a lie that helps you see the truth.* > * > * > Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> > > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 6 months ago
Palo Alto, CA, USA
Thanks, Tim ...will do it accordingly. On Mon, Feb 11, 2013 at 3:49 PM, Tim Triche, Jr. <tim.triche@gmail.com>wrote: > So the problem (at least as regards my initial code snippet) is that there > is no mapping in the Homo.sapiens OrganismDb for either uc002yjx.1 > or uc010gkz.1 and thus no symbol (since symbol-less features are dropped). > That's sort of odd since, it seems, these are NRIP1 isoforms. > > I noticed that p15 and p16 transcripts appeared to be missing when I > looked at chr9 earlier. This might be an issue where mappings are missing > from Homo.sapiens / org.Hs.eg.db, in which case a posting to the list would > be good. > > Meanwhile, if you want to keep the UCSC names of the genes for which there > is not a Hugo mapping in the symbol table, the following replacement for > subsetting txtr should do it (I tested this): > > ## don't subset txtr. instead, > symbol(txtr)[ hasHugoSymbol ] <- symbolMappings$SYMBOL[hasHugoSymbol] > > Then proceed as before. I get the attached output from running > > plotTracks(txtr,from=start,to=end) > > since the NRIP1 isoforms, not being mapped to Hugo (?!), stay UCSC IDs. > > Do you mind if I cc: the list on this? And/or bring it up with Marc/Herve? > > --t > > > > On Mon, Feb 11, 2013 at 3:19 PM, Bogdan Tanasa <tanasa@gmail.com> wrote: > >> Hi Tim, >> >> I followed your code, in the following way (please see below); >> plotTracks(txtr) works; however, when I try to plot specific regions >> ( eg plotTracks(txtr,chr="chr21", start=15245000,end=15520000) ) it does >> not show the correct region : I suspect it may be an issue in my code, but >> not very sure where ... if you have 2-3 minutes, would appreciate your >> help. thanks ! >> >> library(Homo.sapiens) >> library("ggplot2") >> library(Gviz) >> library("GenomicFeatures") >> library("ggplot2") >> library("rtracklayer") >> library("TxDb.Hsapiens.UCSC.hg18.knownGene") >> >> chr<-"chr21" >> start<-15245000 >> end <-15520000 >> >> hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = >> "knownGene") >> saveDb(hg18db, file="hg18db_knownGene.sqlite") >> txdb <-loadDb("hg18db_knownGene.sqlite") >> txtr <- >> GeneRegionTrack(txdb,genome="hg18",chromosome="chr21",showId=TRUE,g eneSymbol=TRUE,name="UCSC") >> plotTracks(txtr,from=start,to=end) >> >> >> >> symbolMappings <- select(Homo.sapiens, >> cols=c('UCSCKG','ENTREZID','SYMBOL'), >> keys=symbol(txtr), keytype='UCSCKG') >> symbolMappings <- symbolMappings[match(symbol(txtr), >> symbolMappings$UCSCKG),] >> >> hasHugoSymbol <- !is.na(symbolMappings$SYMBOL) >> >> txtr <- txtr[ hasHugoSymbol ] >> symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] >> >> plotTracks(txtr) >> plotTracks(txtr,from=start,to=end) >> >> >> >> On Mon, Feb 11, 2013 at 11:39 AM, Tim Triche, Jr. <tim.triche@gmail.com>wrote: >> >>> Oops, critical step omitted. See below. >>> >>> ## see ?select for more on the following >>> ## >>> library(Homo.sapiens) >>> symbolMappings <- select(Homo.sapiens, >>> >>> cols=c('UCSCKG','ENTREZID','SYMBOL'), >>> keys=symbol(txtr), >>> keytype='UCSCKG') >>> >>> ## "pork out" the mappings table so that duplicates expand >>> ## >>> symbolMappings <- symbolMappings[match(symbol(txtr), >>> >>> symbolMappings$UCSCKG),] >>> >>> ## if NAs could be accepted as keys, this next step might be unnecessary >>> ## >>> hasHugoSymbol <- !is.na(symbolMappings$SYMBOL) >>> >>> ## however, it seems that not all UCSC known genes have a Hugo symbol? >>> ## >>> txtr <- txtr[ hasHugoSymbol ] >>> symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] >>> plotTracks(txtr) >>> >>> >>> The above (minus comments) is what I used to generate a test result. >>> >>> >>> >>> >>> On Mon, Feb 11, 2013 at 11:34 AM, Tim Triche, Jr. <tim.triche@gmail.com>wrote: >>> >>>> Well, here's one approach. I'll start from the constructed 'txtr' >>>> track. >>>> >>>> ## see ?select for more on the following >>>> ## >>>> library(Homo.sapiens) >>>> symbolMappings <- select(Homo.sapiens, >>>> >>>> cols=c('UCSCKG','ENTREZID','SYMBOL'), >>>> keys=symbol(txtr), >>>> keytype='UCSCKG') >>>> >>>> ## "pork out" the mappings table so that duplicates expand >>>> ## >>>> symbolMappings <- symbolMappings[match(symbol(txtr), >>>> >>>> symbolMappings$UCSCKG),] >>>> >>>> ## if NAs can be accepted as keys, this next step might be unnecessary >>>> ## however, it seems that not all UCSC known genes have a Hugo symbol? >>>> ## >>>> txtr <- txtr[ hasHugoSymbol ] >>>> symbol(txtr) <- symbolMappings$SYMBOL[ hasHugoSymbol ] >>>> plotTracks(txtr) >>>> >>>> That works. >>>> >>>> >>>> >>>> >>>> On Mon, Feb 11, 2013 at 6:03 AM, Hahne, Florian < >>>> florian.hahne@novartis.com> wrote: >>>> >>>>> Well, the main culprit here is really the TranscriptDB package. It does >>>>> not seem to deal at all with gene symbols, so there is no way for Gviz >>>>> to >>>>> automatically fetch those. If you come up with a way to match the UCSC >>>>> gene identifiers back to gene symbols you could stick those into the >>>>> GeneRegionTrack using the 'symbol' replacement method. E.g., >>>>> symbol(foo) <- mappingTable[match(transcript(foo), >>>>> mappingTable$UCSCId),]) >>>>> I am not sure how this mapping is supposed to be done in the >>>>> Bioconductor >>>>> world these days. You may be able to find a way using one of the org.db >>>>> packages. Or maybe you will have to download a mapping table directly >>>>> from >>>>> the UCSC table browser. >>>>> With the next release of Bioconductor (or already now if you are >>>>> working >>>>> with the devel branch), Gviz supports building tracks from a whole >>>>> range >>>>> of standard annotation files. You could then export the whole >>>>> known.gene >>>>> table from UCSC as a GTF file and import in again as a GeneRegionTrack >>>>> object. Alternatively you may want to look into the >>>>> BiomartGeneRegionTrack >>>>> class which will fetch the gene models from Ensembl, but this includes >>>>> the >>>>> HUGO gene symbols. >>>>> Florian >>>>> >>>>> >>>>> -- >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On 2/7/13 10:51 AM, "Bogdan Tanasa" <tanasa@gmail.com> wrote: >>>>> >>>>> >Dear all, >>>>> > >>>>> >I am using the following code below in order to retrieve the gene >>>>> >annotations in Gviz package : >>>>> >please could advise on what shall I modify in order to display the >>>>> HUGO >>>>> >gene symbol on each gene ? thanks ! >>>>> > >>>>> >library("GenomicFeatures") >>>>> >hg18db <- makeTranscriptDbFromUCSC(genome = "hg18",tablename = >>>>> >"knownGene") >>>>> >saveDb(hg18db, file="hg18db_knownGene.sqlite") >>>>> >txdb <-loadDb("hg18db_knownGene.sqlite") >>>>> >txTr <- >>>>> >>>>> >GeneRegionTrack(txdb,genome="hg18",chromosome="chr9",showId=TRU E,geneSymbo >>>>> >l=TRUE,name="UCSC") >>>>> >plotTracks(txTr,from=start,to=end) >>>>> > >>>>> >-- bogdan >>>>> >------------------ >>>>> > >>>>> > [[alternative HTML version deleted]] >>>>> > >>>>> >_______________________________________________ >>>>> >Bioconductor mailing list >>>>> >Bioconductor@r-project.org >>>>> >https://stat.ethz.ch/mailman/listinfo/bioconductor >>>>> >Search the archives: >>>>> >http://news.gmane.org/gmane.science.biology.informatics.conductor >>>>> >>>>> _______________________________________________ >>>>> Bioconductor mailing list >>>>> Bioconductor@r-project.org >>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>>>> Search the archives: >>>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>>>> >>>> >>>> >>>> >>>> -- >>>> *A model is a lie that helps you see the truth.* >>>> * >>>> * >>>> Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> >>>> >>> >>> >>> >>> -- >>> *A model is a lie that helps you see the truth.* >>> * >>> * >>> Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> >>> >> >> > > > -- > *A model is a lie that helps you see the truth.* > * > * > Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 611 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6