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]]

