Ejemplo n.º 1
0
        public FragmentFeatureGraph(ImsDataCached imsData, PrecursorFeatureNode precursorNode, Feature precursorFeature,
                                    Ion precursorIon, Composition cutComposition, GroupParameter parameter, SubScoreFactory scoringParams)
        {
            _scoringParams        = scoringParams;
            _precursorFeatureNode = precursorNode;

            Add(precursorNode, new List <FeatureEdge>());
            var fragmentNodes = GetFragmentNodes(imsData, precursorFeature, cutComposition, precursorIon, parameter);

            supportingIonTypes = new List <IonType>();
            foreach (var node in fragmentNodes)
            {
                if (node.Feature != null)
                {
                    supportingIonTypes.Add(node.FragmentIonClassBase);
                }
            }
            //var nn = fragmentNodes.Count(no => no.Feature != null);
            //Console.WriteLine(this + "Num features : " + nn);


            var usedNodes = new List <FeatureNode> {
                precursorNode
            };

            UpdateEdges(fragmentNodes, usedNodes); // from precursor to any of fragment nodes
            if (this[precursorNode].Count == 0)
            {
                NodeScore = RatioScore = -1; //TODO should be trained..
                Score     = NodeScore + RatioScore;
                return;
            }
            // usedNodes.Remove(precursorNode);// exclude precursorNode
            var primeNode   = (FragmentFeatureNode)this[precursorNode][0].RNode;
            var targetNodes = GetTargetNodes(primeNode, fragmentNodes, true, false);

            UpdateEdges(targetNodes, usedNodes); // to the nodes of different terminal ions
            targetNodes = GetTargetNodes(primeNode, fragmentNodes, false, false);

            UpdateEdges(targetNodes, usedNodes); // to the nodes of the same terminal ions
            targetNodes = GetTargetNodes(primeNode, fragmentNodes, true, true);
            UpdateEdges(targetNodes, usedNodes); // to the nodes of differently charged ions

            GetScore();
        }
Ejemplo n.º 2
0
 public ImsScorerFactory(string paramFilePath)
 {
     _subScoreFactory = new SubScoreFactory(paramFilePath);
 }
Ejemplo n.º 3
0
 internal ImsScorer(ImsDataCached imsData, Ion precursorIon, SubScoreFactory scoringParams) // precursorComposition does not have protons; however, protons are incorporated when calculating mz
 {
     _imsData       = imsData;
     _precursorIon  = precursorIon;
     _scoringParams = scoringParams;
 }
Ejemplo n.º 4
0
 internal ImsScorer(ImsDataCached imsData, Ion precursorIon, SubScoreFactory scoringParams) // precursorComposition does not have protons; however, protons are incorporated when calculating mz
 {
     _imsData = imsData;
     _precursorIon = precursorIon;
     _scoringParams = scoringParams;
 }
Ejemplo n.º 5
0
 public ImsScorerFactory(string paramFilePath)
 {
     _subScoreFactory = new SubScoreFactory(paramFilePath);
 }
Ejemplo n.º 6
0
 public FragmentFeatureNode(IsotopomerFeatures isotopomerFeatures, IonType fragmentIonClassBase, Feature precursorFeature,
                            GroupParameter parameter, SubScoreFactory scoringParams)
     : base(isotopomerFeatures, fragmentIonClassBase, precursorFeature, parameter)
 {
     _scoringParams = scoringParams;
 }
Ejemplo n.º 7
0
 public FragmentFeatureNode(IsotopomerFeatures isotopomerFeatures, IonType fragmentIonClassBase, Feature precursorFeature,
     GroupParameter parameter, SubScoreFactory scoringParams)
     : base(isotopomerFeatures, fragmentIonClassBase, precursorFeature, parameter)
 {
     _scoringParams = scoringParams;
 }