IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Introduction to Bioconductor in R

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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
___
___
Modifica ed esegui il codice