Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert between (un)quoted taxon labels #9

Open
tseemann opened this issue Aug 21, 2020 · 4 comments
Open

Convert between (un)quoted taxon labels #9

tseemann opened this issue Aug 21, 2020 · 4 comments

Comments

@tseemann
Copy link

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 (_) ?

@fredericlemoine
Copy link
Collaborator

fredericlemoine commented Aug 24, 2020

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

@fredericlemoine
Copy link
Collaborator

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

@lskatz
Copy link

lskatz commented Jan 6, 2021

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

@lskatz
Copy link

lskatz commented Jan 6, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants