stschiff / msmc2

GNU General Public License v3.0
53 stars 9 forks source link

Unexpected '.' when converting from type char[] to type ulong #35

Closed timmci closed 2 years ago

timmci commented 3 years ago

Hi Stephan,

When running MSMC2 on one chromosome I keep encountering the error: error in parsing command line: std.conv.ConvException@/home/420/tm1066/dlang/dmd-2.097.0/linux/bin64/../../src/phobos/std/conv.d(1950): Unexpected '.' when converting from type char[] to type ulong

I have inspected the multihetsep file, and no '.' characters. Would I please be able to ask for some assistance in resolving this? I've attached the multihetsep file

Thank in advance, Tim 1kGP_P3_GBR_chr11_HG00257_HG00118_HG00256_HG00145.multihetsep.txt

stschiff commented 3 years ago

Huh... OK, let me try and reproduce this.

timmci commented 3 years ago

Hi Stephen, Thanks for that, for reproducibilities sake, the command being run is:

msmc2 -t 4 -s -I 0,1,2,3,4,5,6,7 -o /output/directory/etc/ /input/directory/*.multihetsep.txt

MSMC2 manages to parse chromosome 10 fine, then fails. For other populations it runs fine. I've attached other multihetsep files to help with reproducibility.

1kGP_P3_GBR_chr11_HG00257_HG00118_HG00256_HG00145.multihetsep.txt 1kGP_P3_GBR_chr12_HG00257_HG00118_HG00256_HG00145.multihetsep.txt 1kGP_P3_GBR_chr10_HG00257_HG00118_HG00256_HG00145.multihetsep.txt

timmci commented 2 years ago

Hi Stephan,

Just following up to see whether you'd had any luck replicating this error?

Thanks, Tim

stschiff commented 2 years ago

I can't reproduce that, at least a single Expectation and Maximization step went through without a problem using the command line above. The error seems to be produced from the standard library (Phobos). Can you check whether it's reasonably up to date? I have just installed a fresh dmd using Home-brew, with version 2.098.0... you seem to have 2.097... I doubt whether that explains it, though.

When do you actually see the error? Right in the first expectation step?

timmci commented 2 years ago

Hi Stephen,

Thank you very much for trying to help me resolve this issue.

I have just installed DMD version 2.098.0 and tried to run MSMC2 again. The error still occurs. I have included the with the full output:

Loading msmc2/2.1.3
  Loading requirement: msmc-tools/2.1.3
read 231716 SNPs from file /generic/file/path/1kGP_P3_GBR_chr10_HG00257_HG00118_HG00256_HG00145.multihetsep.txt, using indices [[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3]]
read 217355 SNPs from file /generic/file/path/1kGP_P3_GBR_chr11_HG00257_HG00118_HG00256_HG00145.multihetsep.txt, using indices [[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3]]
error in parsing command line: std.conv.ConvException@/generic/file/path/dmd2/2.098.0/linux/bin64/../../src/phobos/std/conv.d(1967): Unexpected '.' when converting from type char[] to type ulong
----------------
??:? pure @safe ulong std.conv.toImpl!(ulong, char[]).toImpl(char[]) [0x566b62]
??:? pure @safe ulong std.conv.to!(ulong).to!(char[]).to(char[]) [0x5667d3]
??:? model.data.SegSite_t[][] model.data.readSegSites(immutable(char)[], ulong[2][], bool) [0x59c5ef]
??:? model.data.SegSite_t[][] msmc2.readDataFromFiles(immutable(char)[][], ulong[2][], bool) [0x5c12af]
??:? void msmc2.parseCommandLine(immutable(char)[][]) [0x5bf810]
??:? _Dmain [0x5bf15f]

The error appears to occur while reading in the file, before any expectation step.

I have noticed that the error occurs on chromosome 12, whereas the original file I shared with you was chromosome 11 (1kGP_P3_GBR_chr11_HG00257_HG00118_HG00256_HG00145.multihetsep.txt)

A chromosome 12 file where the error definitely occurs is available here: 1kGP_P3_GBR_chr12_HG00257_HG00118_HG00256_HG00145.multihetsep.txt

Apologies for this mix up. Please let me know if you are still unable to replicate it on the chromosome 12 file.

Note: I have obscured some file paths given this is a public website.

Thank you in advance, Tim.

stschiff commented 2 years ago

I could reproduce it, and indeed your input file contains a bug. Here is line 87927 in the chromosome 12 input file:

12  4.8e+07 610 TCCCCCCC

The second column needs to be an integer.