CommencerCommencer gratuitement

Interacting with IRanges

You can use the IRanges() function to create a single sequence. You can also provide vectors to IRanges() to create multiple sequence ranges at the same time. This is both fascinating and useful! The creation of objects seq_1 and seq_2 are examples of this.

For this exercise, check the width of each of the sequences provided here, using width() and lengths(). Notice the difference between the two types of outputs.

Remember that width = end - start + 1.

Cet exercice fait partie du cours

Introduction to Bioconductor in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create the first sequence seq_1
seq_1 <- IRanges(start = 10, end = 37)

# Create the second sequence seq_2
seq_2 <- IRanges(start = c(5, 35, 50),
                 end = c(12, 39, 61),
                 names = LETTERS[1:3])

# Check the width of seq_1 and seq_2
___
___
Modifier et exécuter le code