예제 #1
0
        private IVariant GetVariant(IChromosome chromosome, int start, int end, string refAllele, string altAllele,
                                    IInfoData infoData, VariantCategory category, bool isDecomposed, bool isRecomposed, string[] linkedVids)
        {
            string vid   = _vidCreator.Create(_sequence, category, infoData.SvType, chromosome, start, end, refAllele, altAllele, infoData.RepeatUnit);
            int    svEnd = infoData.End ?? start;

            // ReSharper disable once SwitchStatementMissingSomeCases
            switch (category)
            {
            case VariantCategory.SmallVariant:
                return(SmallVariantCreator.Create(chromosome, start, end, refAllele, altAllele, isDecomposed, isRecomposed, linkedVids, vid,
                                                  false));

            case VariantCategory.ROH:
                return(RohVariantCreator.Create(chromosome, start, svEnd, refAllele, altAllele, vid));

            case VariantCategory.SV:
                return(StructuralVariantCreator.Create(chromosome, start, svEnd, refAllele, altAllele, infoData.SvType, vid));

            case VariantCategory.CNV:
                return(CnvCreator.Create(chromosome, start, svEnd, refAllele, altAllele, vid));

            case VariantCategory.RepeatExpansion:
                return(RepeatExpansionCreator.Create(chromosome, start, svEnd, refAllele, altAllele, infoData.RefRepeatCount, vid));

            default:
                throw new NotImplementedException($"Unrecognized variant category: {category}");
            }
        }
예제 #2
0
        private IVariant GetVariant(IChromosome chromosome, string id, int start, int end, string refAllele, string altAllele, IInfoData infoData, VariantCategory category, bool isDecomposedVar, bool isRecomposed)
        {
            switch (category)
            {
            case VariantCategory.Reference:
                var refMinorGlobalMajorAllele = _refMinorProvider?.GetGlobalMajorAlleleForRefMinor(chromosome, start);
                return(ReferenceVariantCreator.Create(chromosome, start, end, refAllele, altAllele, refMinorGlobalMajorAllele));

            case VariantCategory.SmallVariant:
                return(SmallVariantCreator.Create(chromosome, start, refAllele, altAllele, isDecomposedVar, isRecomposed));

            case VariantCategory.SV:
                var svBreakEnds = infoData.SvType == VariantType.translocation_breakend ?
                                  GetTranslocationBreakends(chromosome, refAllele, altAllele, start)
                        : GetSvBreakEnds(chromosome.EnsemblName, start, infoData.SvType, infoData.End, infoData.IsInv3, infoData.IsInv5);
                return(StructuralVariantCreator.Create(chromosome, start, refAllele, altAllele, svBreakEnds, infoData, _enableVerboseTranscript));

            case VariantCategory.CNV:
                return(CnvCreator.Create(chromosome, id, start, refAllele, altAllele, infoData, _enableVerboseTranscript));

            case VariantCategory.RepeatExpansion:
                return(RepeatExpansionCreator.Create(chromosome, start, refAllele, altAllele, infoData));

            default:
                throw new NotImplementedException("Unrecognized variant category.");
            }
        }
예제 #3
0
        private IVariant GetVariant(IChromosome chromosome, int start, int end, string refAllele, string altAllele,
                                    IInfoData infoData, VariantCategory category, bool isDecomposedVar, bool isRecomposed, string[] linkedVids, string globalMajorAllele)
        {
            switch (category)
            {
            case VariantCategory.Reference:
                return(ReferenceVariantCreator.Create(chromosome, start, end, refAllele, altAllele, globalMajorAllele));

            case VariantCategory.SmallVariant:
                return(SmallVariantCreator.Create(chromosome, start, refAllele, altAllele, isDecomposedVar, isRecomposed, linkedVids));

            case VariantCategory.ROH:
                return(RohVariantCreator.Create(chromosome, start, refAllele, altAllele, infoData));

            case VariantCategory.SV:
                var svBreakEnds = infoData.SvType == VariantType.translocation_breakend ?
                                  GetTranslocationBreakends(chromosome, refAllele, altAllele, start)
                        : GetSvBreakEnds(chromosome.EnsemblName, start, infoData.SvType, infoData.End);
                return(StructuralVariantCreator.Create(chromosome, start, refAllele, altAllele, svBreakEnds, infoData));

            case VariantCategory.CNV:
                return(CnvCreator.Create(chromosome, start, refAllele, altAllele, infoData));

            case VariantCategory.RepeatExpansion:
                return(RepeatExpansionCreator.Create(chromosome, start, refAllele, altAllele, infoData));

            default:
                throw new NotImplementedException("Unrecognized variant category.");
            }
        }