DivyaratanPopli / Kinship_Inference

This is a tool to estimate pairwise relatedness from ancient DNA, taking in account contamination, ROH, ascertainment bias.
GNU General Public License v3.0
7 stars 1 forks source link

KINgaroo does not install correctly #19

Closed freshspaceoctopus closed 6 months ago

freshspaceoctopus commented 7 months ago

Hello, I have been trying to install KINgaroo. While KIN seems to work correctly, KINgaroo seems to not work correctly.

when typing in KINgaroo -h, I get the following Assertion error:

File "/home/user/.conda/envs/kin-3.1.3/bin/KINgaroo", line 8, in sys.exit(main.main()) File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/site-packages/KINgaroo/main.py", line 73, in main args = cli() File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/site-packages/KINgaroo/main.py", line 70, in cli return parser.parse_args() File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 1768, in parse_args args, argv = self.parse_known_args(args, namespace) File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 1800, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 2034, in _parse_knownargs self.error(('the following arguments are required: %s') % File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 2519, in error self.print_usage(_sys.stderr) File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 2489, in print_usage self._print_message(self.format_usage(), file) File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 2455, in format_usage return formatter.format_help() File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 282, in format_help help = self._root_section.format_help() File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 213, in format_help item_help = join([func(args) for func, args in self.items]) File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 213, in item_help = join([func(args) for func, args in self.items]) File "/home/user/.conda/envs/kin-3.1.3/lib/python3.8/argparse.py", line 337, in _format_usage assert ' '.join(opt_parts) == opt_usage AssertionError

I have tried reinstalling both the environment, program and package with no avail. What I don't understand is that typing in KIN -h causes no problems. Any help will be appreciated.

freshspaceoctopus commented 7 months ago

Hi, I have been searching on this topic for a while, and found a somewhat unsatisfying solution:

According to the following links, there is a bug with argparser when using metadata="" leading to errors when there are long descriptions... or maybe I am misunderstanding things...

https://github.com/swansonk14/typed-argument-parser/issues/58 https://stackoverflow.com/questions/56678636/python-argparse-assertionerror-when-running-h

I removed all the metadata="" parts in the main.py of KINgaroo, which solved the issue.

The reason that KIN does not return an error seems to be that metadata="" does not interact weird with short descriptions.

I am still confused why this is a problem to some like me, but not to other users who seem to have no such issues, but at least it is a workaround.

I am not sure if this is a good solution, but I still leave it here for others to see.

DivyaratanPopli commented 6 months ago

Hi, thanks for the suggestion, I will make the help text shorter to avoid this issue.