def effectiveLengthFromCigar(cigarList):
    """
	Determines the actual length of the cigar sequence relative to the reference
	Ignores leading soft-clipped bases

	Args:
		cigarList: Cigar sequence
	Returns:
		length: Length of the sequence
	"""
    if cigarList is None:
        return 0
    length = 0
    leadingSoftClipped = True
    for char in cigarList:
        if char == 'S' and leadingSoftClipped:
            continue
        if char != 'I':
            length += 1
            leadingSoftClipped = False
    return length
