Hello --

In the process of using model.loops to identify regions that I will need to model in a multi-chain situation, I have noticed that it returns insertions between chains as a single loop.

Furthermore, when specifying insertion_ext > 0, if the loop is at the N- or C-terminus of a chain in the middle of the molecule, the extension crosses to the next chain.

Are these two intended behaviors? For the first case, this complicates things for me since I would like to apply restraints to each loop separately (which means I need to split up a couple of the loops returned). For the second case, I feel like this may not be the intended behavior since the C terminus of one chain and the N terminus of the next can be far apart in space.

Thanks,
Shyam

## Reproducible for the first case (can be modified to show the second)

## wget https://files.rcsb.org/download/5KXI.pdb
## remove residues A 74 and B 1

# contents of alignment file: 5xki_fill.aln
>P1;2abx
structureX:2abx:   1 :A:+148 :B:MOL_ID  1; MOLECULE  ALPHA-BUNGAROTOXIN; CHAIN  A, B; ENGINEERED  YES:MOL_ID  1; ORGANISM_SCIENTIFIC  BUNGARUS MULTICINCTUS; ORGANISM_COMMON  MANY-BANDED KRAIT; ORGANISM_TAXID  8616; TISSUE  VENOM: 2.50: 0.24
IVCHTTATIPSSAVTCPPGENLCYRKMWCDAFCSSRGKVVELGCAATCPSKKPYEEVTCCSTDKCNHPPKRQP-/
-VCHTTATIPSSAVTCPPGENLCYRKMWCDAFCSSRGKVVELGCAATCPSKKPYEEVTCCSTDKCNHPPKRQPG*
>P1;2abx_fill
sequence:::::::::
IVCHTTATIPSSAVTCPPGENLCYRKMWCDAFCSSRGKVVELGCAATCPSKKPYEEVTCCSTDKCNHPPKRQPG/
IVCHTTATIPSSAVTCPPGENLCYRKMWCDAFCSSRGKVVELGCAATCPSKKPYEEVTCCSTDKCNHPPKRQPG*

# modeller code

from modeller import environ, selection
from modeller.automodel import automodel

class MyModel(automodel):
    # only refine loop regions
    def select_atoms(self):
        aln = self.read_alignment()
        loops = self.loops(aln, minlength=1, maxlength=100, insertion_ext=0,
                           deletion_ext=0)
        for i in loops[0]:
            print(i)

        raise ValueError("stop here")

        return selection(loops).only_std_residues()


env = environ()
env.io.atom_files_directory = ['.']

a = MyModel(env,
            alnfile = '2abx_fill.aln',             # alignment filename
            knowns = '2abx',               # codes of the templates
            sequence = '2abx_fill')           # code of the target

a.starting_model = 5        # index of the first model
a.ending_model = 5          # index of the last model
                            # (determines how many models to calculate)

a.make()                    # do the actual comparative modeling