Icon representing a recipe

Recipe: Ligand Atom Number

created by Bruno Kestemont

Profile


Name
Ligand Atom Number
ID
109303
Shared with
Public
Parent
None
Children
None
Created on
January 01, 2026 at 08:42 AM UTC
Updated on
January 01, 2026 at 08:57 AM UTC
Description

Displays the atom numbers in notes linked with bands

Best for


Code


--Ligand atom numbers --one band to each atom of the ligand and a segment with a note displaying atom number --if you want to see better, first erase all notes using appropriate recipe. SStartTime=os.time() InitialClashImportance = behavior.GetClashImportance() NonLockedSegList = {} segCt = structure.GetCount() MinUnlockedSeg = 1 MaxUnlockedSeg = segCt segCnt2=segCt while structure.GetSecondaryStructure(segCnt2)=="M" do segCnt2=segCnt2-1 end FirstLigand= segCnt2 + 1 -- not used if no ligand, segCt if only 1 ligand LastLigand= segCt -- not used if no ligand tetraed={1,7,13,19}-- the segnumbers choosen as ref tetraed if segCnt2 == segCt then AtomsInLigand = 0 return else AtomsInLigand = structure.GetAtomCount(segCt)--problem is that hydrogen are also banded, which is not very usefull I think end Atoms2count=AtomsInLigand helptext0="Total number of atoms in ligand (including H):" helptext="If you want to limit bands to heavy atoms," helptext2="indicate number of heavy atoms above" helptext3="You have to count them on screen" --Options to edit in recipe (TO DO: in dialog) HeavyAtoms=24 --to input manually for each ligand function askInputOutput() repeat local dlog=dialog.CreateDialog("Limit atoms") dlog.L0=dialog.AddLabel(helptext0) dlog.InputText=dialog.AddTextbox("Input:", Atoms2count) dlog.L1=dialog.AddLabel(helptext) dlog.L2=dialog.AddLabel(helptext2) dlog.L3=dialog.AddLabel(helptext3) dlog.copy = dialog.AddButton ( "Go" , 1 ) dlog.cancel = dialog.AddButton ( "Quit" , 0 ) local result=dialog.Show(dlog) if result==1 then InputText=dlog.InputText.value Atoms2count=tonumber(InputText) end until result<2 end askInputOutput() --band to ligand print("adding a band to each ligand atom") -- Search for first empty note function noteSegment() for i=structure.GetCount(),1,-1 do if structure.GetNote(i) ~= "" then if i == structure.GetCount() then return(-1) else return(i+1) end end -- if end -- for return(1) end -- function note_segment = noteSegment() dr_string = "" function saveNote(i) structure.SetNote(note_segment,i) end -- function for i = 1, Atoms2count do bn=band.AddBetweenSegments(note_segment,segCt,0,i) band.SetStrength(bn,0.1) band.SetGoalLength(bn,band.GetLength(bn)) band.Disable(bn) saveNote(i) note_segment=note_segment+1 end

Comments


Bruno Kestemont Lv 1

Because the atom number varies for the same compound.
This is because the atom numbers of a ligand is detremined by the way the compound was build in foldit.
The first rank is determined by the heavy atoms. For example if you start with a single carbon, this will be number 1, and the 4 hydrogens will be numbered 2 to 5.
If now you add a nitrogen with a normal singel link, it will be numbered 2 and the hydrogens will be renumbered 3 to 8.

But if you stard with the nitrogen, this will be numbered 1 and the carbon 2 (then the hydrogens).

If you download a library compound, the all numbering of the heavy atoms starts with the one of the library compound.

In conclusion: if you submit your compound to the library and it matches a library compound, if you download the related library compound, it will be with a different numbering.