No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
2 Posted Topics
Hi Guys, Can anyone help me redo this, so it'll be a list comprehension instead? def parseAnnotation(annotation): ExonStartAndStop = [] d = annotation.split(',') for i in d: removeparenteses = i[1:-1] numbers = removeparenteses.split('..') ExonStartAndStop.append((int(numbers[0]),int(numbers[1]))) return ExonStartAndStop example usage: print parseAnnotation('(1834..2736)') ---> [(1834, 2736)) | |
Hi friends! I need to make a function which takes a string, e.g: '(239..247),(467..765)' (corresponding to the coding area of DNA sequence) and return a list with a tuple for each coding part, each with a start and end value. e.g. [(239,247),(267,765)]. Someone has a clue how to start up? |
The End.