code: def nucleotide_linkage(residues):
      
  
      nuc_covalent = []
      #######################################
      # Basic support for RNA/DNA as ligand #
      #######################################
      nucleotides = ['A', 'C', 'T', 'G', 'U', 'DA', 'DC', 'DT', 'DG', 'DU']
      dna_rna = {}  # Dictionary of DNA/RNA residues by chain
      covlinkage = namedtuple("covlinkage", "id1 chain1 pos1 conf1 id2 chain2 pos2 conf2")
      # Create missing covlinkage entries for DNA/RNA
      for ligand in residues:
          resname, chain, pos = ligand
          if resname in nucleotides:
              if chain not in dna_rna:
                  dna_rna[chain] = [(resname, pos), ]
              else:
                  dna_rna[chain].append((resname, pos))
      for chain in dna_rna:
          nuc_list = dna_rna[chain]
          for i, nucleotide in enumerate(nuc_list):
              if not i == len(nuc_list) - 1:
                  name, pos = nucleotide
                  nextnucleotide = nuc_list[i + 1]
                  nextname, nextpos = nextnucleotide
                  newlink = covlinkage(id1=name, chain1=chain, pos1=pos, conf1='',
                                       id2=nextname, chain2=chain, pos2=nextpos, conf2='')
                  nuc_covalent.append(newlink)
  
      return nuc_covalent
docs: Support for DNA/RNA ligands by finding missing covalent linkages to stitch DNA/RNA together.