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]]