NA/NaN/Inf in foreign function call (arg 6) error when running ancestral reconstruction script

877 views
Skip to first unread message

Seven32

unread,
Jul 2, 2017, 9:43:15 AM7/2/17
to picrust-users
Hello,

I am looking for a help - I tried to calculate ancestral states for a simple example tree and trait table, but get the following error:

$ ./scripts/ancestral_state_reconstruction.py -t ./my/formated/pruned_tree.new -i ./my/formated/trait_table.tab -o ./my/anc.out

Traceback (most recent call last):

  File "./scripts/ancestral_state_reconstruction.py", line 91, in <module>

    main()

  File "./scripts/ancestral_state_reconstruction.py", line 74, in main

    asr_table,ci_table = ace_for_picrust(opts.input_tree_fp,opts.input_trait_table_fp,'pic',HALT_EXEC=opts.debug)

  File "/usr/local/lib/python2.7/site-packages/picrust/ace.py", line 95, in ace_for_picrust

    " %s" % "\n".join(result["StdErr"].readlines()))

RuntimeError: R reported an error on stderr: Warning message:


package ‘ape’ was built under R version 3.3.2 


Error in FUN(newX[, i], ...) : 


  NA/NaN/Inf in foreign function call (arg 6)


Calls: apply -> FUN -> .C


Execution halted



The tree and trait table files are attached.
Thank you in advance,
Seven32
pruned_tree.new
trait_table.tab

Gavin Douglas

unread,
Jul 4, 2017, 8:44:19 AM7/4/17
to picrus...@googlegroups.com
Hey there,

You’ll need to run format_tree_and_trait_table.py first, as described in the genome prediction workflow: http://picrust.github.io/picrust/tutorials/genome_prediction.html#formatting-tree-and-trait-tables 

I think the issue is that you’re using a tree to predict the internal nodes that has missing tip trait values.

The ancestral_state_reconstruction.py script runs ASR to predict all internal nodes, which are then used by predict_traits.py to predict the missing tip traits.


Best,

Gavin

-- 
You received this message because you are subscribed to the Google Groups "picrust-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picrust-user...@googlegroups.com.
To post to this group, send email to picrus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<pruned_tree.new><trait_table.tab>

Seven32

unread,
Jul 17, 2017, 8:26:27 AM7/17/17
to picrust-users
Thank you for your reply.
But I did formatting by format_tree_and_trait_table.py, so I guess this should be another reason.
Could you check my attached files?

Gavin Douglas

unread,
Jul 17, 2017, 10:36:05 AM7/17/17
to picrus...@googlegroups.com
Is it possible that you ran format_tree_and_trait_table.py with a different trait table the first time? You will need to re-run it separately each time.

If you run:
format_tree_and_trait_table.py -t pruned_tree.new -i trait_table.tab

You will see that the new “pruned_tree.new” (in the “formatted” directory by default) no longer contains the tips found in trait_table.tab.


Cheers,

Gavin
Reply all
Reply to author
Forward
0 new messages