How to rename the elements in columns(txdb)?
1
1
Entering edit mode
2.6 years ago
Pratik ★ 1.0k

Hello Biostars Community,

I made a txdb object using:

mm39.txdb <- makeTxDbFromEnsembl(organism = "Mus musculus")

and then made the CompressedGRangesList :

txns <- GRangesList(cds(mm39.txdb, columns = c("CDSSTART","CDSEND")))


I am trying to figure out how to rename CDSSTART to cdsStart and CDSEND to cdsEnd. Help? Please?

The reason for this renaming is so that nothing "breaks" in the package when plugging in the final data files it requires.

I feel like this is such a simple task, but I am not sure exactly to do it... I've probably been trying to figure out this tiny thing for like 2 hours now... I tried exploring GenomeInfoDb for something similar to

seqlevelsStyle(mm39.txdb) <- "UCSC"

No success, yet...

Thank you in advance!

-Pratik

GenomicFeatures GenomicRanges GenomeInfoDb • 1.7k views
ADD COMMENT
0
Entering edit mode

For the full picture: I am trying to create a genomeInfo.mm39 list object for the SesameData package so I could plug it into the sesame R package. The current SesameData only has genomeInfo.mm10.

For reference, genomeInfo.mm10 is obtained by

library(sesameData)
genomeInfo.mm10 <- sesameData::sesameDataGet('genomeInfo.mm10')

txns is a CompressedGRangesList within the genomeInfo.* list, obtained by:

txns <- genomeInfo.mm10$txns
ADD REPLY
3
Entering edit mode
2.6 years ago

You can set the mcols (which is a DataFrame).

mcols(txns, level="within")[, "cdsStart"] <- mcols(txns, level="within")[, "CDSSTART"]
mcols(txns, level="within")[, "cdsEnd"] <- mcols(txns, level="within")[, "CDSEND"]
txns <- txns[, c("cdsStart", "cdsEnd")]

> txns
GRangesList object of length 1:
[[1]]
GRanges object with 528396 ranges and 2 metadata columns:
             seqnames          ranges strand |  cdsStart    cdsEnd
                <Rle>       <IRanges>  <Rle> | <integer> <integer>
       [1]          1 4878137-4878205      + |   4878137   4878205
       [2]          1 4878137-4878205      + |   4878137   4878205
       [3]          1 4878137-4878205      + |   4878137   4878205
       [4]          1 4878137-4878205      + |   4878137   4878205
       [5]          1 4878137-4878205      + |   4878137   4878205
       ...        ...             ...    ... .       ...       ...
  [528392] JH584304.1     55480-55701      - |     55480     55701
  [528393] JH584304.1     56986-57151      - |     56986     57151
  [528394] JH584304.1     56986-57151      - |     56986     57151
  [528395] JH584304.1     58564-58616      - |     58564     58616
  [528396] JH584304.1     58564-58616      - |     58564     58616
  -------
  seqinfo: 61 sequences (1 circular) from an unspecified genome
ADD COMMENT
0
Entering edit mode

Thank you rpolicastro ! This is perfect!

ADD REPLY

Login before adding your answer.

Traffic: 3458 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