示例#1
0
        public IEnumerable <ISequence <IAminoAcid> > Parse(Stream inputStream)
        {
            var sequences = new List <Sequence>();

            var reader = new StreamReader(inputStream);

            while (!reader.EndOfStream)
            {
                var sequence = new Sequence();
                sequence.Process(reader);
                sequences.Add(sequence);
            }

            //for now only proteins (amino acids) AND only the FIRST one are assumed in the fasta file
            var proteins = new List <Protein>();

            foreach (var sequence in sequences)
            {
                var protein = new Protein();
                protein.Description = sequence.Comment;

                foreach (char letter in sequence.Letters)
                {
                    protein.Add(AminoAcids.FromLetter(letter));
                }

                proteins.Add(protein);
            }

            return(proteins);
        }
示例#2
0
        private void LoadWeekProtein()
        {
            var protein = MainWindow.UserNutritionRepository.GetSumsOfProtein(MainWindow.UserId, 7);

            foreach (var i in protein)
            {
                Protein.Add(new GraphicPoint()
                {
                    Date = i.Key.ToShortDateString(), Number = i.Value
                });
            }
        }