Dissecting mutational mechanisms underpinning signatures caused by replication errors and endogenous DNA damage