Beispiel #1
0
        static private List <FragmentFeatureNode> GetTargetNodes(FragmentFeatureNode primeNode, IEnumerable <FragmentFeatureNode> nodes, bool diffTerminal, bool diffCharge) // if diffCharge is true, diffTerminal is ignored
        {
            var targetNodes = new List <FragmentFeatureNode>();
            //var primeNterm = primeNode.FragmentIonClassBase is IonType.NtermIonType;
            var primeNterm = primeNode.FragmentIonClassBase.IsPrefixIon;    // Modified by Sangtae

            foreach (var node in nodes)
            {
                //Console.WriteLine(node.FragmentIonClassBase);
                if (node.Equals(primeNode))
                {
                    continue;
                }
                if (diffCharge)
                {
                    if (node.FragmentIonClassBase.Charge != primeNode.FragmentIonClassBase.Charge)
                    {
                        targetNodes.Add(node);
                    }
                }
                else
                {
                    if (node.FragmentIonClassBase.Charge != primeNode.FragmentIonClassBase.Charge)
                    {
                        continue;
                    }
                    if (diffTerminal && primeNterm || !diffTerminal && !primeNterm)
                    {
                        if (!node.FragmentIonClassBase.IsPrefixIon)
                        {
                            targetNodes.Add(node);
                        }
                    }
                    else
                    {
                        if (node.FragmentIonClassBase.IsPrefixIon)
                        {
                            targetNodes.Add(node);
                        }
                    }
                }
            }
            return(targetNodes);
        }
Beispiel #2
0
        private List <FragmentFeatureNode> GetFragmentNodes(ImsDataCached imsData, Feature precursorFeature, Composition cutComposition, Ion precursorIon, GroupParameter parameter)
        {
            var ionTypes = _scoringParams.GetIonTypes(parameter);

            var nodes             = new List <FragmentFeatureNode>();
            var suffixComposition = precursorIon.Composition - Composition.H2O - cutComposition;

            //Console.WriteLine(cutComposition.GetMass() + " " + suffixComposition.GetMass());

            foreach (var ionType in ionTypes)
            {
                var composition = ionType.IsPrefixIon ? cutComposition : suffixComposition;
                //Console.WriteLine("FragFeatureGraph\t" + ionType.Name + "\t" + composition.GetMass() + "\t" + ionType.GetIon(composition).GetMonoIsotopicMz());
                var node = new FragmentFeatureNode(IsotopomerFeatures.GetFramentIsotopomerFeatures(imsData, composition, ionType, precursorFeature), ionType, precursorFeature, parameter, _scoringParams);
                //if(node.Feature != null)
                //    if (20 * node.Feature.IntensityMax < precursorFeature.IntensityMax || node.Feature.IntensityMax > 20 * precursorFeature.IntensityMax) continue; //

                nodes.Add(node);
            }
            return(nodes);
        }