Beispiel #1
0
        public ParsedFile CreateDbEntry(ParsedFile parsedFile)
        {
            var finishedFile = parsedFile;

            finishedFile.Run.AccessionSections = parsedFile.AccessionSections;
            finishedFile.Run.FamilySections    = parsedFile.FamilySections;
            finishedFile.Run.FastaSections     = parsedFile.FastaSections;
            return(finishedFile);
        }
Beispiel #2
0
        public ParsedFile ParseAccessionSection(ParsedFile partiallyParsedFileCF, UnparsedFile unparsedFile)
        {
            int i = 1;

            string[] temp;
            foreach (string line in unparsedFile.AccessionLinesFromFile)
            {
                temp = line.Split(new char[] { ';' });
                var accessionSection = ParseAccessionSectionLine(temp, i, unparsedFile.Sra);
                partiallyParsedFileCF.AccessionSections.Add(accessionSection);
                i++;
            }
            var partiallyParsedFileCFA = partiallyParsedFileCF;

            return(partiallyParsedFileCFA);
        }
Beispiel #3
0
        public ParsedFile ParseFamilySection(ParsedFile partiallyParsedFileC, UnparsedFile unparsedFile)
        {
            int i = 1;

            string[] temp;
            foreach (string line in unparsedFile.FamilyLinesFromFile)
            {
                temp = line.Split(new char[] { ';' });
                var familySection = ParseFamilySectionLine(temp, i, unparsedFile.Sra);
                partiallyParsedFileC.FamilySections.Add(familySection);
                i++;
            }
            var partiallyParsedFileCF = partiallyParsedFileC;

            return(partiallyParsedFileCF);
        }
Beispiel #4
0
        public ParsedFile ParseCommentLine(string fileName, UnparsedFile unparsedFile)
        {
            string[] split = unparsedFile.CommentLineFromFile.Split(new char[] { ',' });
            string[] sra   = split[0].Split(new char[] { '=' });
            string[] gen   = split[1].Split(new char[] { '=' });
            string[] date  = split[2].Split(new char[] { '=' });
            unparsedFile.Sra = sra[2];
            var run = new Run();

            run.FileName = fileName;
            run.Sra      = sra[2];
            run.Genome   = gen[1];
            run.Date     = date[1];
            var partiallyParsedFile = new ParsedFile();

            partiallyParsedFile.Run = run;
            return(partiallyParsedFile);
        }
Beispiel #5
0
        public ParsedFile ParseFastaSection(ParsedFile partiallyParsedFileCFA, UnparsedFile unparsedFile)
        {
            bool          first      = true;
            bool          second     = false;
            int           i          = 1;
            int           j          = 0;
            List <string> firstLine  = new List <string>();
            List <string> secondLine = new List <string>();
            List <int>    lineNumber = new List <int>();

            foreach (string line in unparsedFile.FastaLinesFromFile)
            {
                if (first)
                {
                    firstLine.Add(line);
                    first = !first;
                }
                if (second)
                {
                    secondLine.Add(line);
                    lineNumber.Add(i);
                    i++;
                    first = !first;
                    partiallyParsedFileCFA.FastaSections.Add(new FastaSection
                    {
                        FastaSectionLineId = lineNumber[j],
                        Sra        = unparsedFile.Sra,
                        SequenceId = firstLine[j],
                        Sequence   = secondLine[j]
                    });
                    j++;
                }
                second = !second;
            }
            var parsedFile = partiallyParsedFileCFA;

            return(parsedFile);
        }