Hi , i am trying to rename the seqlevels of granges (feat_ranges) from type I, II, III, ...,VII, Mito to 1,2,3,...16, 17. Here are steps that i took but didn't worked for me.
>library(GenomicFeatures); library("biomaRt"); library(systemPipeR);library(GenomeInfoDb)
>txdb <- makeTxDbFromBiomart(biomart = "ensembl", dataset = "scerevisiae_gene_ensembl")
>myfeatures <- c("tx_type", "promoter", "intron", "exon", "cds", "intergenic")
>feat_ranges <- genFeatures(txdb, featuretype=myfeatures, reduce_ranges=FALSE, upstream=1000, downstream=0)newStyle=mapSeqlevels(seqlevels(feat), as.character(c(1:17)))feat=renameSeqlevels(feat,newStyle)
>newStyle=mapSeqlevels(seqlevels(feat),as.character(c(1:16))) # did not worked for me
> feat_ranges
GRangesList object of length 12:
$protein_coding
GRanges object with 6692 ranges and 3 metadata columns:
seqnames ranges strand | feature_by featuretype_id featuretype
<Rle> <IRanges> <Rle> | <CharacterList> <character> <character>
I [ 335, 649] + | YAL069W YAL069W protein_coding
I [ 538, 792] + | YAL068W-A YAL068W-A protein_coding
I [ 2480, 2707] + | YAL067W-A YAL067W-A protein_coding
I [10091, 10399] + | YAL066W YAL066W protein_coding
I [12046, 12426] + | YAL064W-B YAL064W-B protein_coding
... ... ... ... ... ... ... ...
Mito [65770, 66174] + | Q0182 Q0182 protein_coding
Mito [73758, 74513] + | Q0250 Q0250 protein_coding
Mito [74495, 75984] + | Q0255 Q0255 protein_coding
Mito [79213, 80022] + | Q0275 Q0275 protein_coding
Mito [85554, 85709] + | Q0297 Q0297 protein_coding
...
<11 more elements>
-------
seqinfo: 17 sequences (1 circular) from an unspecified genome

Oh great, it really worked for me. Thanks Hans-Rudolf