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

split tip name on delimiter #5

Open
giacomomutti opened this issue Nov 22, 2024 · 2 comments
Open

split tip name on delimiter #5

giacomomutti opened this issue Nov 22, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@giacomomutti
Copy link

Hello! thanks for the very useful tool.

I have a question. From my understanding the -d and -n argument of disco.py are used to map genes name to species names (for example if my trees had the format gene1_human, I would use -d'_' -n1). However this does not work.

I checked and it is because of this line:
gene_to_species = lambda x : args.delimiter.join(x.split(args.delimiter)[:args.nth_delimiter])

which, according to my logic, should simply be:
gene_to_species = lambda x : x.split(args.delimiter)[args.nth_delimiter]

Is it a bug or I did not understand properly the two arguments? Thank you very much!

@JSdoubleL
Copy link
Owner

Yeah, it works as intended. It simply splits on the nth delimiter, then takes everything preceding that split as the species label. I forget exactly why I implemented it this way; I think I may have ran into a dataset where this was necessary for some reason.

It occurs to me though that there really isn't a way to extract a species name from the middle or end of a label, so I should probably address this. I should also probably update the README to be more clear.

@JSdoubleL JSdoubleL self-assigned this Dec 6, 2024
@JSdoubleL JSdoubleL added the enhancement New feature or request label Dec 6, 2024
@giacomomutti
Copy link
Author

Great, thanks!

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

No branches or pull requests

2 participants