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."); } }
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."); } }
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}"); } }
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) }); }