PistoiaHELM / HELMWebEditor

Web browser based editor for drawing HELM macromolecules.
MIT License
17 stars 10 forks source link

Intrapolymer monomer mixtures are disconnected by the editor #236

Open ClairePA opened 5 years ago

ClairePA commented 5 years ago

I want to use the (valid) HELM PEPTIDE1{A.(A:1+G:2+C:3).G.C}$$$$V2.0 and I expect the webeditor to accept this and for the display to look like this: image

However, if I type PEPTIDE1{A.(A:1+G:2+C:3).G.C}$$$$V2.0 into the webeditor, bonds are broken between the A and (A:1+G:2+C:3) and between G and (A:1+G:2+C:3) and I see: image

I can reconnect the bonds, but the HELM generated still contains three separate polymers

PEPTIDE1{(A:1+G:2+C:3)}|PEPTIDE2{A}|PEPTIDE3{G.C}$PEPTIDE2,PEPTIDE1,1:R2-1:?|PEPTIDE3,PEPTIDE1,1:R1-1:?$$$V2.0

The webeditor should accept PEPTIDE1{A.(A:1+G:2+C:3).G.C}$$$$V2.0 and be able to interpret it.

ClairePA commented 5 years ago

This issue is present when the user uses *_ N and X monomers as well as mixtures or alternatives. I think this has come about because of the need to make sure that explicit bonds have ? as the connection point rather than R1 or R2. There are two situations:

Implicit bonds These are created when a simple polymer peptide chain is created. This could either be defined within the HELM string or implied by the connection of monomers of the same type on the canvas. In all cases the editor must implicitly assume that the connection is a standard peptide backbone connection for the purposes of joining the monomers together and allow the total to be a simple polymer so examples like notation PEPTIDE1{A.(A:1+G:2+C:3).G.C}$$$$V2.0 are displayed as a single polymer.

Explicit bonds When there is a connection between simple polymers or to a group then the connection itself is ambiguous and is defined in the notation second section then the connection point must be to ? and R1 and R2 must not be allowed.