Hello,

I used the same codes for chr22, it didn't show any error msg.
#chr22
for (i in 1:17183)
{
if (getSeq(Hsapiens, "chr22",
unique(chr22[,6])[i],(unique(chr22[,6])[i]+1))=="CG")
{
write.table(paste(">",
unique(chr22[,6])[i],sep=""),file="chr22FOR",row.names=F, col.names=F,
append=TRUE)
write.table(getSeq(Hsapiens, "chr22",
(unique(chr22[,6])[i]-50),(unique(chr22[,6])[i]+50)),file="chr22FOR",row.names=F,
col.names=F, append=TRUE)
}
}

> sessionInfo()
R version 2.8.1 (2008-12-22)
i486-pc-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] BSgenome.Hsapiens.UCSC.hg18_1.3.11 BSgenome_1.10.3
[3] Biostrings_2.10.15                 IRanges_1.0.9

loaded via a namespace (and not attached):
[1] grid_2.8.1         lattice_0.17-20    Matrix_0.999375-18
tools_2.8.1
>


On Thu, Jan 29, 2009 at 9:11 PM, Tiandao Li <litd99@gmail.com> wrote:

> Hello,
>
> I used getSeq to retrieve human genomic sequences from the BSgenome data
> package:
>
> library(BSgenome.Hsapiens.UCSC.hg18)
>
> # cpg is GTF file
> chr6 <- cpg[grep("6", cpg[[5]]),] # chrom 6
> length(unique(chr6[,6])) # 10683 genomic positions
>
> # loop to match "CG" and print 100bp to file
> for (i in 1:10683)
> {
> if (getSeq(Hsapiens, "chr6",
> unique(chr6[,6])[i],(unique(chr6[,6])[i]+1))=="CG")
> {
> write.table(paste(">",
> unique(chr6[,6])[i],sep=""),file="chr6FOR",row.names=F, col.names=F,
> append=TRUE)
> write.table(getSeq(Hsapiens, "chr6",
> (unique(chr6[,6])[i]-50),(unique(chr6[,6])[i]+50)),file="chr6FOR",row.names=F,
> col.names=F, append=TRUE)
> }
> }
>
> However, I always got the error meg like the following when i = 5263
>
> Error in solveUserSEW(length(x), start = start, end = end, width = width) :
>
>   solving row 1: 'allow.nonnarrowing' is FALSE and the supplied start
> (63219120) is > refwidth + 1
>
> Please let me know if there's something I should be paying attention to.
>
> Thanks!
>

	[[alternative HTML version deleted]]

