Skip to main content
. 2022 Aug 17;23(16):9249. doi: 10.3390/ijms23169249
Algorithm 1 Pseudocode for identifying independently folded nucleic acid substructures.
Input: Set of all subchains C, Set of interacting subchains Yx for each subchain x
Output: Independently folded Substructures
LibraryC     ▹Library records all subchains not assigned to substructures
forx in C do
    if x in Library then      ▹ Find the substructure containing subchain x
        SxYx
        SnewYx      ▹Snew records newly added subchains in each loop below
        while Snew not empty do
           StmpSx        ▹Stmp updates the substructure in each loop
           for z in Snew do
               StmpStmpYz  ▹ Include interacting subchains for each newly added subchain
           end for
           SnewStmp\Sx
           SxStmp
        end while
        LibraryLibrary\Sx       ▹ Remove subchains in Sx from Library
        Add Sx to Substructures
    end if
end for