Error in .normargSEW0(start, "start") : 'start' must be a numeric vector (or NULL)
1
0
Entering edit mode
7.3 years ago
bisansamara ▴ 20

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?

R GenomicRanges • 4.3k views
ADD COMMENT
1
Entering edit mode
6.3 years ago
mlweilert ▴ 10

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 COMMENT

Login before adding your answer.

Traffic: 1609 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6