GenomicRanges package (Genomic ranges)

  1. Create a GRanges object using the following information:

  1. Use the start(), end(), strand(), seqnames() and width() functions on the GRanges object you created. What information do you obtain?

  1. Add the width of ranges as a metadata column named dimension.
    Hint: use $ as if it is a dataframe.

  1. Extract metadata columns.

  1. Create a subset of the GRanges object containing only intervals on the + strand and another subset with intervals located on chr1.
    Hint: GRanges objects can be subset using the [ ] operator, similar to data frames.
    However, you may need to use start(), end(), strand(), and seqnames() within [ ].

  1. Modify the chromosome of the second interval in the GRanges object to chr20.

  1. Try creating a GRanges object using the following data:


Are you able to create it successfully? Why or why not?


  1. Create a GRanges object using the following data:

  1. Assign names to the GRanges object you created: Sequence1, Sequence2, Sequence3, and Sequence4.

  1. Extract the range named Sequence3 from the GRanges object.