Exemplo n.º 1
0
        public static double RandomDoubleFraction(int digits, Random rnd)
        {
            string fakeDouble = string.Format("0.{0}", RandomExtensionMethods.NextLong(rnd, (10 ^ digits) - 1));
            double result     = double.Parse(fakeDouble);

            return(result);
        }
Exemplo n.º 2
0
        public static int RandomInt(int MinValue, int MaxValue, Random rnd)
        {
            string fakeInt = string.Format("{0}", RandomExtensionMethods.NextLong(rnd, MinValue, MaxValue));
            int    result  = int.Parse(fakeInt);

            return(result);
        }
Exemplo n.º 3
0
        public static decimal RandomDecimalFraction(int digits, Random rnd)
        {
            string  fakeDecmal = string.Format("0.{0}", RandomExtensionMethods.NextLong(rnd, (10 ^ digits) - 1));
            decimal result     = decimal.Parse(fakeDecmal);

            return(result);
        }
Exemplo n.º 4
0
        public void LoadFile(clsFinalReport FinalReport, string SampleID)
        {
            // Mock values we don't have yet
            Random random = new Random();

            this.RecordID         = RandomExtensionMethods.NextLong(random);
            this.SampleID         = SampleID;
            this.RegID            = RandomExtensionMethods.RandomString("", 24, 24, random);
            this.BirdID           = RandomExtensionMethods.RandomString("", 2, 2, random);
            this.ChickenID        = RandomExtensionMethods.RandomString("", 20, 20, random);
            this.DamChickenID     = RandomExtensionMethods.RandomString("", 20, 20, random);
            this.DamBlupID        = RandomExtensionMethods.RandomString("", 24, 24, random);
            this.SireChickenID    = RandomExtensionMethods.RandomString("", 20, 20, random);
            this.SireBlupID       = RandomExtensionMethods.RandomString("", 24, 24, random);
            this.Gender           = RandomExtensionMethods.RandomString("MF", 1, 1, random)[0];
            this.CalculatedGender = RandomExtensionMethods.RandomString("MF", 1, 1, random)[0];
            this.ReportedGender   = RandomExtensionMethods.RandomString("MF", 1, 1, random)[0];
            this.CallRate         = RandomExtensionMethods.RandomDoubleFraction(5, random);
            this.Farm             = RandomExtensionMethods.RandomString("", 2, 2, random);
            this.Line             = RandomExtensionMethods.RandomString("", 3, 3, random);
            this.MatingGroup      = RandomExtensionMethods.RandomInt(1, 99999, random);
            this.PlateVersion     = RandomExtensionMethods.RandomString("", 6, 6, random);
            this.PlateWell        = RandomExtensionMethods.RandomString("", 3, 3, random);
            this.Usable           = RandomExtensionMethods.RandomString("YN ", 1, 1, random)[0];
            this.Primary          = RandomExtensionMethods.RandomString("YN ", 1, 1, random)[0];
            this.SampleType       = RandomExtensionMethods.RandomString("", 16, 16, random);
            this.GSGTVersion      = FinalReport.GSGTVersion;
            this.ProcessingDate   = FinalReport.ProcessingDate;
            this.Content          = FinalReport.Content;
            this.NumSamples       = FinalReport.NumSamples;
            this.NumSNPs          = FinalReport.NumSNPs;
            this.TotalSamples     = FinalReport.NumSamples;
            this.TotalSNPs        = FinalReport.NumSNPs;
            this.Filename         = FinalReport.Filename;

            //int index = 0; //FinalReport.GetIndexBySampleID(SampleID);

            // Fill genomic arrays for specified sample
            for (int i = 0; i < FinalReport.SNP.Count; i++)
            {
                var snp = FinalReport.SNP[i];
                this.SNPName.Add(snp.SNPName);
                this.Allele1_Forward.Add(snp.Allele1_Forward);
                this.Allele2_Forward.Add(snp.Allele2_Forward);
                this.Allele1_Top.Add(snp.Allele1_Top);
                this.Allele2_Top.Add(snp.Allele2_Top);
                this.Allele1_AB.Add(snp.Allele1_AB);
                this.Allele2_AB.Add(snp.Allele2_AB);
                this.GC_Score.Add(snp.GC_Score);
                this.X.Add(snp.X);
                this.Y.Add(snp.X);
            }
        }