This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to rename the elements in columns(txdb)?

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

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

1 answer

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

Log in to answer this question.