def trim_record(read, trim_at): new_read = Record() new_read.name = read.name new_read.sequence = read.sequence[:trim_at] if hasattr(read, 'quality'): new_read.quality = read.quality[:trim_at] return new_read
def trim_record(read, trim_at): "Utility function: create a new record, trimmed at given location." new_read = Record() new_read.name = read.name new_read.sequence = read.sequence[:trim_at] if hasattr(read, 'quality'): new_read.quality = read.quality[:trim_at] return new_read