%mBPlistExtractor.m     %Slave for mFastaExtractor_multiple (_forGUI too)

LocPos=[];
for i=1:length(index)
    LocPos=[LocPos, LocPos1(i):LocPos2(i)];
end

releventBPind1=[];releventBPind2=[];
for i=1:length(LocPos)
    releventBPind1=[releventBPind1, find(InputData(:,1)==LocPos(i))'];
    releventBPind2=[releventBPind2, find(InputData(:,2)==LocPos(i))'];
end
releventBPind1=sort(releventBPind1);
releventBPind2=sort(releventBPind2);

for j=1:length(InputData(:,1))
    if InputData(j,1),end
end

%pass=[];
BPsThatBelongHere={'Organism' 'LB1' 'LB2' 'Interaction'};
for i=1:length(releventBPind1)
    for j=1:length(releventBPind2)
        if releventBPind1(i)==releventBPind2(j)
            
            if InputData(releventBPind1(i),1)<InputData(releventBPind1(i),2)
                N1=min(InputData(releventBPind1(i),1),InputData(releventBPind1(i),2))-min(LocPos)+1;
                N2=max(InputData(releventBPind1(i),1),InputData(releventBPind1(i),2))-min(LocPos1(:,2),LocPos2(:,2))+max(LocPos1(:,1),LocPos2(:,1))-min(LocPos)+6;
            else
                N1=max(InputData(releventBPind1(i),1),InputData(releventBPind1(i),2))-min(LocPos1(:,2),LocPos2(:,2))+max(LocPos1(:,1),LocPos2(:,1))-min(LocPos)+6;
                N2=min(InputData(releventBPind1(i),1),InputData(releventBPind1(i),2))-min(LocPos)+1;
            end
            %pass=[pass,releventBPind1(i)];
            BPsThatBelongHere=[BPsThatBelongHere;...
                InputText(releventBPind1(i)+1,1),...
                num2str(N1),...
                num2str(N2),...
                InputText(releventBPind1(i)+1,4)];
            break
        end
    end
end
%pass
