예제 #1
0
        public void MergeAnnotations(ISupplementaryAnnotation other)
        {
            var otherAnnotation = other as OneKGenAnnotation;

            if (otherAnnotation?.OneKgAllAn == null)
            {
                return;
            }

            if (OneKgAllAc == null)
            {
                AncestralAllele = otherAnnotation.AncestralAllele;

                OneKgAllAn = otherAnnotation.OneKgAllAn;
                OneKgAfrAn = otherAnnotation.OneKgAfrAn;
                OneKgAmrAn = otherAnnotation.OneKgAmrAn;
                OneKgEurAn = otherAnnotation.OneKgEurAn;
                OneKgEasAn = otherAnnotation.OneKgEasAn;
                OneKgSasAn = otherAnnotation.OneKgSasAn;

                OneKgAllAc = otherAnnotation.OneKgAllAc;
                OneKgAfrAc = otherAnnotation.OneKgAfrAc;
                OneKgAmrAc = otherAnnotation.OneKgAmrAc;
                OneKgEurAc = otherAnnotation.OneKgEurAc;
                OneKgEasAc = otherAnnotation.OneKgEasAc;
                OneKgSasAc = otherAnnotation.OneKgSasAc;
            }
            else
            {
                HasConflicts = true;
                Clear();
            }
        }
예제 #2
0
        public void MergeAnnotations(ISupplementaryAnnotation other)
        {
            var otherAnnotation = other as DbSnpAnnotation;

            if (otherAnnotation?.DbSnp == null || otherAnnotation.DbSnp.Count == 0)
            {
                return;
            }

            DbSnp.AddRange(otherAnnotation.DbSnp.Where(x => !DbSnp.Contains(x)));

            if (otherAnnotation.AltAlleleFreq > double.MinValue)
            {
                AltAlleleFreq = otherAnnotation.AltAlleleFreq;
            }
        }
예제 #3
0
        public void MergeAnnotations(ISupplementaryAnnotation other)
        {
            var otherAnnotation = other as ExacAnnotation;

            if (otherAnnotation?.ExacAllAn == null || otherAnnotation.ExacAllAn.Value == 0 || HasConflicts)
            {
                return;
            }

            if (ExacAllAn == null || ExacAllAn.Value == 0)
            {
                ExacCoverage = otherAnnotation.ExacCoverage;

                ExacAllAn = otherAnnotation.ExacAllAn;
                ExacAfrAn = otherAnnotation.ExacAfrAn;
                ExacAmrAn = otherAnnotation.ExacAmrAn;
                ExacEasAn = otherAnnotation.ExacEasAn;
                ExacFinAn = otherAnnotation.ExacFinAn;
                ExacNfeAn = otherAnnotation.ExacNfeAn;
                ExacOthAn = otherAnnotation.ExacOthAn;
                ExacSasAn = otherAnnotation.ExacSasAn;

                ExacAllAc = otherAnnotation.ExacAllAc;
                ExacAfrAc = otherAnnotation.ExacAfrAc;
                ExacAmrAc = otherAnnotation.ExacAmrAc;
                ExacEasAc = otherAnnotation.ExacEasAc;
                ExacFinAc = otherAnnotation.ExacFinAc;
                ExacNfeAc = otherAnnotation.ExacNfeAc;
                ExacOthAc = otherAnnotation.ExacOthAc;
                ExacSasAc = otherAnnotation.ExacSasAc;
            }
            else
            {
                // this is a conflict
                HasConflicts = true;
                Clear();
            }
        }
예제 #4
0
        public void MergeAnnotations(ISupplementaryAnnotation other)
        {
            var otherAnnotation = other as EvsAnnotation;

            if (otherAnnotation?.NumEvsSamples == null)
            {
                return;
            }

            if (NumEvsSamples == null)
            {
                EvsAll = otherAnnotation.EvsAll;
                EvsAfr = otherAnnotation.EvsAfr;
                EvsEur = otherAnnotation.EvsEur;

                EvsCoverage   = otherAnnotation.EvsCoverage;
                NumEvsSamples = otherAnnotation.NumEvsSamples;
            }
            else
            {
                HasConflicts = true;
                Clear();
            }
        }
        public void AddExternalDataToAsa(DataSourceCommon.DataSource dataSource, string altAllele, ISupplementaryAnnotation annotation)
        {
            if (annotation == null)
            {
                return;
            }
            var dataSourceIndex = DataSourceCommon.GetIndex(dataSource);

            if (!SaPosition.AlleleSpecificAnnotations.ContainsKey(altAllele))
            {
                SaPosition.AlleleSpecificAnnotations[altAllele] = new AlleleSpecificAnnotation();
                DataSourceCommon.AddDataSource(dataSource, ref SaPosition.AlleleSpecificAnnotations[altAllele].SaDataSourceFlag);
                SaPosition.AlleleSpecificAnnotations[altAllele].Annotations[dataSourceIndex] =
                    annotation;
                return;
            }

            if (!SaPosition.AlleleSpecificAnnotations[altAllele].HasDataSource(dataSource))
            {
                DataSourceCommon.AddDataSource(dataSource, ref SaPosition.AlleleSpecificAnnotations[altAllele].SaDataSourceFlag);

                SaPosition.AlleleSpecificAnnotations[altAllele].Annotations[dataSourceIndex] =
                    annotation;
                return;
            }

            SaPosition.AlleleSpecificAnnotations[altAllele].Annotations[dataSourceIndex].MergeAnnotations(annotation);
        }