コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: Taoffi/covid5ync
 private void Instance_SequenceParseCompleted(iDnaSequence sender, int nodeCount)
 {
     if (sender != null)
     {
         textBlockNodeCount.Text = sender.Count.ToString();
     }
 }
コード例 #2
0
ファイル: iDnaSequenceUtils.cs プロジェクト: Taoffi/covid5ync
        public static async Task <iDnaSequence> FromString(string str)
        {
            iDnaSequence sequence = new iDnaSequence();

            await sequence.ParseString(str);

            return(sequence);
        }
コード例 #3
0
        private void _sequence_SequenceParseCompleted(iDnaSequence sender, int nodeCount)
        {
            if (_sequence == null)
            {
                return;
            }

            // assign repeats and hairpins only after parse string process is complete
            _sequence.RepeatsRegionIndex  = _deserializedRepeatIndexes;
            _sequence.HairpinsRegionIndex = _deserializedHairPinIndexes;
            _sequence.NotifySequenceLoaded();
        }
コード例 #4
0
ファイル: iDnaRegionIndex.cs プロジェクト: Taoffi/covid5ync
        public iDnaRegionIndex(iDnaSequence sequence, string regionName) : base()
        {
            _name = regionName;

            if (sequence == null)
            {
                return;
            }

            int min = sequence.Min(i => i.Index),
                max = sequence.Max(i => i.Index);

            _limitMin = min;
            _limitMax = max;

            _minValue = min;
            _maxValue = max;
        }
コード例 #5
0
ファイル: iDnaSequenceUtils.cs プロジェクト: Taoffi/covid5ync
        /// <summary>
        /// rebuild sequence basket (repeats and hairpins) from region indexes
        /// </summary>
        /// <param name="sourceSequence">the parent sequence to which the basket should be attached</param>
        /// <param name="sourceList">the region index list</param>
        /// <returns>the list of sequence basket</returns>
        protected static List <iDnaSequence> RegionListToSequenceList(iDnaSequence sourceSequence, iDnaRegionIndexList sourceList)
        {
            List <iDnaSequence> list = new List <iDnaSequence>();

            if (sourceList == null || sourceList.Count() <= 0 || sourceSequence == null)
            {
                return(list);
            }

            foreach (var region in sourceList)
            {
                var nodes = sourceSequence.Where(i => i.Index >= region.MinValue && i.Index <= region.MaxValue);

                if (nodes == null || nodes.Count() <= 0)
                {
                    continue;
                }

                list.Add(new iDnaSequence(region.Name, nodes, refOnly: true, nOccurrences: region.Occurrences));
            }
            return(list);
        }
コード例 #6
0
ファイル: App.xaml.cs プロジェクト: Taoffi/covid5ync
        protected override void OnStartup(StartupEventArgs e)
        {
            if (e == null)
            {
                base.OnStartup(e);
                return;
            }

            string[]     args = e.Args;
            iDnaSequence seq  = iDnaSequence.Instance;

            if (args != null && args.Length > 0)
            {
                _startupFileName = args[0];
            }

            if (seq != null)
            {
                seq.SequenceParseCompleted += Seq_SequenceParseCompleted;
            }

            base.OnStartup(e);
        }
コード例 #7
0
ファイル: iDnaRegionIndex.cs プロジェクト: Taoffi/covid5ync
 /// <summary>
 /// for deserialzation !
 /// </summary>
 /// <param name="seq"></param>
 internal void SetParentSequenceNoCheck(iDnaSequence seq)
 {
     _parentSequence = seq;
 }
コード例 #8
0
ファイル: iDnaRegionIndex.cs プロジェクト: Taoffi/covid5ync
 public iDnaRegionIndexList(iDnaSequence sequence, string regionName)
 {
     _parentSequence = sequence;
 }
コード例 #9
0
ファイル: App.xaml.cs プロジェクト: Taoffi/covid5ync
 private void Seq_SequenceParseCompleted(iDnaSequence sender, int nodeCount)
 {
     SetMainWindowTitle(iDnaSequence.Instance.Name);
 }
コード例 #10
0
 void InitialzeRootSequence()
 {
     _sequence = iDnaSequence.Instance;
     _sequence.SequenceParseCompleted += _sequence_SequenceParseCompleted;
 }
コード例 #11
0
 public iDnaSequenceContract(iDnaSequence sequence) : base()
 {
     _sequence = sequence;
 }
コード例 #12
0
 public iDnaSequenceContract() : base()
 {
     _sequence = iDnaSequence.Instance;
 }
コード例 #13
0
ファイル: iDnaNode.cs プロジェクト: Taoffi/covid5ync
 public iDnaNode(iDnaSequence parentSequence, iDnaBase rootBase, int index) : base()
 {
     _parentSequence = parentSequence;
     _base           = rootBase;
     _index          = index;
 }