%mGetBPOrderRight.m
%This translates the numbers in File.Pair(n).Class which may be negative or
%positive the right ordered BPs, for example, AG class -1 may mean that it
%should be GA class 1 or AG class 1 depending on the "Code" of each letter,
%that's how Craig coded it... 

function [LocalBase1,LocalBase2] = mGetBPOrderRight(File,n)


B1 = File.Pair(n).Base1Index;
B2 = File.Pair(n).Base2Index;

if File.Pair(n).Class > 0,
    if File.NT(B1).Code <= File.NT(B2).Code,       %AS IT SHOULD BE
        LocalBase1  = File.NT(B1).Number;    LocalBase2  = File.NT(B2).Number;
        %BaseID1     = File.NT(B1).Base;      BaseID2     = File.NT(B2).Base;
    elseif File.NT(B1).Code > File.NT(B2).Code,    %REVERSE THEM
        LocalBase2 = File.NT(B1).Number;    LocalBase1  = File.NT(B2).Number;
    end
elseif File.Pair(n).Class < 0,
    if File.NT(B1).Code > File.NT(B2).Code,        %AS IT SHOULD BE
        LocalBase1  = File.NT(B1).Number;    LocalBase2  = File.NT(B2).Number;
    elseif File.NT(B1).Code <= File.NT(B2).Code,   %REVERSE THEM
        LocalBase2 = File.NT(B1).Number;    LocalBase1  = File.NT(B2).Number;
    end
end