def parse(file_path, convert_neg_666=True, rid=None, cid=None, ridx=None, cidx=None,
          row_meta_only=False, col_meta_only=False, make_multiindex=False):
    if file_path.endswith(".gct"):
        out = parse_gct.parse(file_path, convert_neg_666=convert_neg_666,
                              rid=rid, cid=cid, ridx=ridx, cidx=cidx,
                              row_meta_only=row_meta_only, col_meta_only=col_meta_only,
                              make_multiindex=make_multiindex)
    elif file_path.endswith(".gctx"):
        out = parse_gctx.parse(file_path, convert_neg_666=convert_neg_666,
                              rid=rid, cid=cid, ridx=ridx, cidx=cidx,
                              row_meta_only=row_meta_only, col_meta_only=col_meta_only,
                              make_multiindex=make_multiindex)
    else:
        err_msg = "File to parse must be .gct or .gctx!"
        logger.error(err_msg)
        raise Exception(err_msg)
    return out