public static ResultPackage Load(string fileName) { //De-serialize it! System.IO.FileStream flStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); BinaryFormatter bf = new BinaryFormatter(); ResultPackage newRP = (ResultPackage)bf.Deserialize(flStream); flStream.Close(); return(newRP); }
private void FeedLocusFastaDictSEPro(DirectoryClassDescription myDir, FileInfo[] resultFilteredFiles) { foreach (FileInfo fi in resultFilteredFiles) { Console.WriteLine("Parsing " + fi.FullName); SEPRPackage.ResultPackage thisPckg = SEPRPackage.ResultPackage.Load(fi.FullName); myResultPackages.Add(new FileInfoResultPackage(fi, thisPckg, myDir.ClassLabel)); foreach (MyProtein protein in thisPckg.MyProteins.MyProteinList) { if (!locusFastaDict.ContainsKey(protein.Locus)) { locusFastaDict.Add(protein.Locus, protein.Sequence); } } } }