ekirving / qpbrute

Heuristic search algorithm for fitting qpGraph models
MIT License
9 stars 3 forks source link

RuntimeError: fatalx: can't find root #8

Closed dbssyck closed 4 years ago

dbssyck commented 4 years ago

Dear Evan,

I am encountering the following error when attempting to run qpbrute.py on my dataset.

INFO: Starting list ['R', 'M', 'S', 'G']
Traceback (most recent call last):
  File "qpbrute.py", line 711, in <module>
    print_offset=argv.print_offset)
  File "qpbrute.py", line 663, in permute_qpgraph
    pq.find_graph()
  File "qpbrute.py", line 615, in find_graph
    self.recurse_tree(root_tree, self.nodes[1], self.nodes[2:])
  File "qpbrute.py", line 101, in recurse_tree
    results = self.test_trees(new_trees, depth)
  File "qpbrute.py", line 169, in test_trees
    results = pool.map(self.run_qpgraph, itertools.izip(new_trees, itertools.repeat(depth)))
  File "/home/user/anaconda3/envs/qpbrute/lib/python2.7/site-packages/pathos/multiprocessing.py", line 137, in map
    return _pool.map(star(f), zip(*args)) # chunksize
  File "/home/user/anaconda3/envs/qpbrute/lib/python2.7/site-packages/multiprocess/pool.py", line 253, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/home/user/anaconda3/envs/qpbrute/lib/python2.7/site-packages/multiprocess/pool.py", line 572, in get
    raise self._value
RuntimeError: fatalx:
can't find root

The dataset that I am working on has a total of seven samples - two unambiguous outgroups and five ingroups, each from a separate population. I am assuming that the problem is in finding the root and have attempted including other samples that serve as further outgroups (and consequently making the two unambiguous outgroups part of the ingroups), but the rooting issue still persists.

May I know what a possible cause and solution to this problem could be?

Thank you very much in advance!

ekirving commented 4 years ago

Hi dbssyck, can you please post the command you are using to run qpbrute?

dbssyck commented 4 years ago

The commands were as follows

cd /path/to/qpbrute python qpbrute.py \ --par admixgraph.par \ -- prefix angsd_2_RMSG \ --pops R M S G \ --out Out \

admixgraph.par included the input files and parameters similar to the example sim1.par.

Edit: I am unsure if the following information is directly relevant to the issue but qpbrute was able to run without the RuntimeError: fatalx: can't find root problem for this same dataset when I assigned my samples to two populations only. However, with 0 unique graphs.

ekirving commented 4 years ago

Are you sure that there is a population labeled Out in your data?

The error you reported is coming from inside qpGraph and my best guess is that it's because this population label is missing.

If this is not the case, can you please post the .par and .ind files, as well as the full .log file from qpBrute?

dbssyck commented 4 years ago

Yes, the data has an Outpopulation. I'm not quite sure it's a result of missing label because when I assign my samples to just two populations with the same Outgroups, the program runs (seen in the (no-error).ind file and accompanying.log).

github_error_1.zip

ekirving commented 4 years ago

Ah, I can see what the problem is now! You have a population called R which is the name given to the root node in the generated graph files.

I have pushed a small fix which checks for this condition and outputs an error message.

If you rename this population to anything other than 'R' then it should work fine.

dbssyck commented 4 years ago

It runs well now, thanks so much for the help!