omu_anova error: row names supplied are of the wrong length

omu_anova error: row names supplied are of the wrong length

我正在尝试使用 omu 包中的 omu_anova 函数来获取一组代谢组学数据。我的代码如下,

metab_anova <- omu_anova(count_data = metab9, metadata = metabmeta4, 
                         response_variable = "Metabolite", 
                         var1 = "tertiles", var2 = "Race", 
                         interaction = TRUE, log_transform = TRUE, p_adjust = "BH")

其中 metab9 是我的代谢物计数 table,其中 17 列标记为:代谢物、KEGG,然后是 15 个样本列。 metabmeta4 是我的元数据数据框,有 4 列,其中一列标记为 Sample 并且有 15 个值与计数 table.

中的 15 个列名称匹配

当我 运行 函数时,我收到此警告和错误:

Warning in data.frame(..., check.names = FALSE) : row names were found from a short variable and have been discarded Error in data.frame(lapply(data_Transpose[, nums], function(x) as.numeric(as.integer(x))), : row names supplied are of the wrong length

我仔细检查了计数数据中的列和元数据样本列中的值是否匹配,并使用 duplicated() 函数查看是否有任何重复。 dput(metab9$Metabolite) 的结果是

dput(metab9$Metabolite)
c("10-HYDROXYDECANOATE [M-H]", "1-AMINOCYCLOPROPANECARBOXYLATE [M-H]", 
"1-METHYL-L-HISTIDINE [M+H]", "1-METHYL-L-HISTIDINE [M+Na]", 
"1-METHYL-L-HISTIDINE [M-H]", "2',4'-DIHYDROXYACETOPHENONE [M+H]", 
"2-AMINOISOBUTYRATE [M+H]", "2-AMINOISOBUTYRATE [M-H]", "2-DEOXY-D-GLUCOSE [M-H]", 
"2-HYDROXY-4-(METHYLTHIO)BUTANOATE [M-H]", "2-HYDROXYBUTYRATE [M-H]", 
"2-HYDROXYBUTYRATE [M-H2O-H]", "2-HYDROXYPHENYLACETATE [M+H]", 
"2-HYDROXYPHENYLACETATE [M-H]", "2-METHYLBUTANAL [M+NH4+]", "2-OXOADIPATE [M-H]", 
"3-(2-HYDROXYPHENYL)PROPANOATE [M-H]", "3,4-DIHYDROXYPHENYLGLYCOL [M-H2O-H]", 
"3-HYDROXYBUTANOATE [M-H]", "3-HYDROXYMETHYLGLUTARATE [M-H]", 
"3-METHOXY-4-HYDROXYMANDELATE [M-H]", "4-ACETAMIDOBUTANOATE [M+H]", 
"4-HYDROXY-3-METHOXYPHENYLGLYCOL [M-H2O-H]", "4-HYDROXYBENZOATE [M-H]", 
"4-PYRIDOXATE [M-H]", "5-AMINOLEVULINATE [M-H]", "ACETOIN [M-H]", 
"ALPHA-D-GLUCOSE [M-H2O-H]", "ALPHA-HYDROXYISOBUTYRATE [M-H]", 
"ALPHA-HYDROXYISOBUTYRATE [M-H2O-H]", "ALPHA-TOCOPHEROL [M-H]", 
"AMINOADIPATE [M+H]", "AMINOADIPATE [M-H]", "AMINOISOBUTANOATE [M+H]", 
"ANSERINE [M+H]", "ARABITOL [M-H]", "ARACHIDATE [M-H]", "ASPARAGINE [M+2Na-H]", 
"ASPARAGINE [M+H]", "ASPARAGINE [M+Na]", "ASPARAGINE [M+Na-2H]", 
"ASPARAGINE [M-H]", "ASPARAGINE [M-H2O-H]", "ASPARTATE [M+H]", 
"ASPARTATE [M-H]", "BETAINE [M+H]", "BETAINE [M+Na]", "BETAINE [M-H]", 
"Bile Acid_b-Muricholic Acid [M-H]", "Bile Acid_b-Muricholic Acid [M-H+Acetate]", 
"Bile Acid_Cholic Acid [M-H+Acetate]", "Bile Acid_Glycochenodeoxycholic Acid [M-H]", 
"Bile Acid_Glycodeoxycholic Acid [M-H]", "Bile Acid_Glycoursodeoxycholic Acid [M-H]", 
"Bile Acid_Taurocholic Acid [M-H]", "Bile Acid_Ursodeoxycholic acid [M-H]", 
"Bile Acid_Ursodeoxycholic acid [M-H+Acetate]", "BILIRUBIN [M+H]", 
"BILIRUBIN [M-H]", "BILIVERDIN [M+H]", "BIOTIN [M+H]", "BIS(2-ETHYLHEXYL)PHTHALATE [M+H]", 
"BIS(2-ETHYLHEXYL)PHTHALATE [M+Na]", "CAPRYLATE [M-H]", "CHENODEOXYCHOLATE [M-H]", 
"CHOLATE [M+NH4+]", "CHOLATE [M-H]", "CITRATE [M-H]", "CITRULLINE [M+2Na-H]", 
"CITRULLINE [M+H]", "CITRULLINE [M+Na]", "CITRULLINE [M+Na-2H]", 
"CITRULLINE [M-H]", "CITRULLINE [M-NH3+H]", "CORTISOL [M-H]", 
"CREATINE [M+H]", "CREATINE [M+Na]", "CREATINE [M+Na-2H]", "CREATINE [M-H]", 
"CREATININE [M+H]", "CREATININE [M+Na]", "CREATININE [M-H]", 
"CYTIDINE [M-H]", "CYTOSINE [M+H]", "DECANOATE [M-H]", "DEHYDROASCORBATE [M-H]", 
"DEOXYCARNITINE [M+H]", "DIACETYL [M-H]", "DIDECANOYL-GLYCEROPHOSPHOCHOLINE [M+Na]", 
"D-MANNOSAMINE [M+H]", "DOCOSAHEXAENOATE [M-H]", "Docosanoid_19,20-EpDPA [M-H]", 
"D-ORNITHINE [M+H]", "D-ORNITHINE [M-H]", "D-ORNITHINE [M-H2O+H]", 
"EIC_1", "EIC_103", "EIC_105", "EIC_106", "EIC_11", "EIC_111", 
"EIC_120", "EIC_122", "EIC_124", "EIC_125", "EIC_128", "EIC_129", 
"EIC_13", "EIC_131", "EIC_132", "EIC_133", "EIC_140", "EIC_146", 
"EIC_149", "EIC_15", "EIC_161", "EIC_177", "EIC_180", "EIC_189", 
"EIC_191", "EIC_2", "EIC_215", "EIC_22", "EIC_220", "EIC_228", 
"EIC_23", "EIC_237", "EIC_24", "EIC_25", "EIC_26", "EIC_27", 
"EIC_28", "EIC_31", "EIC_33", "EIC_345", "EIC_352", "EIC_46", 
"EIC_62", "EIC_7", "EIC_71", "EIC_72", "EIC_73", "EIC_74", "EIC_77", 
"EIC_78", "EIC_79", "EIC_80", "EIC_89", "Eicosanoid_11,12-EET [M-H]", 
"Eicosanoid_11-HETE [M-H+Acetate]", "Eicosanoid_11t LTD4 [M-H]", 
"Eicosanoid_12,13 diHOME [M-H]", "Eicosanoid_12-HETE [M-H+Acetate]", 
"Eicosanoid_12-HHTrE [M-H]", "Eicosanoid_12-OPDA [M-H+Acetate]", 
"Eicosanoid_12oxo LTB4 [M-H]", "Eicosanoid_12-oxoETE [M-H]", 
"Eicosanoid_12S-HpEPE [M-H]", "Eicosanoid_13,14-dihydro-15-keto-PGA2 [M-H]", 
"Eicosanoid_13,14-dihydro-PGE1 [M-H]", "Eicosanoid_13-HODE [M-H]", 
"Eicosanoid_13-oxoODE [M-H]", "Eicosanoid_13-oxoODE [M-H+Acetate]", 
"Eicosanoid_14,15-diHETrE [M-H]", "Eicosanoid_15d PGA2 [M-H]", 
"Eicosanoid_15-epi-PGA1 [M-H+Acetate]", "Eicosanoid_15-HETE [M-H]", 
"Eicosanoid_15-keto-PGA1 [M-H+Acetate]", "Eicosanoid_15-oxoETE [M-H]", 
"Eicosanoid_17(18) EpETE [M-H+Acetate]", "Eicosanoid_19,20 DiHDPA [M-H]", 
"Eicosanoid_20cooh AA [M-H]", "Eicosanoid_5(S) HETrE [M-H]", 
"Eicosanoid_5(S) HETrE [M-H+Acetate]", "Eicosanoid_5,15-diHETE [M-H]", 
"Eicosanoid_5S-HpEPE [M-H]", "Eicosanoid_5S-HpETE [M-H]", "Eicosanoid_6,15 dk-,dh- PGF1a [M-H]", 
"Eicosanoid_8(9)-EpETE [M-H]", "Eicosanoid_8(S) HETrE [M-H]", 
"Eicosanoid_8,12-iso-iPF2à-VI-1,5-lactone [M-H+Acetate]", "Eicosanoid_8,15-diHETE [M-H+Acetate]", 
"Eicosanoid_8-HETE [M-H]", "Eicosanoid_8-iso-PGA1 [M-H]", "Eicosanoid_8-iso-PGA1 [M-H+Acetate]", 
"Eicosanoid_9(S) HOTrE [M-H]", "Eicosanoid_9,10 diHOME [M-H]", 
"Eicosanoid_Arachidonic Acid [M-H]", "Eicosanoid_DHA [M-H]", 
"Eicosanoid_dhk PGF2a [M-H]", "Eicosanoid_EPA [M-H]", "Eicosanoid_HXB3 [M-H]", 
"Eicosanoid_HXB3 [M-H+Acetate]", "Eicosanoid_PGK1 [M-H+Acetate]", 
"Eicosanoid_tetranor 12(R) HETE [M-H+Acetate]", "ELAIDATE [M-H]", 
"Endocannabinoid_2-Arachidonyl glycerol ether [M-H+Acetate]", 
"Endocannabinoid_D-erythro-Sphingosine C-18 [M-H+Acetate]", "Endocannabinoid_N-oleoyl Dopamine [M-H]", 
"Endocannabinoid_Oleoyl Ethanolamide  [M-H+Acetate]", "ERYTHRITOL [M-H]", 
"ESTRADIOL-17ALPHA [M-H2O+H]", "ETHYL 3-INDOLEACETATE [M-H]", 
"ETHYLMALONATE [M+Na-2H]", "FAHFA_11", "FAHFA_12", "FAHFA_14", 
"FAHFA_15", "FAHFA_18", "FAHFA_22", "FAHFA_25", "FAHFA_27", "FAHFA_28", 
"FAHFA_3", "FAHFA_37", "FAHFA_39", "FAHFA_57", "FAHFA_58", "FAHFA_62", 
"FAHFA_69", "FFA_Adrenic Acid  [M-H]", "FFA_Adrenic Acid  [M-H+Acetate]", 
"FFA_a-linolenic Acid  [M-H]", "FFA_a-linolenic Acid  [M-H+Acetate]", 
"FFA_Arachidic Acid  [M-H]", "FFA_Arachidic Acid  [M-H+Acetate]", 
"FFA_Arachidonic Acid  [M-H]", "FFA_Behenic Acid  [M-H]", "FFA_Behenic Acid  [M-H+Acetate]", 
"FFA_Dihomo-g-linolenic  [M-H+Acetate]", "FFA_Docosadienoic Acid  [M-H]", 
"FFA_Docosaenoic Acid  [M-H]", "FFA_Docosapentaenoic Acid  [M-H]", 
"FFA_Docosatrienoic Acid  [M-H]", "FFA_Docosatrienoic Acid  [M-H+Acetate]", 
"FFA_Eicosadienoic Acid  [M-H]", "FFA_Eicosadienoic Acid  [M-H+Acetate]", 
"FFA_Eicosapentaenoic Acid  [M-H]", "FFA_Eicosapentaenoic Acid  [M-H+Acetate]", 
"FFA_Eicosatrienoic Acid  [M-H]", "FFA_Eicosenoic Acid [M-H+Acetate]", 
"FFA_Gondolic Acid [M-H]", "FFA_Gondolic Acid [M-H+Acetate]", 
"FFA_Heptadecaenoic Acid  [M-H]", "FFA_Heptadecaenoic Acid  [M-H+Acetate]", 
"FFA_Heptadecanoic Acid  [M-H]", "FFA_Lignoceric Acid  [M-H]", 
"FFA_Linoleic Acid  [M-H]", "FFA_Myristic Acid [M-H]", "FFA_Myristic Acid [M-H+Acetate]", 
"FFA_Nervonic Acid  [M-H]", "FFA_Oleic Acid  [M-H+Acetate]", 
"FFA_Palmitoleic Acid  [M-H]", "FFA_Palmitoleic Acid  [M-H+Acetate]", 
"FFA_Pentadecanoic Acid  [M-H]", "FFA_Petroselenic Acid [M-H]", 
"FFA_Petroselenic Acid [M-H+Acetate]", "FFA_Stearic Acid  [M-H+Acetate]", 
"FFA_Stearidonic Acid [M-H]", "FFA_Tricosanoic Acid  [M-H]", 
"FFA_Tricosenoic Acid [M-H]", "FUMARATE [M-H]", "GALACTURONATE [M-H]", 
"GAMMA-AMINOBUTYRATE [M-H]", "GLUCONATE [M+Na-2H]", "GLUCONATE [M-H]", 
"GLUTAMATE [M+2Na-H]", "GLUTAMATE [M+H]", "GLUTAMATE [M+Na-2H]", 
"GLUTAMATE [M-H]", "GLUTAMATE [M-H2O-H]", "GLUTAMINE (13C5 STABLE ISOTOPE) [M+H]", 
"GLUTAMINE (13C5 STABLE ISOTOPE) [M-H]", "GLUTAMINE [M+2Na-H]", 
"GLUTAMINE [M+H]", "GLUTAMINE [M+Na]", "GLUTAMINE [M+Na-2H]", 
"GLUTAMINE [M-H]", "GLUTAMINE [M-H2O-H]", "GLUTAMINE [M-NH3+H]", 
"GLYCEROL [M-H]", "GLYCOCHOLATE [M+H]", "GLYCOCHOLATE [M-H]", 
"GLYCOLATE [M-H]", "GUANIDINOACETATE [M+H]", "GUANIDINOACETATE [M-H]", 
"GUANINE [M+H]", "GUANOSINE [M+H]", "HEPTADECANOATE [M-H]", "HEPTANOATE [M-H]", 
"HIPPURATE [M+H]", "HIPPURATE [M-H]", "HIPPURATE [M-H2O-H]", 
"HISTIDINE [M+Na-2H]", "HOMOSERINE [M+H]", "HYDROXYKYNURENINE [M-H]", 
"HYDROXYPHENYLLACTATE [M+Na-2H]", "HYDROXYPHENYLLACTATE [M-H]", 
"HYPOTAURINE [M+H]", "HYPOTAURINE [M-H]", "HYPOXANTHINE [M+H]", 
"HYPOXANTHINE [M+Na]", "HYPOXANTHINE [M+Na-2H]", "HYPOXANTHINE [M-H]", 
"INDOLE [M+H]", "INDOLE-3-METHYL ACETATE [M-H]", "INDOLE-3-PYRUVATE [M-H]", 
"INOSINE [M+H]", "INOSINE [M+Na]", "INOSINE [M-H]", "Int_Std_12,13-diHOME", 
"Int_Std_12-HETE", "Int_Std_13,14-dihydro-15-keto-PGD2", "Int_Std_13,14-dihydro-15-keto-PGF2a", 
"Int_Std_13-HODE", "Int_Std_15-deoxy-d12,14-PGJ2", "Int_Std_15-HETE", 
"Int_Std_20-HETE", "Int_Std_5-oxoETE", "Int_Std_5S-HETE", "Int_Std_6-keto-PGF1a", 
"Int_Std_9,10-diHOME", "Int_Std_9-HODE", "Int_Std_CUDA", "Int_Std_LTB4", 
"Int_Std_PGD2", "Int_Std_PGE2", "Int_Std_PGF2a", "Int_Std_Resolvin D1", 
"Int_Std_TXB2", "ISOCITRATE [M-H]", "ISOLEUCINE [M+H]", "ISOLEUCINE [M-H]", 
"KETOLEUCINE [M-H]", "KYNURENATE [M+H]", "KYNURENINE [M+H]", 
"KYNURENINE [M-H]", "LACTATE [M-H]", "LACTATE [M-H2O-H]", "LACTOSE [M+NH4+]", 
"L-ALANINE [M-H]", "LAURATE [M-H]", "LAUROYLCARNITINE [M+H]", 
"L-CARNITINE [M+H]", "LEUCINE [M+H]", "LEUCINE [M-H]", "L-GULONOLACTONE [M-H]", 
"LINOLEATE [M-H]", "LITHOCHOLYLTAURINE [M+Na]", "LYSINE (STABLE ISOTOPE) [M+H]", 
"LYSINE (STABLE ISOTOPE) [M-H]", "LYSINE [M-H]", "LYSINE [M-H2O+H]", 
"MALATE [M-H]", "MALEATE [M-H]", "MANDELATE [M-H]", "MANNITOL [M-H]", 
"MANNOSE [M+Na]", "MANNOSE [M-H]", "METHIONINE [M+H]", "METHIONINE [M-H]", 
"METHIONINE [M-NH3+H]", "METHYL ACETOACETATE [M-H]", "METHYL GALACTOSIDE [M-H]", 
"MONOETHYLMALONATE [M-H2O-H]", "MYOINOSITOL [M-H]", "N,N,N-TRIMETHYLLYSINE [M+H]", 
"N6-(DELTA2-ISOPENTENYL)-ADENINE [M+H]", "N6-(DELTA2-ISOPENTENYL)-ADENINE [M-H]", 
"N-ACETYLALANINE [M+H]", "N-ACETYLALANINE [M+Na]", "N-ACETYLASPARAGINE [M+H]", 
"N-ACETYLASPARAGINE [M-H2O-H]", "N-ACETYLASPARTATE [M-H]", "N-ACETYLGLUCOSAMINE [M+H]", 
"N-ACETYLGLUCOSAMINE [M-H2O+H]", "N-ACETYLGLUTAMATE [M+H]", "N-ACETYLGLUTAMATE [M-H]", 
"N-ACETYLGLYCINE [M-H]", "N-ACETYLLEUCINE [M+H]", "N-ACETYLMANNOSAMINE [M+H]", 
"N-ACETYLMANNOSAMINE [M-H]", "N-ACETYLMANNOSAMINE [M-H2O+H]", 
"N-ACETYLMETHIONINE [M-H]", "N-ACETYLNEURAMINATE [M+H]", "N-ACETYLNEURAMINATE [M+Na]", 
"N-ACETYLNEURAMINATE [M-H]", "N-ACETYLNEURAMINATE [M-H2O-H]", 
"N-ACETYLPHENYLALANINE [M-H]", "N-ACETYLPUTRESCINE [M+H]", "N-ACETYLSERINE [M-H2O-H]", 
"N-ALPHA-ACETYLLYSINE [M+H]", "NERVONATE [M-H]", "N-FORMYL-L-METHIONINE [M-H]", 
"NICOTINAMIDE [M+H]", "NONANOATE [M-H]", "Novel EIC_1", "Novel EIC_2", 
"Novel EIC_28", "Novel EIC_8", "O-ACETYLCARNITINE [M+H]", "O-ACETYLCARNITINE [M-H2O+H]", 
"O-ACETYLSERINE [M-H]", "OMEGA-HYDROXYDODECANOATE [M-H]", "OXALATE [M-H]", 
"OXOGLUTARATE [M-H]", "PALMITATE [M-H]", "PALMITOLEATE [M-H]", 
"PANTOTHENATE [M+H]", "PANTOTHENATE [M+Na-2H]", "PARAXANTHINE [M+H]", 
"PENTANOATE [M-H]", "PHENYLALANINE (STABLE ISOTOPE) [M+H]", "PHENYLALANINE (STABLE ISOTOPE) [M-H]", 
"PHENYLALANINE [M+H]", "PHENYLALANINE [M-H]", "PHENYLALANINE [M-NH3+H]", 
"PHENYLPYRUVATE [M-H]", "PHOSPHORYLCHOLINE [M+H]", "PIPECOLATE [M+H]", 
"PIPECOLATE [M-H]", "Polar Molecule_ARACHIDATE [M-H]", "Polar Molecule_CHENODEOXYCHOLATE [M-H+Acetate]", 
"Polar Molecule_CORTEXOLONE [M-H+Acetate]", "Polar Molecule_CORTICOSTERONE [M-H+Acetate]", 
"Polar Molecule_CORTISOL [M-H+Acetate]", "Polar Molecule_CORTISONE [M-H+Acetate]", 
"Polar Molecule_DEOXYCHOLATE [M-H]", "Polar Molecule_DEOXYCHOLATE [M-H+Acetate]", 
"Polar Molecule_ELAIDATE [M-H]", "Polar Molecule_GAMMA-LINOLENATE [M-H]", 
"Polar Molecule_GAMMA-LINOLENATE [M-H+Acetate]", "Polar Molecule_LINOLEATE [M-H]", 
"Polar Molecule_LINOLEATE [M-H+Acetate]", "Polar Molecule_LUMICHROME [M-H]", 
"Polar Molecule_MYRISTATE [M-H]", "Polar Molecule_N-ACETYLNEURAMINATE [M-H]", 
"Polar Molecule_N-ACETYLTRYPTOPHAN [M-H]", "Polar Molecule_OLEOYL-GLYCEROL [M-H]", 
"Polar Molecule_OLEOYL-GLYCEROL [M-H+Acetate]", "Polar Molecule_PALMITATE [M-H+Acetate]", 
"Polar Molecule_PALMITOLEATE [M-H]", "Polar Molecule_PALMITOLEATE [M-H+Acetate]", 
"Polar Molecule_STEARATE [M-H]", "Polar Molecule_Tetrahydrocortisol [M-H+Acetate]", 
"Polar Molecule_TRICOSANOATE [M-H]", "PROLINE [M+2Na-H]", "PROLINE [M+H]", 
"PROLINE [M+Na]", "PROLINE [M-H]", "PROPIONATE [M-H]", "Putative_1a-Methyl-5a-androstan-3a,17b-diol glucuronide", 
"Putative_1a-Methyl-5a-androstan-3a-ol-17-one glucuronide", "Putative_1-Hexadecanoyl-sn-glycero-3-phosphoethanolamine", 
"Putative_1-Oleoyl-sn-glycero-3-phosphoethanolamine", "Putative_1-Palmitoyl-2-hydroxy-sn-glycero-3-phosphoethanolamine", 
"Putative_1-Stearoyl-2-hydroxy-sn-glycero-3-phosphoethanolamine", 
"Putative_2a-Methyl-5a-androstan-3a-ol-17-one glucuronide", "Putative_2-Hydroxypalmitic acid", 
"Putative_3-Hydroxystanozolol glucuronide", "Putative_4-[5-[[4-[5-[acetyl(hydroxy)amino]pentylamino]-4-oxobutanoyl]-hydroxyamino]pentylamino]-4-oxobutanoic acid", 
"Putative_4-Androsten-17b-ol-3-one glucosiduronate", "Putative_5a-Androstan-17b-ol-3-one glucosiduronate", 
"Putative_5a-Androstan-3a,17b-diol-17b-glucuronide", "Putative_6-((E)-2-((1R,2S,3R,5S)-3,5-Dihydroxy-2-((Z)-oct-2-enyl)cyclopentyl)vinyl)tetrahydro-2H-pyran-2-one", 
"Putative_7a,17a-Dimethyl-5b-androstane-3a,17b-diol glucuronide", 
"Putative_7-Keto-3a,12-a-dihydroxycholanic acid", "Putative_Androstan-3-ol-17-one 3-glucuronide", 
"Putative_Androsterone glucuronide", "Putative_Beta-HC", "Putative_Bilirubin", 
"Putative_Chenodeoxycholic acid 24-acyl-b-D-glucuronide", "Putative_CORTISOL", 
"Putative_Decylbenzenesulfonic acid", "Putative_Glycocholic acid", 
"Putative_Hydrocortisone 21-hemisuccinate", "Putative_Naringenin-7-O--D-Glucuronide / Naringenin-4'-O-b-D-glucuronide", 
"Putative_Natamycin", "Putative_N-oleoyl taurine", "Putative_N-Oleoyl-L-serine", 
"Putative_Taurolithocholic acid sulfate", "Putative_Tauroursodeoxycholic acid", 
"PYRUVATE [M-H]", "QUINOLINATE [M-H]", "RIBOSE [M-H]", "SALICYLATE [M-H]", 
"SERINE [M+2Na-H]", "SERINE [M+H]", "SERINE [M-H]", "SORBITOL [M+Na-2H]", 
"SORBITOL [M-H]", "STEARATE [M-H]", "Sterol_11-Deoxycorticosterone [M-H+Acetate]", 
"Sterol_11-Deoxycortisol [M-H+Acetate]", "Sterol_11-keto-testosterone [M-H+Acetate]", 
"TAGATOSE [M+Na]", "TAGATOSE [M-H]", "TAURINE [M+2Na-H]", "TAURINE [M+H]", 
"TAURINE [M+Na]", "TAURINE [M+NH4+]", "TAURINE [M-H]", "THEOBROMINE [M-H]", 
"THEOPHYLLINE [M-H]", "THREONINE [M+2Na-H]", "THREONINE [M+H]", 
"THREONINE [M-H]", "TRANS-4-HYDROXY-L-PROLINE [M+H]", "TRANS-4-HYDROXY-L-PROLINE [M-H]", 
"TRANS-CYCLOHEXANEDIOL [M-H]", "TREHALOSE [M+Na]", "TRICOSANOATE [M-H]", 
"TRIGONELLINE [M+H]", "TRYPTOPHAN [M+2Na-H]", "TRYPTOPHAN [M+H]", 
"TRYPTOPHAN [M+Na]", "TRYPTOPHAN [M+Na-2H]", "TRYPTOPHAN [M-H]", 
"TRYPTOPHAN [M-NH3+H]", "TYROSINE [M+2Na-H]", "TYROSINE [M+H]", 
"TYROSINE [M+Na]", "TYROSINE [M-H]", "TYROSINE [M-NH3+H]", "URATE [M-H]", 
"UREIDOPROPIONATE [M+H]", "UREIDOPROPIONATE [M+Na-2H]", "UREIDOPROPIONATE [M-H]", 
"URIDINE [M+Na-2H]", "URIDINE [M-H]", "VALINE [M+2Na-H]", "VALINE [M+H]", 
"VALINE [M-H]", "VLCDCA_1", "VLCDCA_12", "VLCDCA_15", "VLCDCA_17", 
"VLCDCA_19", "VLCDCA_2", "VLCDCA_23", "VLCDCA_24", "VLCDCA_26", 
"VLCDCA_3", "VLCDCA_32", "VLCDCA_33", "VLCDCA_34", "VLCDCA_35", 
"VLCDCA_40", "VLCDCA_41", "VLCDCA_42", "VLCDCA_43", "VLCDCA_44", 
"VLCDCA_48", "VLCDCA_6", "VLCDCA_8", "XANTHINE [M-H]", "XANTHOSINE [M-H]"
)

dput(metabmeta4$Sample) 的结果如下。只有 15 行,所以我不确定为什么它返回的 SampleID 比我的数据框中的多(请参阅下面的 metabmeta4$Sample 结果)

> dput(metabmeta4$Sample)
structure(c(2L, 4L, 17L, 19L, 14L, 8L, 3L, 1L, 6L, 18L, 12L, 
16L, 15L, 9L, 21L), .Label = c("164", "167", "174", "175", "190", 
"194", "195", "205", "206", "214", "220", "231", "233", "242", 
"246", "257", "259", "260", "267", "314", "323", "343", "344", 
"350", "360", "365", "324", "336", "378", "346", "352", "379", 
"381", "391", "399", "402", "404", "408", "410", "412", "415", 
"417", "418", "419", "421", "423", "427"), class = "factor")
> metabmeta4$Sample
 [1] 167 175 259 267 242 205 174 164 194 260 231 257 246 206 323
47 Levels: 164 167 174 175 190 194 195 205 206 214 220 231 233 ... 427

任何建议都会有所帮助!

这是我的假设:您的错误是由于计数 table 中的 15 个样本列中的一个或多个(不是代谢物或 KEGG)被错误地呈现为“数字”变量以外的其他变量。

查看 omu_anovasource code,“代谢物”列首先分配给数据框的行名,然后下一行仅选择计数数据中的列数字.

  data_Int <- count_data[sapply(count_data, function(x) is.numeric(x))]

因此,这里删除了非数字列,列太少可以解释您看到的错误,因为当转置计数数据稍后连接到元数据时,'Metabolite' 行名会丢失。

要诊断此问题,请尝试 str(metab9) 并观察是否所有样本列都是数字。或者,检查您的 'KEGG' 列是否不是数字(我怀疑它应该是一个因子或字符)。如果 KEGG 是数字,它会给计数数据太多列。