evolbioinfo/gotree

Convert between (un)quoted taxon labels

tseemann opened this issue · 4 comments

Love this tool!

Noticed some tools handle quoites labels in .nwk
But other tools don't
Be good to be able to convert between them

Quoted: ('label1':0.231, ...);
Unquoted: (label1:0.231, ...);`

For the case of a label having a a space (EVIL!)
perhaps allow replacing it with underscore (_) ?

Thanks for the suggestion,

You can test gotree rename --rm-quotes and --add-quotes options in the latest v0.4.1a pre-release .

Moreover, for the spaces in node/tip names, would the following command work for you?

gotree rename -e '\s' -b '_' -i tree.nwk

Hi @tseemann ,
Can I close this issue? Could you test it?
Thanks

I had the same issue and can confirm that this worked for me when I had single quotes in my file. I do not have the latest alpha version however.

$ gotree version
v0.3.0
$ gotree rename -e "'" -b '' -i simtree.tre.bak > tmp.dnd

However I also agree with @tseemann that quoted taxa should be sort of ignored because it part of the syntax for newick. If a taxon is quoted, then the quotes are not part of the name.