Question: Error in .normargSEW0(start, "start") : 'start' must be a numeric vector (or NULL)
0
gravatar for bisansamara
18 months ago by
bisansamara10
bisansamara10 wrote:

Hi,

I'm using the GenomicRanges package in R to find overlaps between two lists of chromosome ranges. When I use this code, I get an error saying that 'start' must be a numeric vector:

x0 = as.data.frame(read.table("file0.bed")) x1 = read.csv ("file1.csv")

library(GenomicRanges) gr0 = with(x0, GRanges(chr, IRanges(start=start, end=stop)))
Error in .normargSEW0(start, "start") : 'start' must be a numeric vector (or NULL)
gr1 = with(x1, GRanges(chr, IRanges(start=start, end=stop)))

hits = findOverlaps(gr0, gr1) Error in findOverlaps(gr0, gr1) : object 'gr0' not found

I tried to add the command as.numeric to 'start', but i also didn't work:

gr0 = with(x0, GRanges(chr, IRanges(start=as.numeric(start), end=as.numeric(stop))))
Error in as.numeric(start) : cannot coerce type 'closure' to vector of type 'double'

Any suggestions on how to solve this?

genomicranges R • 1.0k views
ADD COMMENTlink modified 6 months ago by mlweilert10 • written 18 months ago by bisansamara10
1
gravatar for mlweilert
6 months ago by
mlweilert10
Stowers Institute for Medical Research
mlweilert10 wrote:

Your problem lies with the line:

gr1 = with(x1, GRanges(chr, IRanges(start=start, end=stop)))

You are inputting a data.frame object into this command and relying on some assumptions. Check the header information on your data.frame object and make sure the data.frame column names match up to what you entered. This error is a result of incompatible inputs.

ADD COMMENTlink written 6 months ago by mlweilert10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 728 users visited in the last hour