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 2 forks source link

error about 'KINgaroo -h' #3

Closed Pudding-Q closed 1 year ago

Pudding-Q commented 1 year ago

Dear professor: The KINgaroo has been installed with 'pip3 install /home/software/Kinship_Inference-main/pypackage/kingaroo', however when I run 'KINgaroo -h',the command line shows that:

'Traceback (most recent call last): File "/home/miniconda3/envs/DNAtest/bin/KINgaroo", line 8, in sys.exit(main.main()) File "/home/miniconda3/envs/DNAtest/lib/python3.8/site-packages/KINgaroo/main.py", line 64, in main args = cli() File "/home/miniconda3/envs/DNAtest/lib/python3.8/site-packages/KINgaroo/main.py", line 61, in cli return parser.parse_args() File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 1768, in parse_args args, argv = self.parse_known_args(args, namespace) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 1800, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 2006, in _parse_known_args start_index = consume_optional(start_index) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 1946, in consume_optional take_action(action, args, option_string) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 1874, in take_action action(self, namespace, argument_values, option_string) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 1044, in call parser.print_help() File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 2494, in print_help self._print_message(self.format_help(), file) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 2478, in format_help return formatter.format_help() File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 282, in format_help help = self._root_section.format_help() File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 213, in format_help item_help = join([func(args) for func, args in self.items]) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 213, in item_help = join([func(args) for func, args in self.items]) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 337, in _format_usage assert ' '.join(opt_parts) == opt_usage AssertionError'

Could you please tell me how to deal with it? Thank you very much!

DivyaratanPopli commented 1 year ago

Hi, can you type only "KINgaroo" on the terminal, and tell me what you get?

Pudding-Q commented 1 year ago

When I type "KINgaroo" only , it shows that: "Traceback (most recent call last): File "/home/miniconda3/envs/DNAtest/bin/KINgaroo", line 8, in sys.exit(main.main()) File "/home/miniconda3/envs/DNAtest/lib/python3.8/site-packages/KINgaroo/main.py", line 64, in main args = cli() File "/home/miniconda3/envs/DNAtest/lib/python3.8/site-packages/KINgaroo/main.py", line 61, in cli return parser.parse_args() File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 1768, in parse_args args, argv = self.parse_known_args(args, namespace) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 1800, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 2034, in _parse_knownargs self.error(('the following arguments are required: %s') % File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 2519, in error self.print_usage(_sys.stderr) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 2489, in print_usage self._print_message(self.format_usage(), file) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 2455, in format_usage return formatter.format_help() File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 282, in format_help help = self._root_section.format_help() File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 213, in format_help item_help = join([func(args) for func, args in self.items]) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 213, in item_help = join([func(args) for func, args in self.items]) File "/home/miniconda3/envs/DNAtest/lib/python3.8/argparse.py", line 337, in _format_usage assert ' '.join(opt_parts) == opt_usage AssertionError"

DivyaratanPopli commented 1 year ago

OK so it gives the same error related to argparse. Can you send me the messages printed on the screen when you install KINgaroo?

Pudding-Q commented 1 year ago

Hi,I have been successfully built KINgaroo with "pip3 install /data/home/qyouyang/software/Kinship_Inference-main/pypackage/kingaroo".When I install KINgaroo,the messages are as follows:(as .png1) 1

When I type "KINgaroo -h",it shows :(as .png2) 2

However,when I try to run the software with "KINgaroo -bam bamRawdata/ -bed bedfile.bed -T targets.txt -cnt 0",there is still some error :(as .png3-5) 3 4 5

DivyaratanPopli commented 1 year ago

Hi, it looks like the script is unable to create files. Usually this this happens when the input files are not in correct format. Can you go through README.md (https://github.com/DivyaratanPopli/Kinship_Inference/blob/main/README.md) and check that your input files are in the correct form, you can compare them to the example files shown in README.md.

Pudding-Q commented 1 year ago

Hi,I have checked the format according to the README.md. But I have no idea about the error.Here are the screenshots of the input files: bam: 1

bedfile.bed: 2

targets.txt 3

By the way, we don't have "bam-rmdup"(Kinship_Inference/KINgaroo_snakemake_version/Snakefile) in our server. Do you think installing biohazard-tools(https://github.com/mpieva/biohazard-tools) would help solve this problem?

DivyaratanPopli commented 1 year ago

Hi, You are right that bam-rmdup may be causing this problem. I have now removed this function. Can you clone the repository again, and reinstall kingaroo?

In case it still gives you a problem, you can run a test as: KINgaroo -bam bamfiles/ -bed bedfile.bed -T targets.txt -cnt 0 -test 1 It will print a message that files are OK, if it can read the input files, and also write some output files.

Pudding-Q commented 1 year ago

Hi, I clone the new repository "Kinship_Inference-main-2", and reinstall kingaroo. The error I met the day before yesterday shows again: 1 2 Then, I run a test as you suggested,it shows that the input files are OK. I have checked other output files and found no problems 截屏2022-09-02 15 59 18 6

While I try to run the the software , another error occurred:

4 5

DivyaratanPopli commented 1 year ago

Hi, so at least the scripts are running now, and error is from an internal function. I have included a print statement in this function so I can see what the problem is. Can you clone the repository again and run it, and tell me what is printed on the screen before the error? Also, it is strange that KINgaroo -h gives you error. Are you using the conda environment as described in the README.md?

Pudding-Q commented 1 year ago

Hi,I created the conda environment by "conda create -n my_conda_env python=3.8 scipy=1.8.0 numpy=1.21.1 pandas=1.3.1 numba=0.55.1 pysam=0.19.0 pybedtools=0.9.0".In this way ,I have successfully installed ”Kinship_Inferenc-main“,but there was a problem about "bam-rmdup". And now, I clone the new repository,run it by:“KINgaroo -bam BAM-q30/ -bed bedfile.bed -T targets.txt -cnt 0”.Here is the message printed on the screen before the error: 截屏2022-09-06 13 55 52

DivyaratanPopli commented 1 year ago

Hi, are you using only one chromosome? It looks like the script is complaining because your bamfiles do not have any data. Can you try with all chromosomes? You mentioned in your initial message that KINgaroo -h does not work, but it worked fine later (as .png2). What did you change to make it work? It must be some change in local environment.