與 IRanges 互動
你可以使用 IRanges() 函式建立單一序列。你也可以把向量傳入 IRanges(),一次建立多個序列區間。這既有趣又實用!物件 seq_1 和 seq_2 就是這樣建立的範例。
在這個練習中,請用 width() 和 lengths() 檢查這裡提供的每個序列的寬度。注意這兩種輸出之間的差異。
記住:width = end - start + 1。
本練習屬於課程
R 中的 Bioconductor 入門
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# 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
___
___