Example #1
0
    public void Review(int x, int y, int z)
    {
        SimpleClass simpleClass = new SimpleClass();

        simpleClass.sum(x, y);

        Numberclass numclass = new Numberclass();

        numclass.sum(x, y);

        AbstractClassPrac implClass = new ImplementingClass();

        implClass.sum(x, y);

        SealedClass sealedClass = new SealedClass();

        sealedClass.sum(x, y);

        Console.WriteLine();

        Encapsulation encapsulation = new Encapsulation();

        encapsulation.sum(x, y);

        Polymorphism polymorphism = new Polymorphism();

        polymorphism.sum(x, y);
        polymorphism.sum(x, y, z);

        Console.WriteLine();
    }
Example #2
0
 public override string GetAnnotation(Polymorphism p)
 {
     if (MutationAssigner.MutationIsComplex(p.Mutation))
     {
         return(nullAnnotation);
     }
     else
     {
         var site  = p.Position;
         var refBP = Polymorphism.getReferenceBaseSingle(site);
         var alt   = MutationAssigner.getBase(p.Mutation);
         var key   = makeQueryString(site, refBP, alt);
         if (!positionToData.ContainsKey(key))
         {
             key = makeQueryString(site, BigTableData.ALL_SITE_SAME, BigTableData.ALL_SITE_SAME);
             if (positionToData.ContainsKey(key))
             {
                 return(positionToData[key].Data);
             }
             return(nullAnnotation);
         }
         else
         {
             return(positionToData[key].Data);
         }
     }
 }
Example #3
0
        public override string GetAnnotation(Polymorphism poly)
        {
            int    pos = poly.position;
            string reference, alt, inBestHaplotype;

            alt = "ERROR";
            //TODO: Move this logic in to polymorphism class
            if (poly.mutation == Mutations.INS)
            {
                reference = "-";
            }
            else
            {
                reference = Polymorphism.rCRS[poly.position - 1].ToString();
                alt       = poly.InsertedPolys;
            }
            if (poly.mutation == Mutations.DEL)
            {
                alt = "-";
            }
            else if (MutationAssigner.MutationIsBasePair(poly.mutation))
            {
                alt = MutationAssigner.getBase(poly.mutation);
            }
            if (!validPolys.ContainsKey(poly.position))
            {
                inBestHaplotype = "MutationExcludedFromSearch";
            }
            else
            {
                inBestHaplotype = bestMatch.MatchingPolymorphisms.Contains(poly).ToString();
            }
            return(String.Join(FIELD_DELIM, new[] { pos.ToString(), reference, alt, inBestHaplotype }));
        }
Example #4
0
        protected HozaruUserMap()
            : base("Users")
        {
            //Map(x => x.TenantId);
            Map(x => x.UserName);
            Map(x => x.Name);
            Map(x => x.Surname);
            Map(x => x.FirstName);
            Map(x => x.LastName);
            Map(x => x.EmailAddress);
            Map(x => x.IsEmailConfirmed);
            Map(x => x.EmailConfirmationCode);
            Map(x => x.Password);
            Map(x => x.PasswordResetCode);
            Map(x => x.LastLoginTime);
            Map(x => x.IsActive);
            Map(x => x.AuthenticationSource);

            //HasMany(i => i.Roles)
            //    .Cascade.AllDeleteOrphan()
            //    .Inverse()
            //    .KeyColumn("UserId")
            //    .ForeignKeyConstraintName("fk_roles_user");

            HasOne <UserRole>(i => i.Role).Cascade.All();

            this.MapFullAudited();

            Polymorphism.Explicit();
        }
Example #5
0
        protected AbpUserMap()
            : base("AbpUsers")
        {
            Map(x => x.TenantId);
            Map(x => x.UserName);
            Map(x => x.Name);
            Map(x => x.Surname);
            Map(x => x.EmailAddress);
            Map(x => x.IsEmailConfirmed);
            Map(x => x.EmailConfirmationCode);
            Map(x => x.Password);
            Map(x => x.PasswordResetCode);
            Map(x => x.LastLoginTime);
            Map(x => x.IsActive);
            Map(x => x.AuthenticationSource);
            Map(x => x.IsLockoutEnabled);
            Map(x => x.LockoutEndDateUtc);
            Map(x => x.AccessFailedCount);
            Map(x => x.PhoneNumber);
            Map(x => x.IsPhoneNumberConfirmed);
            Map(x => x.SecurityStamp);
            Map(x => x.IsTwoFactorEnabled);

            this.MapFullAudited();

            Polymorphism.Explicit();
        }
Example #6
0
        static void Main(string region  = null,
                         string session = null,
                         string package = null,
                         string project = null,
                         string[] args  = null)
        {
            switch (region)
            {
            case "OO1":
                Basic.RunStuff(null);
                break;

            case "OO2":
                Interfaces.RunStuff(null);
                break;

            case "OO3":
                AbstractClasses.RunStuff(null);
                break;

            case "OO4":
                Polymorphism.RunStuff(null);
                break;

            default:
                break;
            }
        }
Example #7
0
 static void Main(string[] args)
 {
     Inheritance.Example();
     NestedTypes.Example();
     Polymorphism.Example();
     Polymorphism.VirtualExamples();
     NewMethodHierarchy.NewMethods.Example();
 }
Example #8
0
        protected TenantMapBase()
            : base("AbpTenants")
        {
            Map(x => x.Name);
            Map(x => x.CreationTime);

            Polymorphism.Explicit();
        }
Example #9
0
        private static void RunPolymorphismExample()
        {
            PolymorphismBase PMB = new PolymorphismBase();

            PMB.PrintMessage("base class!");
            Polymorphism PM = new Polymorphism();

            PM.PrintMessage("overridden class!");
        }
Example #10
0
        public StudyPage()
        {
            InitializeComponent();

            #region AnimationsInit
            Task.WhenAll(
                CSharpDef.FadeTo(0, 1),
                definitions.FadeTo(0, 1),
                progLang.FadeTo(0, 1),
                OOP.FadeTo(0, 1),
                DotNETFramework.FadeTo(0, 1),
                clr.FadeTo(0, 1),
                cls.FadeTo(0, 1),
                cts.FadeTo(0, 1),
                MSIL.FadeTo(0, 1),
                JIT.FadeTo(0, 1),
                Compiler.FadeTo(0, 1),
                SourceCode.FadeTo(0, 1),
                ExecutableCode.FadeTo(0, 1),
                boxview1.FadeTo(0, 1),
                generalProgTerms.FadeTo(0, 1),
                Variables.FadeTo(0, 1),
                DataType.FadeTo(0, 1),
                Keywords.FadeTo(0, 1),
                Operators.FadeTo(0, 1),
                Expression.FadeTo(0, 1),
                TypeCasting.FadeTo(0, 1),
                Arrays.FadeTo(0, 1),
                Function.FadeTo(0, 1),
                Class.FadeTo(0, 1),
                Object.FadeTo(0, 1),
                Constructor.FadeTo(0, 1),
                Destructor.FadeTo(0, 1),
                Namespaces.FadeTo(0, 1),
                Exceptions.FadeTo(0, 1),
                ExceptionHandling.FadeTo(0, 1),
                boxview2.FadeTo(0, 1),
                oopProgTerms.FadeTo(0, 1),
                Inheritance.FadeTo(0, 1),
                BaseClass.FadeTo(0, 1),
                DerivedClass.FadeTo(0, 1),
                AbstractClass.FadeTo(0, 1),
                MultilevelInheritance.FadeTo(0, 1),
                HierarchicalInheritance.FadeTo(0, 1),
                SingleInheritance.FadeTo(0, 1),
                Interface.FadeTo(0, 1),
                Polymorphism.FadeTo(0, 1),
                Overriding.FadeTo(0, 1),
                Encapsulation.FadeTo(0, 1),
                Abstraction.FadeTo(0, 1),
                Overloading.FadeTo(0, 1));
            #endregion


            // App.adCounter = 0;
        }
Example #11
0
        /// <summary>
        /// Constructor.
        /// </summary>
        protected TenantMap()
            : base("AbpTenants")
        {
            Map(x => x.TenancyName);
            Map(x => x.Name);

            this.MapAudited();

            Polymorphism.Explicit();
        }
Example #12
0
        protected RoleMapBase()
            : base("AbpRoles")
        {
            Map(x => x.Name);
            Map(x => x.DisplayName);
            HasMany(x => x.Permissions).KeyColumn("RoleId");
            this.MapAudited();

            Polymorphism.Explicit();
        }
Example #13
0
 public MutationalHistory(Polymorphism p)
 {
     History = new List <Polymorphism> ()
     {
         p
     };
     CurrentState = new List <Polymorphism> ()
     {
         p
     };
 }
Example #14
0
        protected RoleMap()
            : base("AbpRoles")
        {
            Map(x => x.TenantId);
            Map(x => x.Name);
            Map(x => x.DisplayName);

            this.MapAudited();

            Polymorphism.Explicit();
        }
Example #15
0
        public CommandRequestMap()
        {
            Polymorphism.Implicit();
            Not.LazyLoad();
            Id(x => x.CommandRequestID);
            Map(x => x.CommandDetails).Not.Nullable();
            Map(x => x.CommandID).Not.Nullable();
            Map(x => x.DateTimeUpdated).Not.Nullable();
            Map(x => x.Priority).Not.Nullable();

            DiscriminateSubClassesOnColumn("CommandType").Not.Nullable();
        }
Example #16
0
        private void btnOtherForm_Click(object sender, EventArgs e)
        {
            //Hide the current form
            this.Hide();
            //Create the object for the new form
            Polymorphism polymorphism = new Polymorphism();

            //Display the new form for the user
            polymorphism.ShowDialog();
            //Close this current form
            this.Close();
        }
Example #17
0
        protected async override void OnAppearing()
        {
            #region AnimationsFadeIn
            await Task.WhenAll(
                CSharpDef.FadeTo(1, 500),
                definitions.FadeTo(1, 500),
                progLang.FadeTo(1, 500),
                OOP.FadeTo(1, 500),
                DotNETFramework.FadeTo(1, 500),
                clr.FadeTo(1, 500),
                cls.FadeTo(1, 500),
                cts.FadeTo(1, 500),
                MSIL.FadeTo(1, 500),
                JIT.FadeTo(1, 500),
                Compiler.FadeTo(1, 500),
                SourceCode.FadeTo(1, 500),
                ExecutableCode.FadeTo(1, 500),
                boxview1.FadeTo(1, 500),
                generalProgTerms.FadeTo(1, 500),
                Variables.FadeTo(1, 500),
                DataType.FadeTo(1, 500),
                Keywords.FadeTo(1, 500),
                Operators.FadeTo(1, 500),
                Expression.FadeTo(1, 500),
                TypeCasting.FadeTo(1, 500),
                Arrays.FadeTo(1, 500),
                Function.FadeTo(1, 500),
                Class.FadeTo(1, 500),
                Object.FadeTo(1, 500),
                Constructor.FadeTo(1, 500),
                Destructor.FadeTo(1, 500),
                Namespaces.FadeTo(1, 500),
                Exceptions.FadeTo(1, 500),
                ExceptionHandling.FadeTo(1, 500),
                boxview2.FadeTo(1, 500),
                oopProgTerms.FadeTo(1, 500),
                Inheritance.FadeTo(1, 500),
                BaseClass.FadeTo(1, 500),
                DerivedClass.FadeTo(1, 500),
                AbstractClass.FadeTo(1, 500),
                MultilevelInheritance.FadeTo(1, 500),
                HierarchicalInheritance.FadeTo(1, 500),
                SingleInheritance.FadeTo(1, 500),
                Interface.FadeTo(1, 500),
                Polymorphism.FadeTo(1, 500),
                Overriding.FadeTo(1, 500),
                Encapsulation.FadeTo(1, 500),
                Abstraction.FadeTo(1, 500),
                Overloading.FadeTo(1, 500));

            #endregion
        }
Example #18
0
        public override string GetAnnotation(Polymorphism p)
        {
            var site = p.Position;

            if (!positionToFrequency.ContainsKey(site))
            {
                return(noAnnotationResponse);
            }
            else
            {
                return(positionToFrequency[site]);
            }
        }
Example #19
0
        /// <summary>
        /// Constructor.
        /// </summary>
        protected AbpRoleMap()
            : base("AbpRoles")
        {
            Map(x => x.TenantId);
            Map(x => x.Name);
            Map(x => x.DisplayName);
            Map(x => x.IsStatic);
            Map(x => x.IsDefault);

            this.MapFullAudited();

            Polymorphism.Explicit();
        }
Example #20
0
        /// <summary>
        /// Constructor.
        /// </summary>
        protected HozaruTenantMap()
            : base("Tenants")
        {
            References(x => x.Edition).Column("EditionId").Nullable();

            Map(x => x.TenancyName);
            Map(x => x.Name);
            Map(x => x.IsActive);

            this.MapFullAudited();

            Polymorphism.Explicit();
        }
Example #21
0
        /// <summary>
        /// Call SNPs from the sorted list of sequences using the pile-up method.
        /// </summary>
        /// <returns>The SN ps.</returns>
        /// <param name="sequences">Sequences.</param>
        public static SNPCallerReport CallSNPs(IEnumerable <CompactSAMSequence> sequences)
        {
            // Get a pile up and convert it to genotypes
            var pileups   = PileUpProducer.CreatePileupFromReads(sequences);
            var genotypes = ContinuousGenotypeCaller.CallContinuousGenotypes(pileups).ToList();

            // Filter down to a usable set
            var usable = genotypes.Where(x => x.ResultType == GenotypeCallResult.GenotypeCalled && x.OriginalPosition.HasValue).ToList();

            if (usable.Count == 0)
            {
                return(new SNPCallerReport(AlgorithmResult.Failed));
            }

            // Get median coverage at sites
            var data_counts = usable.Select(x => x.TotalObservedBases).ToList();

            data_counts.Sort();
            var median = data_counts[data_counts.Count / 2];

            //now create a cut-off for required coverage as the square root of the median.
            var cut_off = Math.Sqrt(median);

            //Get a list of genotypes, and if a simple SNP, make a polymorphism if it doesn't match
            //the reference
            var genotypedPositions    = new HashSet <int> ();
            List <Polymorphism> polys = new List <Polymorphism> ();

            foreach (var geno in usable)
            {
                if (geno.TotalObservedBases >= cut_off)
                {
                    genotypedPositions.Add(geno.OriginalPosition.Value);
                    var org_bp = ReferenceGenome.GetReferenceBaseAt_rCRSPosition(geno.OriginalPosition.Value);
                    var cur_bp = geno.GetMostFrequentGenotype();
                    if (org_bp != cur_bp[0])
                    {
                        var poly = new Polymorphism(geno.OriginalPosition.Value, MutationAssigner.getBase(cur_bp));
                        polys.Add(poly);
                    }
                }
            }
            //Now assign haplotype
            HaplotypeSearcher  hts = new HaplotypeSearcher();
            PolymorphismFilter pf  = new PolymorphismFilter(p => p.IsSNP && genotypedPositions.Contains(p.Position));
            var simpSample         = new SimpleSample("Pileup", polys, pf);
            var hap_report         = hts.GetHaplotypeReport(simpSample);

            return(new SNPCallerReport(genotypes, hap_report));
        }
Example #22
0
        //TODO: This needs to be a method
        //private StreamReader PolygeneticWeights {


        public void changePoly(Haplogroup hg, Polymorphism polyOld, Polymorphism polyNew)
        {
            var e = getPolysOfHg(hg);

            foreach (XmlNode ce in e)
            {
                if (ce.InnerText.Equals(polyOld.ToString()))
                {
                    ce.InnerText = polyNew.ToString();
                    return;
                }
            }
            throw new HaploGrepException("Polymorphism does not exit");
        }
Example #23
0
        /// <summary>
        /// Constructor.
        /// </summary>
        protected AbpRoleMap()
            : base("AbpRoles")
        {
            References(x => x.Tenant).Column("TenantId").Nullable();

            Map(x => x.Name);
            Map(x => x.DisplayName);
            Map(x => x.IsStatic);
            Map(x => x.IsDefault);

            this.MapFullAudited();

            Polymorphism.Explicit();
        }
Example #24
0
        protected UserMapBase()
            : base("AbpUsers")
        {
            Map(x => x.TenantId);
            Map(x => x.UserName);
            Map(x => x.Name);
            Map(x => x.Surname);
            Map(x => x.EmailAddress);
            Map(x => x.IsEmailConfirmed);
            Map(x => x.EmailConfirmationCode);
            Map(x => x.Password);
            Map(x => x.PasswordResetCode);

            Polymorphism.Explicit();
        }
Example #25
0
        public TenantMap()
            : base("Tenants")
        {
            References(x => x.Edition).Column("EditionId").Nullable();

            Map(x => x.WhatsappNumber);
            Map(x => x.TenancyName);
            Map(x => x.Name);
            Map(x => x.IsActive);
            Map(x => x.Address);
            Map(x => x.Phone);
            Map(x => x.ExternalDomain);
            References(i => i.District).Column("District_Id").Index("tenant_district_id");

            this.MapFullAudited();

            Polymorphism.Explicit();
        }
 public override string GetAnnotation(Polymorphism p)
 {
     if (MutationAssigner.MutationIsComplex(p.Mutation))
     {
         return("NA");
     }
     else
     {
         var site = p.Position;
         if (!positionToFrequency.ContainsKey(site))
         {
             return("NA");
         }
         else
         {
             return(positionToFrequency[site].ToString());
         }
     }
 }
Example #27
0
        protected UserMap()
            : base("AbpUsers")
        {
            Map(x => x.TenantId);
            Map(x => x.UserName);
            Map(x => x.Name);
            Map(x => x.Surname);
            Map(x => x.EmailAddress);
            Map(x => x.IsEmailConfirmed);
            Map(x => x.EmailConfirmationCode);
            Map(x => x.Password);
            Map(x => x.PasswordResetCode);
            Map(x => x.LastLoginTime);
            Map(x => x.IsActive);

            this.MapFullAudited();

            Polymorphism.Explicit();
        }
Example #28
0
        public JobBaseMap()
        {
            Table(TableName);
            //the column used to identify extended class key
            DiscriminateSubClassesOnColumn("JTF"); //Job Type Filter
            //specifies lazy loading
            LazyLoad();
            //set polymorph
            Polymorphism.Explicit();

            //persistent fields
            Id(x => x.Id)
            .GeneratedBy
            .Identity();

            //audit fields
            Map(x => x.CreatedDate);
            Map(x => x.CreatedBy);
            Map(x => x.ModifiedDate);
            Map(x => x.ModifiedBy);

            //default properties needed to create an appointment
            Map(x => x.ExtRefId);
            Map(x => x.StartDate);
            Map(x => x.EndDate);
            Map(x => x.StatusKey);
            Map(x => x.LabelKey);
            Map(x => x.LineOfWork);
            Map(x => x.Description);
            Map(x => x.Location);
            Map(x => x.TargetDate);
            Map(x => x.Priority);

            //integration properties
            Map(x => x.ProgressStatus);
            Map(x => x.CompletionDate);
            Map(x => x.IntegrationStatus);
            Map(x => x.IntegrationDate);
            Map(x => x.IntegrationMessage);

            //reference to the operative/resource that owns this job.
            //References(x => x.Resource).Cascade.SaveUpdate();
        }
Example #29
0
        private void SetPolygeneticWeights(StreamReader inFile)
        {
            string line = inFile.ReadLine();

            while (line != null)
            {
                string[] tokens             = line.Split('\t');
                string   polyString         = tokens[0];
                double   phyloGeneticWeight = Convert.ToDouble(tokens[1]);
                if (!polyString.Contains("X"))
                {
                    Polymorphism poly = new Polymorphism(polyString);
                    Polymorphism.changePhyloGeneticWeight(poly, this.phyloString, phyloGeneticWeight);
                }
                else
                {
                    Console.WriteLine("Skipping: " + polyString);
                }
                line = inFile.ReadLine();
            }
        }
Example #30
0
        public PhyloTreeNodev2(XmlNode node, PhyloTreeNodev2 parentNode = null)
        {
            this.NodeID = ++NodeIDCounter;
            Children    = new List <PhyloTreeNodev2>();
            Mutations   = new PolymorphismCollection();
            //set the haplogroup
            haplogroup = new Haplogroup(node.Attributes.GetNamedItem("name").Value);
            var details = node.SelectSingleNode("details");

            haplogroup.AccessionId = details.Attributes.GetNamedItem("accessionNr").Value;
            if (String.IsNullOrEmpty(haplogroup.AccessionId))
            {
                NodesWithNoAccession++;
            }
            haplogroup.Reference = details.Attributes.GetNamedItem("reference").Value;
            //now copy polymorphism if needed
            if (parentNode != null)
            {
                Mutations.AddRange(parentNode.Mutations);
            }
            //now update with the mutations here
            var polys = details.SelectNodes("poly");

            foreach (XmlNode p in polys)
            {
                if (p.InnerText.Contains("X"))
                {     //System.Console.WriteLine("Skipping: " + p.InnerText);
                    continue;
                }
                var currentPoly = new Polymorphism(p.InnerText);
                Mutations.Add(currentPoly);
            }
            //now make the children
            var children = node.SelectNodes("haplogroup");

            foreach (XmlNode currentElement in children)
            {
                Children.Add(new PhyloTreeNodev2(currentElement, this));
            }
        }
Example #31
0
 public bool Equals(Polymorphism other)
 {
     return Equals(other.value, value);
 }