Thank you for your answer and the tip! actually I didn't get the way to present the list of TSS to a GRanges object. I have a list of TSS coordinates that has been retrieved by the query like this:
mart <- useDataset("hsapiens_gene_ensembl", useMart("ensembl"))
att <- listAttributes(mart)
grep("transcript", att$name, value=TRUE)
getBM(attributes=c("chromosome_name", "transcript_start", "transcript_end", "ensembl_gene_id","gene_biotype", "ensembl_transcript_id"),
filters ="biotype",
values =c("protein_coding"),
mart =mart)
and now, can you guide me how to transform the output to the BSgenome as you have mentioned. Thank you in advance.
You will need to verify that this still works: A: How Do I Use Biomart To Get Upstream Flanking Sequence For A Gene?