Exemple #1
0
 public VariantCaller(CopyNumberLikelihoodCalculator copyNumberLikelihoodCalculator, PedigreeCallerParameters callerParameters, int qualityFilterThreshold)
 {
     _copyNumberLikelihoodCalculator = copyNumberLikelihoodCalculator;
     _callerParameters       = callerParameters;
     _qualityFilterThreshold = qualityFilterThreshold;
     _genotypes = GenerateGenotypeCombinations(callerParameters.MaximumCopyNumber);
 }
Exemple #2
0
        private static List <List <Genotype> > GetOffspringGenotypes(PedigreeCallerParameters callerParameters, List <Genotype> genotypes, List <SampleId> offspringIds)
        {
            var offspringGenotypes = new List <List <Genotype> >(Convert.ToInt32(Math.Pow(genotypes.Count, offspringIds.Count)));

            GenerateOffspringGenotypes(offspringGenotypes, genotypes, offspringIds.Count, new List <Genotype>());
            if (offspringGenotypes.Count > callerParameters.MaxNumOffspringGenotypes)
            {
                offspringGenotypes.Shuffle();
                offspringGenotypes = offspringGenotypes.Take(callerParameters.MaxNumOffspringGenotypes).ToList();
            }
            return(offspringGenotypes);
        }
 public CanvasPedigreeCaller(ILogger logger, int qualityFilterThreshold, int deNovoQualityFilterThreshold,
                             PedigreeCallerParameters callerParameters, CopyNumberLikelihoodCalculator copyNumberLikelihoodCalculator,
                             IVariantCaller variantCaller, ICoverageBigWigWriter coverageBigWigWriter,
                             ICopyNumberModelFactory copyNumberModelFactory, ICopyNumberBedGraphWriter copyNumberBedGraphWriter,
                             CoverageBedGraphWriter partitionCoverageBedGraphWriter)
 {
     _logger = logger;
     _qualityFilterThreshold         = qualityFilterThreshold;
     _deNovoQualityFilterThreshold   = deNovoQualityFilterThreshold;
     _callerParameters               = callerParameters;
     _copyNumberLikelihoodCalculator = copyNumberLikelihoodCalculator;
     _variantCaller                   = variantCaller;
     _coverageBigWigWriter            = coverageBigWigWriter;
     _copyNumberModelFactory          = copyNumberModelFactory;
     _copyNumberBedGraphWriter        = copyNumberBedGraphWriter;
     _partitionCoverageBedGraphWriter = partitionCoverageBedGraphWriter;
 }
Exemple #4
0
        public static PedigreeInfo GetPedigreeInfo(ISampleMap <SampleType> kinships, PedigreeCallerParameters callerParameters)
        {
            var  allSampleIds = kinships.SampleIds.ToReadOnlyList();
            bool fullPedigree = kinships.Values.Count(x => x == SampleType.Father) == 1 &&
                                kinships.Values.Count(x => x == SampleType.Mother) == 1 &&
                                kinships.Values.Count(x => x == SampleType.Proband) == 1;
            // do not populate parents and offspring fields for partial pedigrees
            var parentsIds                        = fullPedigree ? kinships.WhereValues(value => value == SampleType.Father || value == SampleType.Mother).SampleIds.ToList() : new List <SampleId>();
            var offspringIds                      = fullPedigree ? kinships.WhereValues(value => value == SampleType.Proband || value == SampleType.Sibling).SampleIds.ToList() : new List <SampleId>();
            var otherIds                          = fullPedigree ? kinships.WhereValues(value => value == SampleType.Other).SampleIds.ToList() : kinships.SampleIds.ToList();
            var parentalPhasedGenotypes           = GeneratePhasedGenotype(callerParameters.MaximumCopyNumber);
            var parentalTotalCopyNumberGenotypes  = Enumerable.Range(0, callerParameters.MaximumCopyNumber).Select(Genotype.Create).ToList();
            var offspringPhasedGenotypes          = GetOffspringGenotypes(callerParameters, parentalPhasedGenotypes, offspringIds);
            var offspringTotalCopyNumberGenotypes = GetOffspringGenotypes(callerParameters, parentalTotalCopyNumberGenotypes, offspringIds);
            var transitionMatrix                  = GetTransitionMatrix(callerParameters.MaximumCopyNumber);

            return(new PedigreeInfo(allSampleIds, offspringIds, parentsIds, otherIds, offspringPhasedGenotypes, offspringTotalCopyNumberGenotypes, transitionMatrix));
        }