gravatar for neo_noob

2 hours ago by

Hi All, I am new to bioinformatics and R. I am trying to learn with online tutorials and forums, but could not find anything related to my simple question.

I have a few GRanges defined in R. I wanted to rename the columns of metadata of each of the Granges.

I am using names(mcols(gr))=c("name1", "name2", "name3')

this works when I try to rename GR individually, but it does not work within a for loop.

for ( gr in c(gr1, gr2, gr3, gr4)  )    {
     names(mcols(gr) = c("name1", "name2", "name3')

I got this error:

invalid for() loop sequence

does it mean I can not use for loops for GRs? what am I doing wrong here? what are other ways I can do this?


modified 59 minutes ago



2 hours ago


Source link