Beispiel #1
0
#pragma warning restore 649

        public SequenceGraph()
        {
            InitializeComponent();
            Graph = new DataGraph();
            BuildSequenceGraphLogicCore();
            SelectedSequence = new Sequence(new List <AminoAcid>());
#pragma warning disable 618
            SelectedVertices = new List <List <DataVertex> >();
#pragma warning restore 618
            SequenceGraphArea.Loaded         += SequenceGraphArea_Loaded;
            SequenceGraphArea.VertexSelected += VertexSelectedEvent;
        }
Beispiel #2
0
        /// <summary>Initializes a new instance of the <see cref="GraphXSequenceGraph"/> class.</summary>
        /// <param name="aminoAcidSet">The amino acid set.</param>
        /// <param name="nterm">The n-terminal residue of the sequence.</param>
        /// <param name="sequence">The sequence.</param>
        /// <param name="cterm">The c-terminal residue of the sequence.</param>
        /// <param name="mods">The search modification to apply to the sequence.</param>
        protected GraphXSequenceGraph(AminoAcidSet aminoAcidSet, AminoAcid nterm, string sequence, AminoAcid cterm, IEnumerable <SearchModification> mods) :
            base(aminoAcidSet, nterm, sequence, cterm)
        {
            var modList = mods.ToList();

            var ntermMods = (from m in modList
                             where (m.IsFixedModification && (m.Location == SequenceLocation.ProteinNTerm || m.Location == SequenceLocation.PeptideNTerm))
                             select m).ToList();

            var ctermMods = (from m in modList
                             where (m.IsFixedModification && (m.Location == SequenceLocation.ProteinCTerm || m.Location == SequenceLocation.PeptideCTerm))
                             select m).ToList();

            Modification ntermMod = null;

            foreach (var nmod in ntermMods)
            {
                ntermMod = nmod.Modification;
                if (nmod.TargetResidue == nterm.Residue)
                {
                    break;
                }
            }

            Modification ctermMod = null;

            foreach (var cmod in ctermMods)
            {
                ctermMod = cmod.Modification;
                if (cmod.TargetResidue == cterm.Residue)
                {
                    break;
                }
            }

            nterminal = null;
            cterminal = null;
            if (ntermMod != null)
            {
                nterminal = new ModifiedAminoAcid(new AminoAcid('(', "NTerm", Composition.Zero), ntermMod);
            }

            if (ctermMod != null)
            {
                cterminal = new ModifiedAminoAcid(new AminoAcid(')', "CTerm", Composition.Zero), ctermMod);
            }

            DataGraph = new DataGraph();
            BuildGraph();
        }
Beispiel #3
0
        /// <summary>
        /// Generate sequence graph from data graph.
        /// </summary>
        private void GenerateSequenceGraph()
        {
            this.sequenceGraph = GraphXSequenceGraph.Create(
                new AminoAcidSet(this.SearchModifications, this.MaxDynamicModifications),
                string.Empty,
                this.SearchModifications.ToList());
            if (this.sequenceGraph == null)
            {
                return;
            }

            var graph = this.sequenceGraph.DataGraph;

            this.Graph = graph;
            this.SequenceGraphArea.LogicCore.Graph = graph;
            this.SequenceGraphArea.ShowAllEdgesLabels();
            this.SequenceGraphArea.GenerateGraph(true);
        }