evoldoers / machineboss

Bioinformatics Open Source Sequence machine
BSD 3-Clause "New" or "Revised" License
33 stars 7 forks source link

--count-copies creates a cyclic machine (actually an implicit reduction precedence issue) #92

Closed ihh closed 6 years ago

ihh commented 6 years ago
boss --generate-chars N --concat --generate-one ACDEFGHIKLMNQRSTVWY --concat --generate-one ST --concat --generate-one ACDEFGHIKLMNQRSTVWY --eliminate > PS00001.json
boss PS00001.json -p translate --concat --generate-uniform-dna --count-copies n -v6 >/dev/null

In output...

Sorting increased number of silent transitions from 5 to 8; restoring original order
ihh commented 6 years ago

Shorter:

boss --generate-one AC --eliminate > blah.json
boss blah.json -p translate --concat --generate-uniform-dna --count-copies n -v6 > /dev/null
ihh commented 6 years ago

Could this be a precedence issue? The following works:

boss --generate-one AC --eliminate > blah.json
boss --begin blah.json -p translate --concat --generate-uniform-dna --end --count-copies n -v6 > /dev/null

Strongly suggests that left-to-right associativity is broken...

ihh commented 6 years ago

Looks like this is because there is no explicit --compose, so reduceMachines() is called at the end, with different results in the two cases.

In other words, --concat has higher precedence than implicit reduction with --compose. This is obviously confusing, and should be fixed.