**2. Materials and Methods**

### *2.1. Insect and Tissue Collection*

The adults of *T. yunnanensis* used in this experiment were originally collected from Jiulong Mountain Forest Farm in Zhanyi County, Qujing City, Yunnan Province in June 2018. The antennae, heads, legs, and carcasses (excluding antennae, heads, and legs) of 200 pairs of male and female adults of *T. yunnanensis* were collected separately (three groups of

biological replicates). We quickly froze the collected samples with liquid nitrogen and stored them in a refrigerator at −80 ◦C. qPCR samples were treated the same way.

### *2.2. Total RNA Extraction and cDNA Synthesis*

Total RNA samples of tissues were isolated using TRIzol Reagent according to the manufacturer's protocol (Ambion, Life Technologies, Carlsbad, CA, USA). The quality of RNA was confirmed using a NanoVue UV–vis spectrophotometer (Thermo Fisher Scientific, Waltham, MA, USA), and RNA integrity was verified using a standard 1% agarose gel electrophoresis. Genomic DNA was digested by treatment with DNase I (Fermentas, Thermo Fisher Scientific, USA). First-strand cDNA was synthesized with a first strand cDNA synthesis kit (TaKaRa, Dalian, Liaoning, China). The synthesized cDNA templates were stored at −20 ◦C.

### *2.3. Library Construction, Sequencing, and Functional Annotation*

Oligosaccharide (DT)-containing magnetic beads were used to enrich the mRNAs in the total RNA of antennae, head, foot, and residue. Then, according to the protocol in NEBNext® Ultra™ RNA Library Prep Kit for llumina® (NEB, Ipswich, MA, USA), we cut them into short fragments with a fragment buffer. The first-strand cDNA was synthesized using this fragment as a template, and then the second-strand cDNA was synthesized by DNA polymerase I and RNaseH. After purification with AMPure XP beads, the second-strand cDNA was repaired, α-end ligated, and ligated with indexed adapters. The products of suitable size were selected, amplified by PCR, and purified with AMPure XP beads to establish a digital gene expression (DEG) library. Raw reads were processed through a rigorous filtering process to eliminate low-quality reads (base calling). The clean reads were then assembled using Trinity (v2.4.0) and then grouped using Corset (v1.0.5) to eliminate redundant data in the assembled transcripts. [23]. Databases used for annotation included the non-redundant nucleotide (Nt), non-redundant database (Nr), Swiss-Prot, Protein family (Pfam), Kyoto Encyclopedia of Genes and Genomes (KEGG) and Clusters of Orthologous Groups (COG/KOG). Gene ontology (GO) analysis was performed using blast2go (b2g4pipe\_v2.5) software. Nr, Swiss-Prot, and COG/KOG were analyzed by diamond v0.8.22 software, and Nt was analyzed by NCBI blast v2.2.28+; KEGG was analyzed with KAAS r140224 and Pfam was analyzed with hmmscan HMMER 3. For the DEG analysis, the resulting clean reads were then mapped to the transcriptomic unigenes using RSEM software with default parameters [24]. The differential expression of different conditions/groups (genes and samples) was analyzed by DESeq2 software. The number of read counts normalized by TMM for each mapped gene was used to calculate gene expression levels following the FPKM (fragments per kilobase of transcript sequence per millions base) method [25,26].

### *2.4. Gene Identification and Sequence Analysis*

To identify candidate detoxification genes from *T. yunnanensis*, detoxification gene families from other coleopteran species were selected as queries to search the new stand-alone transcriptome of this beetle. *Anoplophora glabripennis* Motschulsky, 1854 (Coleoptera, Lamiinae), *Lepeophtheirus salmonis* Kroyer, 1838 (Copepoda, Caligoida), *Dendroctonus ponderosne* Hopkins, 1902 (Coleoptera, Scolytidae), and *Tribolium castaneum* Herbst, 1797 (Coleoptera, Tenebrionidae) were used for CYPs; *D. ponderosae*, *A. glabripennis*, *Rhynchophorus ferrugineus* Oliver, 1790 (Coleoptera: Curculionidae), *D. armandi* and *T. castaneum* for GSTs, and *D. ponderosae*, *D. armandi*, and *T. castaneum* for CCEs (https://www.ncbi.nlm.nih.gov/ (accessed on 7 June 2021)). TBLASTN was used to search and identify candidate detoxification genes against the *T. yunnanensis* transcriptome, with an E-value cutoff of <sup>1</sup> × <sup>10</sup><sup>−</sup>5. Further, these identified genes were verified using TBLASTX against the NCBI non-redundant protein sequences database. Open reading frames (ORFs) were identified using the ORF Finder in NCBI (https://www.ncbi.nlm.nih.gov/orffinder/ (accessed on 29 June 2021)). CYP names use the CYP prefix, followed by an Arabic numeral, designates the family (all

members nominally >40% identical), a capital letter designates the subfamily (all members nominally >55% identical), and an Arabic numeral designates the individual gene or message and protein [27]. In the set of trees, a multiple sequence alignment was performed using the Muscle method in MEGA7.0 [28]. An ML tree of candidate detoxification genes was constructed by Evoliview [29]. Accession numbers of all protein sequences from other Coleoptera species used in the phylogenetic analysis are listed in Supplementary Materials.
