def mask_left(self, n_seq_bases, mask="<STR_LIT:S>"):
cigs = list(self.items())<EOL>new_cigs = []<EOL>c, cum_len  = self.cigar, <NUM_LIT:0><EOL>for i, (l, op) in enumerate(cigs):<EOL><INDENT>if op in Cigar.read_consuming_ops:<EOL><INDENT>cum_len += l<EOL><DEDENT>if op == "<STR_LIT:H>":<EOL><INDENT>cum_len += l<EOL>new_cigs.append(cigs[i])<EOL><DEDENT>elif cum_len < n_seq_bases:<EOL><INDENT>new_cigs.append(cigs[i])<EOL><DEDENT>else:<EOL><INDENT>right_extra = cum_len - n_seq_bases<EOL>new_cigs.append((l - right_extra, '<STR_LIT:S>'))<EOL>if right_extra != <NUM_LIT:0>:<EOL><INDENT>new_cigs.append((right_extra, cigs[i][<NUM_LIT:1>]))<EOL><DEDENT><DEDENT>if cum_len >= n_seq_bases: break<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>new_cigs[:i] = [(l, op if op in "<STR_LIT>" else "<STR_LIT:S>") for l, op in<EOL>new_cigs[:i]]<EOL>new_cigs.extend(cigs[i + <NUM_LIT:1>:])<EOL>return Cigar(Cigar.string_from_elements(new_cigs)).merge_like_ops()<EOL>
Return a new cigar with cigar string where the first `n_seq_bases` are
soft-masked unless they are already hard-masked.