This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert tree confidence values to integers

Dear all, can anyone share if there is a command-line utility for UNIX that would convert bootstrap/confidence values in trees from fractions (0-1) to integers (1-100)? Keeping intact branch lengths and OTU names.
Thanks a lot in advance.

tree bootstrap confidence

Alex - thanx indeed for this advice

1 answer

If your tree file is text-formatted, you could use awk to convert fractions to percentage values, adding some logic to test for errors, e.g.:

$ echo "0.123" | awk '{ r=int(100*$0); if((r>=0)&&(r<=100)){ print r; } else { print "error"; exit(-1); } }'

Log in to answer this question.