Skip to content

Instantly share code, notes, and snippets.

@sirusb
Last active August 29, 2015 14:15
Show Gist options
  • Save sirusb/b954cc9aea2c04533dc6 to your computer and use it in GitHub Desktop.
Save sirusb/b954cc9aea2c04533dc6 to your computer and use it in GitHub Desktop.
IRanges example
library(IRanges)
# يمكن انشاء مجموعة مجالات بتحديد نقطة البداية والنهاية
range1 <- IRanges(start=c(10,50,300),end =c(30,90,456))
range1
#IRanges of length 3
# start end width
#[1] 10 30 21
#[2] 50 90 41
#[3] 300 456 157
# يمكن انشاء مجموعة مجالات بتحديد نقطة البداية وعُرض المجال
range2 <- IRanges(start=c(10,50,300),width=c(21,41,157))
range2
#IRanges of length 3
# start end width
#[1] 10 30 21
#[2] 50 90 41
#[3] 300 456 157
# Start, end , widht يمكن قرائة هذه الاحداثيا باستعمال دوال
start(range2)
#[1] 10 50 300
end(range2)
#[1] 30 90 456
width(range2)
#[1] 21 41 157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment