[Bioc-sig-seq] Extracting DNA sequences from BSgenome.Mmusculus.UCSC.mm9_1.3.11

Kasper Daniel Hansen khansen at stat.berkeley.edu
Thu May 28 20:31:38 CEST 2009


Please keep this on the list.

Assuming A is a data.frame

tmp = lapply(1:10, function(i) {
   chr = paste("chr", i, sep = "")
   A.sub = subset(A, chr == chr)
   cbind(A.sub, seq = as.character(Views(Mmusculus[[i]], start = A.sub 
$start, end = A.sub$end)))
})

A.new = do.call(rbind, tmp)

Kasper


On May 28, 2009, at 11:04 , Ivan Gregoretti wrote:

> Thanks Kasper.
>
>>
>> If you have several chromosomes, you will need something like an  
>> lapply over
>> the chromosomes
>
> That's the problem. Every time I try to loop over each chromosome, R
> complains saying that Mmusculus is a non subsetable S4 object.
>
> Ivan



More information about the Bioc-sig-sequencing mailing list