Esempio n. 1
0
        public string GetVcfString()
        {
            var freq = ComputingUtilities.ComputeFrequency(AllAlleleNumber, AllAlleleCount) ?? "";
            var ancestralAlleleString = AncestralAllele ?? "";

            return(freq + ";" + ancestralAlleleString);
        }
Esempio n. 2
0
        public string GetJsonString()
        {
            var sb         = StringBuilderCache.Acquire();
            var jsonObject = new JsonObject(sb);

            jsonObject.AddStringValue("ancestralAllele", AncestralAllele);
            jsonObject.AddStringValue("allAf", ComputingUtilities.ComputeFrequency(AllAlleleNumber, AllAlleleCount), false);
            jsonObject.AddStringValue("afrAf", ComputingUtilities.ComputeFrequency(AfrAlleleNumber, AfrAlleleCount), false);
            jsonObject.AddStringValue("amrAf", ComputingUtilities.ComputeFrequency(AmrAlleleNumber, AmrAlleleCount), false);
            jsonObject.AddStringValue("easAf", ComputingUtilities.ComputeFrequency(EasAlleleNumber, EasAlleleCount), false);
            jsonObject.AddStringValue("eurAf", ComputingUtilities.ComputeFrequency(EurAlleleNumber, EurAlleleCount), false);
            jsonObject.AddStringValue("sasAf", ComputingUtilities.ComputeFrequency(SasAlleleNumber, SasAlleleCount), false);

            jsonObject.AddIntValue("allAn", AllAlleleNumber);
            jsonObject.AddIntValue("afrAn", AfrAlleleNumber);
            jsonObject.AddIntValue("amrAn", AmrAlleleNumber);
            jsonObject.AddIntValue("easAn", EasAlleleNumber);
            jsonObject.AddIntValue("eurAn", EurAlleleNumber);
            jsonObject.AddIntValue("sasAn", SasAlleleNumber);

            jsonObject.AddIntValue("allAc", AllAlleleCount);
            jsonObject.AddIntValue("afrAc", AfrAlleleCount);
            jsonObject.AddIntValue("amrAc", AmrAlleleCount);
            jsonObject.AddIntValue("easAc", EasAlleleCount);
            jsonObject.AddIntValue("eurAc", EurAlleleCount);
            jsonObject.AddIntValue("sasAc", SasAlleleCount);

            return(StringBuilderCache.GetStringAndRelease(sb));
        }
Esempio n. 3
0
        public string GetJsonString()
        {
            var sb         = StringBuilderCache.Acquire();
            var jsonObject = new JsonObject(sb);

            jsonObject.AddIntValue("coverage", Coverage);
            if (HasFailedFilters)
            {
                jsonObject.AddBoolValue("failedFilter", true);
            }

            jsonObject.AddStringValue("allAf", ComputingUtilities.ComputeFrequency(AllAlleleNumber, AllAlleleCount), false);
            jsonObject.AddIntValue("allAn", AllAlleleNumber);
            jsonObject.AddIntValue("allAc", AllAlleleCount);
            jsonObject.AddIntValue("allHc", AllHomCount);

            jsonObject.AddStringValue("afrAf", ComputingUtilities.ComputeFrequency(AfrAlleleNumber, AfrAlleleCount), false);
            jsonObject.AddIntValue("afrAn", AfrAlleleNumber);
            jsonObject.AddIntValue("afrAc", AfrAlleleCount);
            jsonObject.AddIntValue("afrHc", AfrHomCount);

            jsonObject.AddStringValue("amrAf", ComputingUtilities.ComputeFrequency(AmrAlleleNumber, AmrAlleleCount), false);
            jsonObject.AddIntValue("amrAn", AmrAlleleNumber);
            jsonObject.AddIntValue("amrAc", AmrAlleleCount);
            jsonObject.AddIntValue("amrHc", AmrHomCount);

            jsonObject.AddStringValue("easAf", ComputingUtilities.ComputeFrequency(EasAlleleNumber, EasAlleleCount), false);
            jsonObject.AddIntValue("easAn", EasAlleleNumber);
            jsonObject.AddIntValue("easAc", EasAlleleCount);
            jsonObject.AddIntValue("easHc", EasHomCount);

            jsonObject.AddStringValue("finAf", ComputingUtilities.ComputeFrequency(FinAlleleNumber, FinAlleleCount), false);
            jsonObject.AddIntValue("finAn", FinAlleleNumber);
            jsonObject.AddIntValue("finAc", FinAlleleCount);
            jsonObject.AddIntValue("finHc", FinHomCount);

            jsonObject.AddStringValue("nfeAf", ComputingUtilities.ComputeFrequency(NfeAlleleNumber, NfeAlleleCount), false);
            jsonObject.AddIntValue("nfeAn", NfeAlleleNumber);
            jsonObject.AddIntValue("nfeAc", NfeAlleleCount);
            jsonObject.AddIntValue("nfeHc", NfeHomCount);

            jsonObject.AddStringValue("asjAf", ComputingUtilities.ComputeFrequency(AsjAlleleNumber, AsjAlleleCount), false);
            jsonObject.AddIntValue("asjAn", AsjAlleleNumber);
            jsonObject.AddIntValue("asjAc", AsjAlleleCount);
            jsonObject.AddIntValue("asjHc", AsjHomCount);

            jsonObject.AddStringValue("sasAf", ComputingUtilities.ComputeFrequency(SasAlleleNumber, SasAlleleCount), false);
            jsonObject.AddIntValue("sasAn", SasAlleleNumber);
            jsonObject.AddIntValue("sasAc", SasAlleleCount);
            jsonObject.AddIntValue("sasHc", SasHomCount);

            jsonObject.AddStringValue("othAf", ComputingUtilities.ComputeFrequency(OthAlleleNumber, OthAlleleCount), false);
            jsonObject.AddIntValue("othAn", OthAlleleNumber);
            jsonObject.AddIntValue("othAc", OthAlleleCount);
            jsonObject.AddIntValue("othHc", OthHomCount);

            return(StringBuilderCache.GetStringAndRelease(sb));
        }
Esempio n. 4
0
        public string GetJsonString()
        {
            var sb         = new StringBuilder();
            var jsonObject = new JsonObject(sb);

            jsonObject.AddStringValue("allAf", ComputingUtilities.ComputeFrequency(_alleleNum, _alleleCount), false);
            jsonObject.AddIntValue("allAn", _alleleNum);
            jsonObject.AddIntValue("allAc", _alleleCount);
            jsonObject.AddIntValue("allHc", _homCount);
            if (_failedFilter)
            {
                jsonObject.AddBoolValue("failedFilter", true);
            }

            return(sb.ToString());
        }
Esempio n. 5
0
        public string GetJsonString()
        {
            var sb         = StringBuilderCache.Acquire();
            var jsonObject = new JsonObject(sb);

            jsonObject.AddIntValue("coverage", Coverage);
            jsonObject.AddStringValue("allAf", ComputingUtilities.ComputeFrequency(AllAlleleNumber, AllAlleleCount), false);
            jsonObject.AddStringValue("afrAf", ComputingUtilities.ComputeFrequency(AfrAlleleNumber, AfrAlleleCount), false);
            jsonObject.AddStringValue("amrAf", ComputingUtilities.ComputeFrequency(AmrAlleleNumber, AmrAlleleCount), false);
            jsonObject.AddStringValue("easAf", ComputingUtilities.ComputeFrequency(EasAlleleNumber, EasAlleleCount), false);
            jsonObject.AddStringValue("finAf", ComputingUtilities.ComputeFrequency(FinAlleleNumber, FinAlleleCount), false);
            jsonObject.AddStringValue("nfeAf", ComputingUtilities.ComputeFrequency(NfeAlleleNumber, NfeAlleleCount), false);
            jsonObject.AddStringValue("sasAf", ComputingUtilities.ComputeFrequency(SasAlleleNumber, SasAlleleCount), false);
            jsonObject.AddStringValue("othAf", ComputingUtilities.ComputeFrequency(OthAlleleNumber, OthAlleleCount), false);

            if (AllAlleleNumber != null)
            {
                jsonObject.AddIntValue("allAn", AllAlleleNumber.Value);
            }
            if (AfrAlleleNumber != null)
            {
                jsonObject.AddIntValue("afrAn", AfrAlleleNumber.Value);
            }
            if (AmrAlleleNumber != null)
            {
                jsonObject.AddIntValue("amrAn", AmrAlleleNumber.Value);
            }
            if (EasAlleleNumber != null)
            {
                jsonObject.AddIntValue("easAn", EasAlleleNumber.Value);
            }
            if (FinAlleleNumber != null)
            {
                jsonObject.AddIntValue("finAn", FinAlleleNumber.Value);
            }
            if (NfeAlleleNumber != null)
            {
                jsonObject.AddIntValue("nfeAn", NfeAlleleNumber.Value);
            }
            if (SasAlleleNumber != null)
            {
                jsonObject.AddIntValue("sasAn", SasAlleleNumber.Value);
            }
            if (OthAlleleNumber != null)
            {
                jsonObject.AddIntValue("othAn", OthAlleleNumber.Value);
            }

            if (AllAlleleCount != null)
            {
                jsonObject.AddIntValue("allAc", AllAlleleCount.Value);
            }
            if (AfrAlleleCount != null)
            {
                jsonObject.AddIntValue("afrAc", AfrAlleleCount.Value);
            }
            if (AmrAlleleCount != null)
            {
                jsonObject.AddIntValue("amrAc", AmrAlleleCount.Value);
            }
            if (EasAlleleCount != null)
            {
                jsonObject.AddIntValue("easAc", EasAlleleCount.Value);
            }
            if (FinAlleleCount != null)
            {
                jsonObject.AddIntValue("finAc", FinAlleleCount.Value);
            }
            if (NfeAlleleCount != null)
            {
                jsonObject.AddIntValue("nfeAc", NfeAlleleCount.Value);
            }
            if (SasAlleleCount != null)
            {
                jsonObject.AddIntValue("sasAc", SasAlleleCount.Value);
            }
            if (OthAlleleCount != null)
            {
                jsonObject.AddIntValue("othAc", OthAlleleCount.Value);
            }

            return(StringBuilderCache.GetStringAndRelease(sb));
        }