सीक्वेंस रेंजेस

R में Bioconductor परिचय

Paula Andrea Martinez, PhD.

Data scientist

संख्यात्मक आर्ग्युमेंट्स के साथ IRanges

# Loading IRanges
library(IRanges)

एक रेंज start और end से तय होती है

myIRanges <- IRanges(start = 20, end = 30)
myIRanges
IRanges object with 1 range and 0 metadata columns:
   start       end     width
<integer> <integer> <integer>
[1]   20        30        11
R में Bioconductor परिचय
(myIRanges_width <- IRanges(start = c(1, 20), width = c(30, 11)))
 IRanges object with 2 ranges and 0 metadata columns:
         start       end     width    
      <integer> <integer> <integer>
[1]         1        30        30       
[2]        20        30        11
(myIRanges_end <- IRanges(start = c(1, 20), end = 30))
 IRanges object with 2 ranges and 0 metadata columns:
         start       end     width    
      <integer> <integer> <integer>
[1]         1        30        30       
[2]        20        30        11

समीकरण: width = end - start + 1

R में Bioconductor परिचय

Rle - रन लेंथ एनकोडिंग

  • Rle का अर्थ है Run length encoding
  • किसी vector या factor की lengths और values निकालकर स्टोर करता है
  • Rle एक सामान्य S4 कंटेनर है जो लंबे दोहराए गए vectors को कुशलता से सेव करता है
(some_numbers <- c(3, 2, 2, 2, 3, 3, 4, 2))
3 2 2 2 3 3 4 2
(Rle(some_numbers))
numeric-Rle of length 8 with 5 runs
Lengths: 1 3 2 1 1
Values : 3 2 3 4 2
R में Bioconductor परिचय

लॉजिकल वेक्टर के साथ IRanges

IRanges(start = c(FALSE, FALSE, TRUE, TRUE))
 IRanges object with 1 range and 0 metadata columns:
      start       end     width
  <integer> <integer> <integer>
[1]       3         4         2
R में Bioconductor परिचय

लॉजिकल Rle के साथ IRanges

gi <- c(TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE)
myRle <- Rle(gi)
logical-Rle of length 7 with 3 runs
Lengths:     2     2     3
Values :  TRUE FALSE  TRUE
IRanges(start = myRle)
IRanges object with 2 ranges and 0 metadata columns:
         start       end     width
      <integer> <integer> <integer>
[1]         1         2         2
[2]         5         7         3
R में Bioconductor परिचय

सारांश

IRanges पदानुक्रमित डेटा स्ट्रक्चर हैं और मेटाडेटा रख सकते हैं.

IRanges ऑब्जेक्ट बनाने के लिए:

  • start, end, या width को numeric vectors (या NULL) के रूप में दें।
  • start आर्ग्युमेंट को logical vector या logical Rle ऑब्जेक्ट के रूप में दें।
    • Rle का अर्थ Run length encoding है और यह storage-efficient है।
    • IRanges के आर्ग्युमेंट्स recycled होते हैं (खाली जगहें भरती हैं)।
    • sequence range का समीकरण: width = end - start + 1.
R में Bioconductor परिचय

आइए sequence ranges का अभ्यास करें!

R में Bioconductor परिचय

Preparing Video For Download...