Currently, most gene prediction methods detect coding sequences (CDSs) from transcriptome assembly when lacking of closely related reference genomes. However, these methods are of limited application due to highly fragmented transcripts and extensive assembly errors, which may lead to redundant or false CDS predictions. Here we present a novel algorithm, inGAP-CDG, for effective construction of full-length and non-redundant CDSs from unassembled transcriptomes. inGAP-CDG achieves this by combining a newly developed codon-based de bruijn graph to simplify the assembly process and a machine learning based approach to filter false positives. Compared with other methods, inGAP-CDG exhibits significantly increased predicted CDS length and robustness to sequencing errors and varied read length. These advantages greatly facilitate downstream genomic analyses, including phylogenetic tree and gene model construction, which will improve our ability to explore the functional potential of novel species.