<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loadFeatures(path, opt):
 """ Load features. For BED, only BED4 columns are loaded. For narrowPeak, all columns are loaded. """


    log.info("loading from %s ..." % path)
    data = []
    if opt.in_format == "BED":        
        with open(path) as fd:
            for line in fd:
                cols = line.split()
                data.append( (cols[0], int(cols[1]), int(cols[2]), cols[3]) )
        data = np.array(data, dtype=elem_t)
    else:
        with open(path) as fd:
            for line in fd:
                cols = line.split()
                data.append( (cols[0], int(cols[1]), int(cols[2]), cols[3], int(cols[4]),
                              cols[5], float(cols[6]), float(cols[7]), float(cols[8]),
                              int(cols[-1])+int(cols[1])) )
        data = np.array(data, dtype=narrowPeak_t)
    return data