public void Parse() { StreamReader reader = FileUtils.GetReader(filename); string line; string header = null; DnaSequence sequence = new DnaSequence(); while ((line = reader.ReadLine()) != null) { if (line.StartsWith(">")) { if (header != null) { process(header, sequence); } header = line.Substring(1); sequence = new DnaSequence(); } else { string s = StringUtils.RemoveWhitespace(line.Trim()).ToUpper(); s = s.Replace('U', 'T'); sequence.Append(s); } } if (header != null) { process(header, sequence); } reader.Close(); }
public void Parse() { StreamReader reader = FileUtils.GetReader(filename); string line; string header = null; DnaSequence sequence = new DnaSequence(); while ((line = reader.ReadLine()) != null){ if (line.StartsWith(">")){ if (header != null){ process(header, sequence); } header = line.Substring(1); sequence = new DnaSequence(); } else{ string s = StringUtils.RemoveWhitespace(line.Trim()).ToUpper(); s = s.Replace('U', 'T'); sequence.Append(s); } } if (header != null){ process(header, sequence); } reader.Close(); }