#depth now has the mean (overall)coverage
#set the bin-size
window<-1001
rangefrom<-0
rangeto<-length(data[,"sca_position"])
data.1kb<-runmean(data[,"coverage"],k=window)
png(file="cov_1k.png",width=400,height=1000)
plot(x=data[rangefrom:rangeto,"sca_position"],y=data.1kb[rangefrom:rangeto],pch=".",cex1,xlab="bp position",ylab="depth",type="p")
dev.off()
I got these error.
Error: unexpected symbol in:
"rangefrom<-0
rangeto<-length(data[,"sca_position"
data.1kb<-runmed(data[,"coverage"],k=window)
Error in as.integer(k) :
cannot coerce type 'closure' to vector of type 'integer'
png(file="cov_1k.png",width=400,height=1000)
plot(x=data[rangefrom:rangeto,"sca_position"],y=data.1kb[rangefrom:rangeto],pch=".",cex1,xlab="bp position",ylab="depth",type="p")
Error in `[.data.frame`(data, rangefrom:rangeto, "sca_position") :
object 'rangefrom' not found
I thought that I have done thing wrong, any suggestion will be very helpful.
Best regards,
Sutada