This is a test version of Biostars. For the public version, visit https://www.biostars.org.
picard tools CalculateHsMetrics error

Hello, I am trying to use CalculateHsMetrics to calculate my on target coverage. I keep getting an error :

Exception in thread "main" java.lang.NumberFormatException: For input string: " 52186190 "
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

My file looks like this:

chr6     52186190    52186409    +   chr6:52186190-52186409
chr6     52186190    52186409    +   chr6:52186190-52186409
chr6     52186398    52186587    +   chr6:52186398-52186587
chr6     52186576    52186740    +   chr6:52186576-52186740
chr6     52186729    52186866    +   chr6:52186729-52186866

can someone guide what might be going wrong.

picard tools metrics

Can you please share the command you tried?

Also I wonder why there is similar entries in two lines for "52186409"? Try to remove and run.

Athul

1 answer

Your file looks improperly formed. I count 5 spaces between 'chr6' and '52186190'. Presumably, it has to be tab separated.

That's also what the error tells you: NumberFormatException " 52186190 " (note the spaces between the quotes). I assume for this reason 52186190 was not recognized as a number.

Glad my suspicion solved the issue. I have moved my comment to an answer so it can get accepted.

Log in to answer this question.