-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
hi, many thanks for developing this cool method!
I ran parallel_singer per chromosome, & the output files look like the ARG generation was successful:
aw_n82_38_0_1_start_nodes_0.txt
aw_n82_38_0_1_start_branches_0.txt
aw_n82_38_0_1_start_recombs_0.txt
aw_n82_38_0_1_start_muts_0.txt
aw_n82_38_0_1_nodes_0.txt
aw_n82_38_0_1_branches_0.txt
aw_n82_38_0_1_recombs_0.txt
aw_n82_38_0_1_muts_0.txt
But I am having some issues converting the output format to tskit trees, I tried using convert_to_tskit & convert_long_ARG.py
- using convert_to_tskit, gives an error I guess because it doesn't expect per window outputs (prefix_0_1_nodes_0.txt instead of prefix_nodes_0.txt)
ID=38
input="aw_n82_${ID}"
outp="trees/aw_n82_${ID}"
convert_to_tskit \
> -input ${input} \
> -output ${outp} \
> -start 0 \
> -end 99
Traceback (most recent call last):
File "convert_to_tskit", line 98, in <module>
main()
~~~~^^
File "convert_to_tskit", line 95, in main
write_trees(args.input, args.output, args.start, args.end, args.step)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "convert_to_tskit", line 64, in write_trees
ts = read_ARG(node_file, branch_file, mutation_file)
File "convert_to_tskit", line 52, in read_ARG
tables = read_ts(node_file, branch_file)
File "convert_to_tskit", line 10, in read_ts
node_time = np.loadtxt(node_file)
File "/home/xcj768/miniforge3/envs/tskit-env/lib/python3.14/site-packages/numpy/lib/_npyio_impl.py", line 1384, in loadtxt
arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
converters=converters, skiplines=skiprows, usecols=usecols,
unpack=unpack, ndmin=ndmin, encoding=encoding,
max_rows=max_rows, quote=quotechar)
File "/home/xcj768/miniforge3/envs/tskit-env/lib/python3.14/site-packages/numpy/lib/_npyio_impl.py", line 1011, in _read
fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
File "/home/xcj768/miniforge3/envs/tskit-env/lib/python3.14/site-packages/numpy/lib/_datasource.py", line 192, in open
return ds.open(path, mode, encoding=encoding, newline=newline)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xcj768/miniforge3/envs/tskit-env/lib/python3.14/site-packages/numpy/lib/_datasource.py", line 529, in open
raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: aw_n82_38_nodes_0.txt not found.
- using convert_long_ARG.py following Understanding parallel singer errror #21, gives error - mutation's parent is not consistent with the topology
python convert_long_ARG.py \
> -vcf ../../input/aw_n82_38 \
> -output aw_n82_38 \
> -iteration 0
Processing segment 0
Processing segment 1
Processing segment 2
Processing segment 3
Processing segment 4
Processing segment 5
Processing segment 6
Processing segment 7
Processing segment 8
Processing segment 9
Processing segment 10
Processing segment 11
Processing segment 12
Processing segment 13
Processing segment 14
Processing segment 15
Processing segment 16
Processing segment 17
Processing segment 18
Processing segment 19
Processing segment 20
Processing segment 21
Processing segment 22
Processing segment 23
Traceback (most recent call last):
File "convert_long_ARG.py", line 118, in <module>
main()
~~~~^^
File "convert_long_ARG.py", line 114, in main
ts = read_long_ARG(node_files, branch_files, mutation_files, block_coordinates)
File "convert_long_ARG.py", line 74, in read_long_ARG
ts = tables.tree_sequence()
File "/home/xcj768/miniforge3/envs/tskit-env/lib/python3.14/site-packages/tskit/tables.py", line 3528, in tree_sequence
return tskit.TreeSequence.load_tables(self)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/xcj768/miniforge3/envs/tskit-env/lib/python3.14/site-packages/tskit/trees.py", line 4295, in load_tables
ts.load_tables(tables._ll_tables, build_indexes=build_indexes)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tskit.LibraryError: A mutation's parent is not consistent with the topology of the tree. Use compute_mutation_parents to set the parents correctly.(TSK_ERR_BAD_MUTATION_PARENT)
Which of the two conversion methods would you recommend for the parallel_singer output convert_to_tskit or convert_long_ARG.py? And your input on how to fix the errors is much appreciated!
Metadata
Metadata
Assignees
Labels
No labels