Beispiel #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}");
            }
        }
Beispiel #2
0
        public static IVariant[] Create(IVariantIdCreator vidCreator, ISequence sequence, IChromosome chromosome, int start, int end,
                                        string refAllele, string altAllele, string globalMajorAllele)
        {
            bool isRefMinor = end == start && globalMajorAllele != null;

            if (!isRefMinor)
            {
                return(null);
            }

            string vid = vidCreator.Create(sequence, VariantCategory.SmallVariant, null, chromosome, start, end, refAllele, altAllele, null);

            return(new[]
            {
                SmallVariantCreator.Create(chromosome, start, end, globalMajorAllele, refAllele, false, false, null, vid, true)
            });
        }