stschiff / msmc

Implementation of the multiple sequential markovian coalescent
GNU General Public License v3.0
87 stars 20 forks source link

Unexpected 'g' when converting from type char[] to type ulong #53

Closed hyperoplus closed 1 year ago

hyperoplus commented 2 years ago

Hi,

I'm trying to run MSMC for the first time. I generated an input file from a bam based on the msmc-tools, but when I run my input I get an error (if I just run MSMC without the input, the program outputs the options as normal). This has happened on multiple machines, with different OS (Ubuntu and CentOS). I haven't found a description of this error in the forum, does anyone have any idea what could be causing this?

The input file looks like this, it's from a single genome (I'm only giving output folder and the input file to the MSMC command):

chr1    3695    91  TC
chr1    9921    10  TC
chr1    13192   382 CT
chr1    13197   5   GA
chr1    21043   3397    TC
chr1    23124   1844    CT
chr1    23733   609 CA
chr1    24820   504 GA
chr1    25394   574 GA
chr1    31690   967 TC
chr1    31823   132 AG
chr1    32364   541 GA
chr1    33041   545 TA
chr1    33479   380 CG

This is the error I get when running the precompiled binary:

error in parsing command line: std.conv.ConvException@/projects1/clusterhomes/schiffels/software/dmd2/src/phobos/std/conv.d(1720): Unexpected 'g' when converting from type char[] to type ulong
----------------
??:? pure @safe ulong std.conv.toImpl!(ulong, char[]).toImpl(char[]) [0x53c0d3]
??:? pure @safe ulong std.conv.to!(ulong).to!(char[]).to(char[]) [0x53bd5f]
??:? model.data.SegSite_t[] model.data.readSegSites(immutable(char)[], bool, ulong[], bool) [0x55258e]
??:? model.data.SegSite_t[][] msmc.readDataFromFiles(immutable(char)[][], bool, ulong[], bool) [0x597b8c]
??:? void msmc.parseCommandLine(immutable(char)[][]) [0x596133]
??:? _Dmain [0x595b43]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x5f0386]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x5f02dc]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x5f0342]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x5f02dc]
??:? _d_run_main [0x5f0239]
??:? main [0x5a16d5]
??:? __libc_start_main [0x70a7cbf6]

When I try building MSMC from source, I get a similar error:

error in parsing command line: std.conv.ConvException@/usr/include/dmd/phobos/std/conv.d(1991): Unexpected 'g' when converting from type char[] to type ulong
----------------
??:? pure @safe ulong std.conv.toImpl!(ulong, char[]).toImpl(char[]) [0x5645f3880002]
??:? pure @safe ulong std.conv.to!(ulong).to!(char[]).to(char[]) [0x5645f387fc13]
??:? model.data.SegSite_t[] model.data.readSegSites(immutable(char)[], bool, ulong[], bool) [0x5645f38ced31]
??:? model.data.SegSite_t[][] msmc.readDataFromFiles(immutable(char)[][], bool, ulong[], bool) [0x5645f38f7982]
??:? void msmc.parseCommandLine(immutable(char)[][]) [0x5645f38f56f2]
??:? _Dmain [0x5645f38f4f47]
stschiff commented 2 years ago

It says it has trouble parsing the command line. Could you please post your command line here?

hyperoplus commented 2 years ago

Hi @stschiff , here it goes:

./msmc -o testmsmc_chr1 chr1.msmc.input

Since this is my first trial, I did a single input (one chromosome), and didn't specify any other options apart from the output, as stated in the guide for more simple runs.

stschiff commented 2 years ago

I cannot reproduce this. I copied your content from your input file above into a file and then simply ran the command line you gave here. It started normally (didn't check whether it finishes, though). But definitely no command line error.

Your error doesn't quite fit the command line. It complains that it can't parse a "g" where it expects a number. But you haven't given any option and nothing with a letter g. Can you check again that the error above occurs with exactly the command line you've posted here? Doesn't seem right.

stschiff commented 2 years ago

Note that I anyway recommend MSMC2 (https://github.com/stschiff/msmc2)

hyperoplus commented 2 years ago

@stschiff Thanks for the patience in trying to troubleshoot this. I've made a screenshot showing the error appearing, both when running MSMC and MSMC2 (precompiled binaries, I also recompiled MSMC from source):

https://drive.google.com/file/d/1HqglSG3xWWhz6Va_3RJ8COmv89E71Nsr/view?usp=sharing

I've checked my installation of GSL and it appears fine, it is installed in /usr/local/lib do you think this could be a issue?

stschiff commented 2 years ago

Hmm... bizarre. Perhaps this is due to a change in the standard library of D. I will have to recompile and check on our linux cluster, perhaps I can reproduce it there.

stschiff commented 1 year ago

Still can't reproduce this with v1.1.1. I'm gonna have to close this.