Biosynthesis of alkaloids derived from terpenoid and polyketide