override public string ToString()
        {
            string str;
            string appVersion, appName;
            string NEW_SECTION = Environment.NewLine + Environment.NewLine;

            appVersion = Assembly.GetExecutingAssembly().GetName().Version.Major + "." +
                         Assembly.GetExecutingAssembly().GetName().Version.Minor + "." +
                         Assembly.GetExecutingAssembly().GetName().Version.Build + "." +
                         Assembly.GetExecutingAssembly().GetName().Version.Revision;

            appName = Assembly.GetExecutingAssembly().GetName().Name;
            str     = "";

            str += "Generated using " + appName + " " + appVersion + Environment.NewLine;
            str += Environment.NewLine;

            str += "IDENTIFICATION" + Environment.NewLine;
            str += "Item 1\tItem 2\tIdentical experiments\tCompared experiments" + Environment.NewLine;
            foreach (IdentificationResults r in MyResultList)
            {
                str += r.MyItem1 + "\t" + r.MyItem2 + "\t" + r.MyEqual.ToString() + "\t" + r.MyCompared + Environment.NewLine;
            }

            str += NEW_SECTION;

            str += "PRE-SCAN INFORMATION" + Environment.NewLine;
            str += MyPrescanInfo.ToString();

            str += NEW_SECTION;

            str += "SOURCE INFORMATION" + Environment.NewLine;
            str += MySourceInfo.ToString();

            str += NEW_SECTION;

            str += "SETTINGS" + Environment.NewLine;
            str += MySettings.ToString();



            return(str);
        }
Пример #2
0
        override public string ToString()
        {
            string str;
            double difference;
            string appVersion, appName;
            string NEW_SECTION = Environment.NewLine + Environment.NewLine;

            appVersion = Assembly.GetExecutingAssembly().GetName().Version.Major + "." +
                         Assembly.GetExecutingAssembly().GetName().Version.Minor + "." +
                         Assembly.GetExecutingAssembly().GetName().Version.Build + "." +
                         Assembly.GetExecutingAssembly().GetName().Version.Revision;

            appName = Assembly.GetExecutingAssembly().GetName().Name;
            str     = "";

            str += "Generated using " + appName + " " + appVersion + Environment.NewLine;
            str += Environment.NewLine;

            str += "COMPARISON" + Environment.NewLine;
            str += "No. compared genotypes: " + MyCompared.Count.ToString() + Environment.NewLine;
            str += "No. identical genotypes: " + MyIdentical.Count.ToString() + Environment.NewLine;
            str += "No. different genotypes: " + MyDifferent.Count.ToString() + Environment.NewLine;
            if (MyCompared.Count > 0)
            {
                difference = Convert.ToDouble(MyDifferent.Count) / Convert.ToDouble(MyCompared.Count);
                str       += "Difference: " + difference.ToString("P") + Environment.NewLine;
            }
            else
            {
                str += "Difference: -" + Environment.NewLine;
            }

            str += NEW_SECTION;

            str += "PRE-SCAN INFORMATION" + Environment.NewLine;
            str += MyPrescanInfo.ToString();

            str += NEW_SECTION;

            str += "SOURCE 1 INFORMATION" + Environment.NewLine;
            str += MySourceInfo1.ToString();

            str += NEW_SECTION;

            str += "SOURCE 2 INFORMATION" + Environment.NewLine;
            str += MySourceInfo2.ToString();

            str += NEW_SECTION;

            str += "MISSING COMBINATIONS" + Environment.NewLine;
            str += "No. genotypes in source 1 but not in source 2 (after pre-scan): " + MyMissingIn2.Count.ToString() + Environment.NewLine;
            str += "No. genotypes in source 2 but not in source 1 (after pre-scan): " + MyMissingIn1.Count.ToString() + Environment.NewLine;

            str += NEW_SECTION;

            str += "SETTINGS" + Environment.NewLine;
            str += MySettings.ToString();

            if (MySettings.Mode == InvestigationMode.Genotype && MySettings.HarmonizePolarities)
            {
                str += NEW_SECTION;
                str += "POLARITY HARMONIZATION" + Environment.NewLine;
                str += MyHarmonizer.GetCountInformation();
            }

            if (MySettings.ListDifferent || MySettings.ListIdentical || MySettings.ListCompared || MySettings.ListMissing ||
                MySettings.ListInvalid || MySettings.ListNoResults || MySettings.ListDuplicateFailures || MySettings.ListUnharmonizableSNPs)
            {
                str += NEW_SECTION;
                str += "LISTINGS";
            }

            if (MySettings.ListDifferent)
            {
                str += Environment.NewLine;
                str += "Different genotypes" + Environment.NewLine;
                str += MyDifferent.ToString() + Environment.NewLine;
            }
            if (MySettings.ListIdentical)
            {
                str += Environment.NewLine;
                str += "Identical genotypes" + Environment.NewLine;
                str += MyIdentical.ToString() + Environment.NewLine;
            }
            if (MySettings.ListCompared)
            {
                str += Environment.NewLine;
                str += "Compared genotypes" + Environment.NewLine;
                str += MyCompared.ToString() + Environment.NewLine;
            }
            if (MySettings.ListMissing)
            {
                str += Environment.NewLine;
                str += "Items in source 1 but not in source 2" + Environment.NewLine;
                str += MyPrescanInfo.ItemsSource1NotInSource2.ToString() + Environment.NewLine;
                str += Environment.NewLine;
                str += "Items in source 2 but not in source 1" + Environment.NewLine;
                str += MyPrescanInfo.ItemsSource2NotInSource1.ToString() + Environment.NewLine;
                str += Environment.NewLine;
                str += "Experiments in source 1 but not in source 2" + Environment.NewLine;
                str += MyPrescanInfo.ExperimentsSource1NotInSource2.ToString() + Environment.NewLine;
                str += Environment.NewLine;
                str += "Experiments in source 2 but not in source 1" + Environment.NewLine;
                str += MyPrescanInfo.ExperimentsSource2NotInSource1.ToString() + Environment.NewLine;
                str += Environment.NewLine;
                str += "Genotypes in source 1 but not in source 2 (after pre-scan)" + Environment.NewLine;
                str += MyMissingIn2.ToString() + Environment.NewLine;
                str += Environment.NewLine;
                str += "Genotypes in source 2 but not in source 1 (after pre-scan)" + Environment.NewLine;
                str += MyMissingIn1.ToString() + Environment.NewLine;
            }
            if (MySettings.ListInvalid)
            {
                str += Environment.NewLine;
                str += "Invalid allele codes in source 1" + Environment.NewLine;
                str += MySourceInfo1.InvalidAlleles.ToString() + Environment.NewLine;
                str += Environment.NewLine;
                str += "Invalid allele codes in source 2" + Environment.NewLine;
                str += MySourceInfo2.InvalidAlleles.ToString() + Environment.NewLine;
            }
            if (MySettings.ListNoResults)
            {
                str += Environment.NewLine;
                str += "Missing value codes in source 1" + Environment.NewLine;
                str += MySourceInfo1.NoResults.ToString() + Environment.NewLine;
                str += Environment.NewLine;
                str += "Missing value codes in source 2" + Environment.NewLine;
                str += MySourceInfo2.NoResults.ToString() + Environment.NewLine;
            }
            if (MySettings.ListDuplicateFailures)
            {
                str += Environment.NewLine;
                str += "Duplicate failures in source 1" + Environment.NewLine;
                str += MySourceInfo1.DuplicateFailures.ToString() + Environment.NewLine;
                str += Environment.NewLine;
                str += "Duplicate failures in source 2" + Environment.NewLine;
                str += MySourceInfo2.DuplicateFailures.ToString() + Environment.NewLine;
            }
            if (MySettings.ListUnharmonizableSNPs)
            {
                str += Environment.NewLine;
                str += MyHarmonizer.ToString();
            }

            return(str);
        }