Hello,
I'm trying to do a differential expression analysis with Rstudio.
I know that GRanges represents a collection of genomic ranges that each have a single start and end location on the genome but I don't know how to set it up.
Assuming that I'm interested of a certain region of the chromosome to analyze the expression of a particular gene,
Where I can find the region that I'm looking for and how to set up the code?
Here is an example:
> gr <- GRanges(
seqnames = Rle(c("chr1", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),ranges = IRanges(101:110, end = 111:120, names = head(letters, 10)),strand = Rle(strand(c("-", "+", "*", "+", "-")), c(1, 2, 2, 3, 2)),score = 1:10,GC = seq(1, 0, length=10))
> gr
<Rle> <IRanges> <Rle> | <integer>
GRanges object with 10 ranges and 2 metadata columns:
seqnames ranges strand | score
a chr1
b chr2
c chr2
. ...
h chr3
i chr3
j chr3
-------
seqinfo: 3 sequences from an unspecified genome; no seqlengths
Thank you

I should also note that if you are working with a different species, particularly a non-model species, or you want to use Ensembl mappings, etc., you can use the AnnotationHub.
biocLite("AnnotationHub") library(AnnotationHub) hub <- AnnotationHub() query(hub, c("homo sapiens","ensembldb"))See the AnnotationHub vignette for more in depth information.