You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: run_QfTree.m
    path of file: ./repos/scGEAToolbox/+run/external/mt_UMAP
    
    the code of the file until where you have to start completion: function [qf, qfTree] = run_QfTree(trainingSet, trainingIds, ttl, varargin)
%   AUTHORSHIP
%   Primary Developer: Stephen Meehan <swmeehan@stanford.edu>
%   Math Lead & Secondary Developer:  Connor Meehan <connor.gw.meehan@gmail.com>
%   Bioinformatics Lead:  Wayne Moore <wmoore@stanford.edu>

    
function [qf, qfTree] = run_QfTree(trainingSet, trainingIds, ttl, varargin)
%   AUTHORSHIP
%   Primary Developer: Stephen Meehan <swmeehan@stanford.edu>
%   Math Lead & Secondary Developer:  Connor Meehan <connor.gw.meehan@gmail.com>
%   Bioinformatics Lead:  Wayne Moore <wmoore@stanford.edu>
%   Provided by the Herzenberg Lab at Stanford University
%   License: BSD 3 clause
%
%   Class for Hi-D matching with merging of data subsets using
%       QF match or F-measure or both
%
%
%   QF Tree (phenogram) is described in
%   https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6586874/


ml = BasicMap.Global.getNumeric(QfHiDM.PROP_MERGE_LIMIT, 1);
p = parseArguments();
parse(p, varargin{:});
[args, hadPu] = checkArgs(p.Results);
qf = QfHiDM(trainingSet, args.trainingSetComp, trainingIds, ...
    trainingSet, args.trainingSetComp, trainingIds, args.bins, args.binStrategy);
qf.tNames = args.trainingNames;
qf.sNames = args.trainingNames;
qf.matchStrategy = args.matchStrategy;
qf.mergeStrategy = args.mergeStrategy;
qf.maxDeviantParameters = 0;
qf.computeTree(args.pu, qf.tNames);
qfTree = QfTree(qf, ttl, BasicMap.Global, '', args.colors, ...
    args.edgeColors, args.lineWidths, qf.tNames);
if ~hadPu
    args.pu.close;
end