mmatschiner / tutorials

Tutorials on phylogenetic and phylogenomic inference
362 stars 167 forks source link

snapp_prep #12

Closed quattrinia closed 3 years ago

quattrinia commented 3 years ago

Hi there,

I tried using your snapp ruby script, and I get this error: snapp_prep.rb:470:in `sort': comparison of NilClass with String failed (ArgumentError)

ruby snapp_prep.rb -p snapp10ms.u.phy -c datefile_snapp.txt -t samples.txt -l 1000000 -s snapp.mcc.newick

Any advice? Thanks! Andrea

Here is my constraints file: lognormal(0,7.7,0.28) crown PC_3,PC_1,PG_1,M2_5,AT18-3-043,AT18-3-046,AT18-3-047,BLT-912_1,BUM-500_3,CAN-1272,CAN-1280,CAN-2828,CAN-4750,CAN-7311,CE-108,CE-120,CE-159,CE-233,CE-24,CE-25,CE-33,CE-46,CE-56,CE-58,CE-62,CE-83,CE-97,HC-C005,HC-C019,HC3-01_C001,HC3-07_C013,HC3-07_C016,HC3-07_C017,HC3-08_C018,HC3-05_C008,LII-09-122,LII-10-601,LII-10-605,LII-10-607,LII-10-608,LII-10-627,LII-10-632,LII-10-678,LII-10-680,LII-100,LII-341,LII-396,LII-421,LII-568,LII-591,LII-597,LII-599,LII-600,LII-686,SH10034,SH10035,SH10037,SH10060,SH10061,SH10067,SH10274,SH10339,SH10341,SH10351,CE-124,CE-125,CE-107 lognormal(0,4.2,0.4) crown PC_3,PC_1,PG_1

And example of my samples file: species specimen bisc1 HC3-07_C013 bisc1 AT18-3-043 bisc1 LII-10-632

phy file: 37 958 AT18-3-043 00.....

tre file: ((((((B3GOM:0.013623878763311994,B3IRE:0.013623878763311994):0.015340988923048655,(CAN:0.02546131519442675,((bisc1:0.00370169276454129,bisc1IRE:0.00370169276454129):0.013805195061841679,bisc2:0.017506887826382964):0.007954427368043783):0.0035035524919338965):0.002464526568326006,((SHGOM:0.02537641140497984,weirdIRE:0.02537641140497983):0.0027180007937780797,((placo-G:0.006979098947669774,placo-wna:0.006979098947669772):0.0028492752259035112,placoIRE:0.00982837417357329):0.018266038025184624):0.0033349820559287445):0.04510965665514435,macro:0.07653905090983101):0.08186037747175706,(clav:0.01976976330784373,gray:0.01976976330784373):0.13862966507374433):0.11648718369462965,LII501:0.2748866120762178);

mmatschiner commented 3 years ago

Hi,

it seems that either the array "table_specimens" or the array "specimen_ids" contains one or more nil elements. To figure out why, you could either post both the phylip file and your samples file here, or you could rerun after adding the following lines at the current line 468:

puts "==========" puts table_specimens puts "==========" puts specimen_ids puts "=========="

This should produce some error message but that error message should point us in the right direction.

quattrinia commented 3 years ago

Hi, Thanks for responding so quick. Here is the error:

HC3_C013 AT18-3-043 LII-632 BLT-912_1 BUM-500_3 CAN-4750 CAN-7311 CAN-1272 CE-107 CE-124 CE-125 CE-120 CE-108 CE-97

CE-159 CE-24 CE-33 CE-46 CE-56 CE-233 HC3_C018 LII-678 SH10061 LII-341 LII-100 LII-396 LII-568 LII-421 SH10067 LII-600 LII-591 LII-597 M2_5 PC_1 PC_3 PG_1 LII-501

AT18-3-043 BLT-912_1 BUM-500_3 CAN-1272 CAN-4750 CAN-7311 CE-107 CE-108 CE-120 CE-124 CE-125 CE-159 CE-233 CE-24 CE-33 CE-46 CE-56 CE-97 HC3_C013 HC3_C018 LII-632 LII-678 LII-100 LII-341 LII-396 LII-421 LII-501 LII-568 LII-591 LII-597 LII-600 M2_5 PC_1 PC_3 PG_1 SH10061 SH10067

snapp_prep.rb:474:in sort': comparison of NilClass with String failed (ArgumentError) from snapp_prep.rb:474:in

'

quattrinia commented 3 years ago

I figured out the error in my samples.txt file (left a blank)! Sorry, rookie mistake! I have written an xml file. Cheers, Andrea