This is a test version of Biostars. For the public version, visit https://www.biostars.org.
trouble with GRanges

I have this GRange list. I would to make some manipulation:

GRanges object with 1498791 ranges and 0 metadata columns:
                                                                                                                              seqnames
                                                                                                                                 <Rle>
        [1] KQ415657.1  isolate UCB-OBI-ISO-001 unplaced genomic scaffold Scaffold5, whole genome shotgun sequence
        [2] KQ415657.1 isolate UCB-OBI-ISO-001 unplaced genomic scaffold Scaffold5, whole genome shotgun sequence
        [3] KQ415657.1  isolate UCB-OBI-ISO-001 unplaced genomic scaffold Scaffold5, whole genome shotgun sequence


               ranges strand
            <IRanges>  <Rle>
        [1]   303-309      *
        [2] 1741-1747      *
        [3] 1972-1978      *

I would rename the strings, and also create columns with start and and, and also define the strand. I would have a result like this but I don't know how to change the names of seqnames

       GRanges object with 1498791 ranges and 0 metadata columns:
  seqnames                            ranges           strand
                                      start   end                                                                                                    
 [1] KQ415657.1                       303     309         +
 [2] KQ415657.1                       1741    1747        +
 [3] KQ415657.1                       1972    1978        +

could you help me?

r

What have you tried?

I tried using granges but i don't have any ideas how to extract the firt word in seqnames...

That would be a pure R question, and you should be able to use Google and StackOverflow to find the answer. I'm closing the question as it has little to do with bioinformatics.

seqnames() is the command to access the seqnames and can be used for reassignment. Sure you can manage. Please use google and the GenomicRanges manual.

Hello frida!

We believe that this post does not fit the main topic of this site.

The underlying question is basic string manipulation and has little to do with GRanges/bioinformatics.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.