protected TargetCollection GetMassTagTargets(string massTagFileName, List <int> targetIDsToFilterOn)
        {
            if (String.IsNullOrEmpty(massTagFileName) || !File.Exists(massTagFileName))
            {
                return(new TargetCollection());
            }


            if (massTagFileName.ToLower().Contains("_msgfplus.tsv"))
            {
                var iqTargetImporter = new BasicIqTargetImporter(massTagFileName);
                var iqTargets        = iqTargetImporter.Import();

                var targetUtilities  = new IqTargetUtilities();
                var targetCollection = new TargetCollection
                {
                    TargetList = new List <TargetBase>()
                };

                foreach (var iqTarget in iqTargets)
                {
                    if (iqTarget.QualityScore > MsgfFdrScoreCutoff)
                    {
                        continue;
                    }
                    targetUtilities.UpdateTargetMissingInfo(iqTarget);

                    TargetBase oldStyleTarget = new PeptideTarget();
                    oldStyleTarget.ChargeState      = (short)iqTarget.ChargeState;
                    oldStyleTarget.Code             = iqTarget.Code;
                    oldStyleTarget.EmpiricalFormula = iqTarget.EmpiricalFormula;
                    oldStyleTarget.ID = iqTarget.ID;
                    oldStyleTarget.MZ = iqTarget.MZTheor;
                    oldStyleTarget.MonoIsotopicMass      = iqTarget.MonoMassTheor;
                    oldStyleTarget.ScanLCTarget          = iqTarget.ScanLC;
                    oldStyleTarget.NormalizedElutionTime = (float)iqTarget.ElutionTimeTheor;

                    oldStyleTarget.ElutionTimeUnit = DeconTools.Backend.Globals.ElutionTimeUnit.ScanNum;
                    targetCollection.TargetList.Add(oldStyleTarget);
                }

                return(targetCollection);
            }


            var importer = new MassTagFromTextFileImporter(massTagFileName);

            return(importer.Import(targetIDsToFilterOn));
        }
예제 #2
0
        public override void LoadAndInitializeTargets(string targetsFilePath)
        {
            if (TargetImporter == null)
            {
                TargetImporter = new MSAlignIqTargetImporter(targetsFilePath);
            }

            Targets = TargetImporter.Import();

            foreach (TopDownIqTarget target in Targets)
            {
                setParentNetFromChildren(target);
                _targetUtilities.UpdateTargetMissingInfo(target);
                target.RefineChildTargets();
                target.SetChildrenFromParent();
            }
        }
        protected virtual TargetCollection GetLcmsFeatureTargets(string targetsFilePath)
        {
            if (targetsFilePath.ToLower().Contains("_msgf"))
            {
                var iqTargetImporter = new BasicIqTargetImporter(targetsFilePath);
                var iqTargets        = iqTargetImporter.Import();

                var targetUtilities  = new IqTargetUtilities();
                var targetCollection = new TargetCollection();
                targetCollection.TargetList = new List <TargetBase>();

                foreach (var iqTarget in iqTargets)
                {
                    if (iqTarget.QualityScore > MsgfFdrScoreCutoff)
                    {
                        continue;
                    }
                    targetUtilities.UpdateTargetMissingInfo(iqTarget);

                    TargetBase oldStyleTarget = new LcmsFeatureTarget();
                    oldStyleTarget.ChargeState      = (short)iqTarget.ChargeState;
                    oldStyleTarget.Code             = iqTarget.Code;
                    oldStyleTarget.EmpiricalFormula = iqTarget.EmpiricalFormula;
                    oldStyleTarget.ID = iqTarget.ID;
                    oldStyleTarget.MZ = iqTarget.MZTheor;
                    oldStyleTarget.MonoIsotopicMass      = iqTarget.MonoMassTheor;
                    oldStyleTarget.ScanLCTarget          = iqTarget.ScanLC;
                    oldStyleTarget.NormalizedElutionTime = (float)iqTarget.ElutionTimeTheor;

                    oldStyleTarget.ElutionTimeUnit = DeconTools.Backend.Globals.ElutionTimeUnit.ScanNum;
                    targetCollection.TargetList.Add(oldStyleTarget);
                }

                return(targetCollection);
            }

            var importer =
                new LcmsTargetFromFeaturesFileImporter(targetsFilePath);

            var lcmsTargetCollection = importer.Import();

            return(lcmsTargetCollection);
        }