MulaiMulai sekarang secara 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.

Latihan ini adalah bagian dari kursus

Introduction to Bioconductor in R

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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
___
___
Edit dan Jalankan Kode