Good afternoon, I know that this blog is not precisely about phylogenetics subjects, but I'm stuck using phylotools in R , I'm trying to mapping a matrix which contains continue values in a phylogenetic tree. It seems that my tree has zero and negative edges lengths, and when I try to map the matrix, appear a error message like the following
Error in if (x <= trans[1]) state <- names(trans)[1] else if (x >= trans[length(trans)]) state <- names(trans)[length(trans)] else { :
missing value where TRUE/FALSE needed
I have tried with sed command to susbtite the values with zero
sed -e 's,:-[0-9\.]\+,:0.0,g' in.tree &gt; out.tree
I also have used the library "ape" in R, with the next function
di2multi(phy, tol = 1e-08)
which according to APE documentation “deletes all branches smaller than tol and collapses the corresponding dichotomies into a multichotomy"
the phylogenetic tree is the next
(_Leptolyngbya_sp._O-77_1:0.2763363282,(((((((_Synechococcus_sp._PCC_7502_1:0.1346665061,_Pseudanabaena_sp._PCC_7367_1:0.0613813447):0.0563052951,(((((((_Dactylococcopsis_salina_PCC_8305_1:0.0198368786,_Halothece_sp._PCC_7418_1:0.0313799691):0.0892782949,(_Microcystis_aeruginosa_NIES-843_1:0.0010657007,(_Microcystis_aeruginosa_NIES-2481_1:0.0014835663,_Microcystis_panniformis_FACHB-1757_1:0.0007499138):0.0011866002):0.0691103016):0.0072054224,(_Pleurocapsa_sp._PCC_7327_1:0.0790779121,(_Cyanothece_sp._PCC_7424_1:0.0420938173,_Cyanothece_sp._PCC_7822_1:0.0292636862):0.0158244802):0.0240927150):0.0176396050,((_Cyanothece_sp._PCC_8801_1:0.0000022418,_Cyanothece_sp._PCC_8802_1:0.0000028809):0.0325568547,(_Candidatus_Atelocyanobacterium_thalassa_isolate_ALOHA_1:0.0316835038,_Cyanothece_sp._ATCC_51142_1:0.0417313563):0.0203281832):0.0135969436):0.0089428072,(((((_Cyanobacterium_stanieri_PCC_7202_1:0.0652483971,_Cyanobacterium_aponinum_PCC_10605_1:0.0296806216):0.0083414761,(_Geminocystis_sp._NIES-3708_1:0.0143690810,_Geminocystis_sp._NIES-3709_1:0.0121480643):0.0122761790):0.0859711667,(_Synechocystis_sp_PCC_6803_1:0.0000022418,(_Synechocystis_sp._PCC_6803_1:0.0000022418,_Synechocystis_sp_PCC_6803_substr._PCC-N_1:0.0000022418):0.0000026646):0.0623135001):0.0104095575,(_Leptolyngbya_sp._PCC_7376_1:0.0230510242,_Synechococcus_sp._PCC_7002_1:0.0090839705):0.0569328910):0.0200979583,(_Chondrocystis_sp_NIES-4102_1:0.0694358247,_Stanieria_cyanosphaera_PCC_7437_1:0.0283078966):0.0211669584):0.0000029572):0.0198837533,(_Moorea_producens_JHB_1:0.0062616335,_Moorea_producens_PAL-8-15-08-1_1:0.0072908243):0.0641775414):0.0089099015,((_Oscillatoria_acuminata_PCC_6304_1:0.0665460496,(_Arthrospira_platensis_YZ_1:0.0021781004,_Arthrospira_sp_PCC_8005_1:0.0000022418):0.0490215965):0.0166269787,(_Oscillatoria_nigro-viridis_PCC_7112_1:0.0542073261,_Trichodesmium_erythraeum_IMS101_1:0.0697040540):0.0130080423):0.0238821303):0.0027679468):0.0061095562,(((((_Leptolyngbya_boryana_dg5_1:0.0000022418,_Leptolyngbya_boryana_IAM_M-101_1:0.0000022418):0.1180654887,_Chamaesiphon_minutus_PCC_6605_1:0.0612713201):0.0145229308,_Crinalium_epipsammum_PCC_9333_1:0.0716857221):0.0127991800,(((_Calothrix_sp._PCC_6303_1:0.0711533255,((_Calothrix_sp._NIES-4071_1:0.0589270018,_Calothrix_sp._NIES-4101_1:0.0537230225):0.0087944637,_Calothrix_sp._NIES-3974_1:0.0633050446):0.0085902373):0.0168874911,((_Fischerella_sp._NIES-3754_1:0.0703995306,_Calothrix_sp._336_3_1:0.0165975314):0.0106252535,_Rivularia_sp._PCC_7116_1:0.0493355437):0.0101396244):0.0157029891,((((_Nostoc_punctiforme_PCC_73102_1:0.0402431436,_Calothrix_sp._NIES-2098_1:0.0176571740):0.0118988818,(_Nostoc_sp._PCC_7524_1:0.0246817739,(((_Nostoc_piscinale_CENA21_1:0.0294660709,_Nostoc_sp._PCC_7107_1:0.0054317861):0.0254181602,_Nostoc_sp._PCC_7120_1:0.0000020990):0.0031534951,_Trichormus_variabilis_ATCC_29413_1:0.0090228963):0.0108652015):0.0085738937):0.0048304871,(((_Nodularia_spumigena_CCY9414_1:0.0267567527,(_Anabaena_sp._90_Chromosome_chANA01_1:0.0150014684,_Anabaena_sp._WA102_1:0.0072855604):0.0295032260):0.0097548756,_Anabaena_cylindrica_PCC_7122_2_1:0.0230433495):0.0116523590,_Nostoc_azollae_0708_1:0.0251902198):0.0043166934):0.0031310329,(_Calothrix_sp._PCC_7507_1:0.0171188486,_Cylindrospermum_stagnale_PCC_7417_1:0.0171606477):0.0074303704):0.0285896333):0.0266278207):0.0097785538,((_Chroococcidiopsis_thermalis_PCC_7203_1:0.1015129650,_Gloeocapsa_sp._PCC_7428_1:0.0416675038):0.0146567846,_Microcoleus_sp._PCC_7113_1:0.0487327805):0.0116487168):0.0168990076):0.0145917942,(_Acaryochloris_marina_MBIC11017_1:0.0677075659,_Cyanothece_sp._PCC_7425_1:0.0281970559):0.0275879787):0.0176626587,(_Synechococcus_sp_PCC_6312_1:0.0404185315,(_Synechococcus_lividus_PCC_6715_1:0.0050007296,(_Thermosynechococcus_elongatus_BP-1_1:0.0006922675,_Thermosynechococcus_sp._NK55a_1:0.0007478782):0.0090542537):0.0278244072):0.0448537898):0.0108061746,(((_Synechococcus_elongatus_PCC_6301_1:0.0000022418,_Synechococcus_elongatus_PCC_7942_1:0.0000022418):0.0713211958,(_Cyanobium_gracile_PCC_6307_1:0.0223589193,(((_Synechococcus_sp._RCC307_1:0.0229471461,((_Synechococcus_sp._CC9311_1:0.0007204707,_Synechococcus_sp._WH_8020_1:0.0000022418):0.0048152944,((_Synechococcus_sp._WH_8102_1:0.0007409077,_Synechococcus_sp._WH_8103_1:0.0000022418):0.0053566430,((_Synechococcus_sp._CC9605_1:0.0000022418,_Synechococcus_sp._WH_8109_1:0.0000022418):0.0043900903,_Synechococcus_sp._CC9902_1:0.0015053562):0.0022197247):0.0050112845):0.0040694574):0.0064023750,(_Prochlorococcus_marinus_str._MIT_9303_1:0.0040900986,_Prochlorococcus_marinus_str_MIT_9313_1:0.0059079863):0.0053663474):0.0026695999,(((_Prochlorococcus_marinus_str._NATL1A_1:0.0027233044,_Prochlorococcus_marinus_str._NATL2A_1:0.0022798677):0.0064555786,((_Prochlorococcus_marinus_str._MIT_9515_1:0.0000022418,_Prochlorococcus_marinus_subsp._pastoris_str._CCMP1986_1:0.0014090005):0.0018691407,((_Prochlorococcus_marinus_str_MIT_9312_1:0.0028134562,((_Prochlorococcus_sp_RS01_1:0.0000000000,_Prochlorococcus_sp_RS50_1:0.0000000000):0.0000022418,_Prochlorococcus_sp_RS04_1:0.0000022418):0.0000022933):0.0007100445,_Prochlorococcus_marinus_str._AS9601_1:0.0006911703):0.0040079854):0.0061776958):0.0032831199,_Prochlorococcus_marinus_subsp_marinus_str_CCMP1375_1:0.0058125478):0.0083977787):0.0128812908):0.0666773040):0.0449855922,_Geitlerinema_sp._PCC_7407_1:0.0394849382):0.0084709087):0.0336181586,(_Synechococcus_sp_JA-2-3B_a_2-13_1:0.0157300024,_Synechococcus_sp_JA-3-3Ab_1:0.0308256542):0.1173249961):0.0202152404,(_Gloeobacter_kilaueensis_JS1_1:0.0105626599,_Gloeobacter_violaceus_PCC_7421_1:0.0052068828):0.0677875311);
And the matrix seems like this
_
Acaryochloris_marina_MBIC11017_1 11.18917349
_Anabaena_cylindrica_PCC_7122_2_1 13.32611059
_Anabaena_sp._90_Chromosome_chANA01_1 12.39125301
_Anabaena_sp._WA102_1 12.97292883
_Arthrospira_platensis_YZ_1 14.11236825
_Arthrospira_sp_PCC_8005_1 14.03513801
_Calothrix_sp._336_3_1 14.22610681
_Calothrix_sp._NIES-2098_1 14.05694037
_Calothrix_sp._NIES-3974_1 13.90086534
_Calothrix_sp._NIES-4071_1 3.900827509
_Calothrix_sp._NIES-4101_1 13.69827773
_Calothrix_sp._PCC_6303_1 13.63683771
_Calothrix_sp._PCC_7507_1 13.87162932
_Candidatus_Atelocyanobacterium_thalassa_isolate_ALOHA_1 6.791825109
If someone can help me, I would appreciate very much