Closed LiNk-NY closed 4 years ago
Marcel,
seqlevelsStyle()
now uses the genome field to infer the style so getting it right is important. If you manually set the genome to hg18
you're saying "this is genome hg18" so when you do seqlevelsStyle() <- "UCSC"
nothing happens because seqlevelsStyle()
sees that this is already a UCSC genome.
So one way to avoid this is to change the genome build after you change the seqlevels style:
grag <- rowRanges(coad[[rag]])
unique(genome(grag))
# [1] "36"
seqlevelsStyle(grag) <- "UCSC"
genome(grag) <- translateBuild(genome(grag))
seqinfo(grag)
# Seqinfo object with 24 sequences from hg18 genome; no seqlengths:
# seqnames seqlengths isCircular genome
# chr1 <NA> <NA> hg18
# chr2 <NA> <NA> hg18
# chr3 <NA> <NA> hg18
# chr4 <NA> <NA> hg18
# chr5 <NA> <NA> hg18
# ... ... ... ...
# chr20 <NA> <NA> hg18
# chr21 <NA> <NA> hg18
# chr22 <NA> <NA> hg18
# chrX <NA> <NA> hg18
# chrY <NA> <NA> hg18
But It seems that grag
is in fact based on assembly NCBI36
so what you should really do is set genome to this instead of 36
. This will allow seqlevelsStyle()
to do a better job:
grag <- rowRanges(coad[[rag]])
genome(grag) <- "NCBI36"
seqlevelsStyle(grag)
# [1] "NCBI"
seqlevelsStyle(grag) <- "UCSC"
seqinfo(grag)
# Seqinfo object with 24 sequences from hg18 genome; no seqlengths:
# seqnames seqlengths isCircular genome
# chr1 <NA> <NA> hg18
# chr2 <NA> <NA> hg18
# chr3 <NA> <NA> hg18
# chr4 <NA> <NA> hg18
# chr5 <NA> <NA> hg18
# ... ... ... ...
# chr20 <NA> <NA> hg18
# chr21 <NA> <NA> hg18
# chr22 <NA> <NA> hg18
# chrX <NA> <NA> hg18
# chrY <NA> <NA> hg18
The bottom line is that if you use the official NCBI assembly name (as reported here https://www.ncbi.nlm.nih.gov/assembly/GCF_000001405.12/) seqlevelsStyle()
will know what to do.
Hope this helps, H.
Hi Marcel @LiNk-NY, hope you were able to sort this out. Don't hesitate to reopen the issue if not.
Hi Hervé,
Thanks for the response. It works for me now.
I'm updating some functions in TCGAutils
to coincide with this change.
Hi Hervé, @hpages I encountered this issue when working for a fix for
TCGAutils
in devel. Am I taking the right approach here? Best, MarcelCreated on 2020-07-06 by the reprex package (v0.3.0)