Exemplo n.º 1
0
        public void GetOriginalVcfIndexes()
        {
            var originalVar1 = new Pisces.Domain.Models.Alleles.CalledAllele()
            {
                ReferencePosition = 1
            };
            var originalVar10 = new Pisces.Domain.Models.Alleles.CalledAllele()
            {
                ReferencePosition = 10
            };

            var nbhd = new VcfNeighborhood(new VariantCallingParameters(), 0, "chr1", new VariantSite(123)
            {
                OriginalAlleleFromVcf = originalVar1
            }
                                           , new VariantSite(123)
            {
                OriginalAlleleFromVcf = originalVar10
            }, "T");

            var originalVcfIndexes = nbhd.GetOriginalVcfVariants();

            Assert.Equal(2, originalVcfIndexes.Count);
            Assert.Equal(1, originalVcfIndexes[0].ReferencePosition);
            Assert.Equal(10, originalVcfIndexes[1].ReferencePosition);
        }
Exemplo n.º 2
0
        public CalledAllele(CalledAllele originalAllele)
        {
            Chromosome          = originalAllele.Chromosome;
            ReferencePosition   = originalAllele.ReferencePosition;
            ReferenceAllele     = originalAllele.ReferenceAllele;
            AlternateAllele     = originalAllele.AlternateAllele;
            Genotype            = originalAllele.Genotype;
            GenotypeQscore      = originalAllele.GenotypeQscore;
            VariantQscore       = originalAllele.VariantQscore;
            NumNoCalls          = originalAllele.NumNoCalls;
            NoiseLevelApplied   = originalAllele.NoiseLevelApplied;
            TotalCoverage       = originalAllele.TotalCoverage;
            AlleleSupport       = originalAllele.AlleleSupport;
            WellAnchoredSupport = originalAllele.WellAnchoredSupport;
            ReferenceSupport    = originalAllele.ReferenceSupport;
            Type = originalAllele.Type;
            SupportByDirection             = new int[Constants.NumDirectionTypes];
            WellAnchoredSupportByDirection = new int[Constants.NumDirectionTypes];
            EstimatedCoverageByDirection   = new int[Constants.NumDirectionTypes];
            ReadCollapsedCountsMut         = new int[Constants.NumReadCollapsedTypes];
            ReadCollapsedCountTotal        = new int[Constants.NumReadCollapsedTypes];
            StrandBiasResults        = BiasResults.DeepCopy(originalAllele.StrandBiasResults);
            UnanchoredCoverageWeight = originalAllele.UnanchoredCoverageWeight;
            ConfidentCoverageStart   = originalAllele.ConfidentCoverageStart;
            ConfidentCoverageEnd     = originalAllele.ConfidentCoverageEnd;
            SuspiciousCoverageStart  = originalAllele.SuspiciousCoverageStart;
            SuspiciousCoverageEnd    = originalAllele.SuspiciousCoverageEnd;

            Filters = new List <FilterType>();

            foreach (var filter in originalAllele.Filters)
            {
                Filters.Add(filter);
            }

            for (int i = 0; i < Constants.NumDirectionTypes; i++)
            {
                SupportByDirection[i]             = originalAllele.SupportByDirection[i];
                WellAnchoredSupportByDirection[i] = originalAllele.WellAnchoredSupportByDirection[i];
                EstimatedCoverageByDirection[i]   = originalAllele.EstimatedCoverageByDirection[i];
            }

            for (int i = 0; i < Constants.NumReadCollapsedTypes; i++)
            {
                ReadCollapsedCountsMut[i]  = originalAllele.ReadCollapsedCountsMut[i];
                ReadCollapsedCountTotal[i] = originalAllele.ReadCollapsedCountTotal[i];
            }
        }
Exemplo n.º 3
0
        public static CalledAllele DeepCopy(CalledAllele originalAllele)
        {
            if (originalAllele == null)
            {
                return(null);
            }

            var allele = new CalledAllele
            {
                Chromosome        = originalAllele.Chromosome,
                Coordinate        = originalAllele.Coordinate,
                Reference         = originalAllele.Reference,
                Alternate         = originalAllele.Alternate,
                Genotype          = originalAllele.Genotype,
                GenotypeQscore    = originalAllele.GenotypeQscore,
                VariantQscore     = originalAllele.VariantQscore,
                FractionNoCalls   = originalAllele.FractionNoCalls,
                NoiseLevelApplied = originalAllele.NoiseLevelApplied,
                TotalCoverage     = originalAllele.TotalCoverage,
                AlleleSupport     = originalAllele.AlleleSupport,
                ReferenceSupport  = originalAllele.ReferenceSupport,
                Type = originalAllele.Type,
                SupportByDirection           = new int[Constants.NumDirectionTypes],
                EstimatedCoverageByDirection = new int[Constants.NumDirectionTypes],
                ReadCollapsedCounts          = new int[Constants.NumReadCollapsedTypes],
                StrandBiasResults            = StrandBiasResults.DeepCopy(originalAllele.StrandBiasResults),
                Filters = new List <FilterType>()
            };

            foreach (var filter in originalAllele.Filters)
            {
                allele.Filters.Add(filter);
            }

            for (int i = 0; i < Constants.NumDirectionTypes; i++)
            {
                allele.SupportByDirection[i]           = originalAllele.SupportByDirection[i];
                allele.EstimatedCoverageByDirection[i] = originalAllele.EstimatedCoverageByDirection[i];
                allele.ReadCollapsedCounts[i]          = originalAllele.ReadCollapsedCounts[i];
            }
            return(allele);
        }
Exemplo n.º 4
0
 public AggregateAllele(CalledAllele originalAllele, List <CalledAllele> componentAlleles) : base(originalAllele)
 {
     ComponentAlleles = componentAlleles;
 }
Exemplo n.º 5
0
 public bool IsCoLocatedAllele(CalledAllele otherAllele)
 {
     return((otherAllele.Chromosome == Chromosome) &&
            (otherAllele.ReferencePosition == ReferencePosition));
 }