Let’s say you have a string of letters that needs to be alphabetized – a string of nucleotide bases, for example.
Original string: “TA”
New alphabetized string: “AT”
Code: newString = ‘’.join(sorted(myString))
Enjoy!
Binary Inspirations is a blog devoted to the latest and greatest tech items in the form of computers, gadgets, and hacks. Also featured are miscellaneous programs I've written, tips, informal hardware/software reviews, rants, tutorials, and more.
BINARY INSPIRATIONS is maintained purely out of my spare time. If you found something particularly helpful, or would just like to see more interesting content and programs, please kindly consider donating an amount of your choosing (minimum $1 requested).
Found something useful? Don't forget to leave a comment!
Let’s say you have a string of letters that needs to be alphabetized – a string of nucleotide bases, for example.
Original string: “TA”
New alphabetized string: “AT”
Code: newString = ‘’.join(sorted(myString))
Enjoy!
1 comment:
Perfect. Exactly my situation -- got a genotype file which for some strange reason has the heterozygote as both TA and AT.
Thanks!
Post a Comment