Exercise

From tabular data to Genomic Ranges

In the video, you learned ways to create GRanges objects. You can define a GRange with a range's name, start, and end positions (seqnames, start, and end). If you have data in table format, you can also transform it into a GRanges object. Let's use a data frame, called seq_intervals, as this is most likely where you have stored your sequence intervals. Note: you can also use a tibble if you are more familiar with them.

You will use the predefined seq_intervals data frame to transform into a GRanges object using the as() function. The as() function was introduced in the last video - it takes in an object and the name of the class to convert the object to.

Instructions

100 XP
  • Load GenomicRanges.
  • Print seq_intervals to see how it looks.
  • Transform seq_intervals into a GRanges object, call the new object myGR.
  • Print myGR.