Get startedGet started for free

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.

This exercise is part of the course

Introduction to Bioconductor in R

View Course

Exercise instructions

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Load GenomicRanges package
library(GenomicRanges)

# Print seq_intervals
___

# Create myGR
___ <- ___(___, "___")

# Print myGR
___
Edit and Run Code