ValueError: invalid literal for int() with base 10: 'start' computeMatrix of deeptools
3
0
Entering edit mode
6.9 years ago
salamandra ▴ 550

When running the command with deeptools:

DIR=~/TESTING/day2_fos20_intersection
computeMatrix scale-regions -S path/HDF_day20.bw \
path/HUVEC_day2.bw \
-R $DIR/day2_fos20.bed $DIR/day2.bed $DIR/fos20.bed -b 4000 -a 4000 --regionBodyLength 5000 --missingDataAsZero -bs 50 -out HDFd20vsHUVd2_matrixscale.gz

I get the error:

ValueError: invalid literal for int() with base 10: 'start'

What am I doing wrong?

ChIP-Seq Deeptools • 6.2k views
ADD COMMENT
0
Entering edit mode

No header. I have some Chr17_gl00205_random though...don't know if that is a problem

ADD REPLY
0
Entering edit mode

Please post the first 10 or so lines of your BED files.

ADD REPLY
1
Entering edit mode

I have to ask you sorry. you were so right!

ADD REPLY
0
Entering edit mode

No worries!

ADD REPLY
3
Entering edit mode
6.9 years ago
venu 7.1k

Does your bed files have a header? If yes, try removing and run it again.

ADD COMMENT
0
Entering edit mode

They don't have headers, I checked ;)

ADD REPLY
0
Entering edit mode

Are you sure? By header I meant chr start end. I added this header to my bed file and used the command you mentioned. It is exactly giving the same error

ValueError: invalid literal for int() with base 10: 'start'

Without header it works completely fine.

ADD REPLY
0
Entering edit mode
5.6 years ago
udi.landau ▴ 40

In my case I had NA`s in the bed file

ADD COMMENT
0
Entering edit mode
20 months ago

Computers store numbers in a variety of different ways. Python has two main ones. Integers, which store whole numbers (ℤ), and floating point numbers, which store real numbers (ℝ). You need to use the right one based on what you require. This error message invalid literal for int() with base 10 would seem to indicate that you are passing a string that's not an integer to the int() function . In other words it's either empty, or has a character in it other than a digit.

You can solve this error by using Python isdigit() method to check whether the value is number or not. The returns True if all the characters are digits, otherwise False .

val = "10.10"
if val.isdigit():
  print(int(val))

The other way to overcome this issue is to wrap your code inside a Python try...except block to handle this error.

Or if you are trying to convert a float string (eg. "10.10") to an integer, simply calling float first then converting that to an int will work:

output = int(float(input))
ADD COMMENT

Login before adding your answer.

Traffic: 1423 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