Use Views, like
tmp = Views(Mmusculus$chr1, start = VECTOR, end = VECTOR)
You can afterwards convert tmp into other objects, f.eks. a
DNAStringSet or a character vector. I know
DNAStringSet(tmp)
works and I would guess that
as.character(tmp)
works as well (otherwise you can do as.character(DNAStringSet(tmp)) )
You can specify a view by some combination of start, end, width
If you have several chromosomes, you will need something like an
lapply over the chromosomes
Kasper
On May 28, 2009, at 9:41 , Ivan Gregoretti wrote:
Hello everyone,
It is very easy to display one sequence of DNA from the mouse genome.
For example
library(BSgenome.Mmusculus.UCSC.mm9)
DNAString(Mmusculus$chr1)[100000000:100000050]
51-letter "DNAString" instance
seq: GGACTGCTGTTGCTGATTCATGTTTGATGTTTTAGACTGCTAATATCCTGA
My question:
Now lets say I have a BED-like list of genomic spaces like this
head(A[ , c("chr", "start", "end")])
chr start end
1 chr1 3644952 3649720
2 chr1 4599146 4601342
3 chr1 5015865 5018830
4 chr1 5072928 5076881
5 chr1 5504220 5507065
6 chr1 5513886 5516391
How do I display many sequences from different chromosomes?
Another question:
I wish to add these sequences to my BED-like data.frame as a new
field. How do I convert them to strings?
In my defense:
The first question is not covered in the documentation of
BSgenome.Mmusculus.UCSC.mm9.
Thank you,
Ivan
Ivan Gregoretti, PhD
National Institute of Diabetes and Digestive and Kidney Diseases
National Institutes of Health
5 Memorial Dr, Building 5, Room 205.
Bethesda, MD 20892. USA.
Phone: 1-301-496-1592
Fax: 1-301-496-9878
_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing