applied-bioinformatics / An-Introduction-To-Applied-Bioinformatics

Interactive lessons in bioinformatics.
http://readIAB.org
Other
805 stars 316 forks source link

refactor slice_sequence without type casting #252

Closed corburn closed 7 years ago

corburn commented 7 years ago

This change removes unnecessary type casting from the slice_sequence() helper function in the Local sequence alignment exercises section.

# The same result is achieved in both cases, but the second
# is simpler and only copies the sequence once.

''.join(list(sequence)[start_pos:end_pos+1])

sequence[start_pos:end_pos+1]