czbiohub-sf / MIDAS

Metagenomic Intra-Species Diversity Analysis (MIDAS)
MIT License
35 stars 10 forks source link

error in merge snps #126

Closed sophiejwalton closed 8 months ago

sophiejwalton commented 8 months ago

I have been struggling to run merge snps on outputs of from identify snps... this is a new issue that I did not have a few months ago.. the basic error is:

Traceback (most recent call last): File "/oak/stanford/groups/dpetrov/swalton/coalescence-pilot-mgx/.snakemake/conda/ea41405f604e8eeeead2c226ac256bd0/lib/python3.8/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/oak/stanford/groups/dpetrov/swalton/coalescence-pilot-mgx/.snakemake/conda/ea41405f604e8eeeead2c226ac256bd0/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar return list(map(*args)) File "/oak/stanford/groups/dpetrov/swalton/coalescence-pilot-mgx/.snakemake/conda/ea41405f604e8eeeead2c226ac256bd0_/lib/python3.8/site-packages/midas2/subcommands/merge_snps.py", line 270, in process snps_worker(species_id, chunkid) File "/oak/stanford/groups/dpetrov/swalton/coalescence-pilot-mgx/.snakemake/conda/ea41405f604e8eeeead2c226ac256bd0/lib/python3.8/site-packages/midas2/subcommands/merge_snps.py", line 293, in snps_worker chunk_worker(chunks_of_sites[chunkid][0]) File "/oak/stanford/groups/dpetrov/swalton/coalescence-pilot-mgx/.snakemake/conda/ea41405f604e8eeeead2c226ac256bd0/lib/python3.8/site-packages/midas2/subcommands/merge_snps.py", line 345, in chunk_worker accumulate(accumulator, procargs) File "/oak/stanford/groups/dpetrov/swalton/coalescence-pilot-mgx/.snakemake/conda/ea41405f604e8eeeead2c226ac256bd0/lib/python3.8/site-packages/midas2/subcommands/merge_snps.py", line 378, in accumulate for row in select_from_tsv(stream, schema=curr_schema, selected_columns=snps_pileup_basic_schema, resultstructure=dict): File "/oak/stanford/groups/dpetrov/swalton/coalescence-pilot-mgx/.snakemake/conda/ea41405f604e8eeeead2c226ac256bd0/lib/python3.8/site-packages/midas2/common/utils.py", line 392, in select_from_tsv assert False, f"Line {i + j} has {len(values)} columns; was expecting {len(headers)}." AssertionError: Line 0 has 13 columns; was expecting 8.

Screenshot 2023-12-17 at 3 41 43 PM
zhaoc1 commented 8 months ago

Hi,

What is the verison of MIDAS2 you are using (midas2 --version).

My guess is the difference between snps_pileup_schema and snps_pileup_basic_schema (https://github.com/czbiohub-sf/MIDAS2/blob/master/midas2/params/schemas.py#L118). If you run midas2 run_snps with the --advanced option, then you also need to specify the --advanced for midas2 merge_snps.

However, I mades some changes to MIDAS2 recently, and there would be some reasons causing the error. Please let me know if you this solve the problem.

Thanks, Chunyu

sophiejwalton commented 8 months ago

the --advanced error was the issue!! thank you so much!!!

zhaoc1 commented 8 months ago

You are very welcome!