Пример #1
0
        private static BreakEndAdjacency Flip(this BreakEndAdjacency adjacency)
        {
            var origin  = new BreakPoint(adjacency.Partner.Chromosome, adjacency.Partner.Position, !adjacency.Partner.OnReverseStrand);
            var partner = new BreakPoint(adjacency.Origin.Chromosome, adjacency.Origin.Position, !adjacency.Origin.OnReverseStrand);

            return(new BreakEndAdjacency(origin, partner));
        }
Пример #2
0
        private static BreakEndAdjacency[] CreateFromDuplication(IChromosomeInterval interval)
        {
            // 1 1 . N ]1:10]N
            var origin    = new BreakPoint(interval.Chromosome, interval.End, false);
            var remote    = new BreakPoint(interval.Chromosome, interval.Start - 1, false);
            var adjacency = new BreakEndAdjacency(origin, remote);

            return(new[] { adjacency, adjacency.Flip() });
        }
Пример #3
0
        private static BreakEndAdjacency[] CreateFromInversion(IChromosomeInterval interval)
        {
            // 1 10 . N N]1:20]
            // 1 11 . N [1:21[N
            var origin    = new BreakPoint(interval.Chromosome, interval.Start - 1, false);
            var remote    = new BreakPoint(interval.Chromosome, interval.End, true);
            var adjacency = new BreakEndAdjacency(origin, remote);

            var origin2    = new BreakPoint(interval.Chromosome, interval.End + 1, true);
            var remote2    = new BreakPoint(interval.Chromosome, interval.Start, false);
            var adjacency2 = new BreakEndAdjacency(origin2, remote2);

            return(new[] { adjacency, adjacency2 });
        }
Пример #4
0
        private static BreakEndAdjacency[] ConvertTranslocation(ISimpleVariant variant, Regex regex,
                                                                bool onReverseStrand, int partnerBracketIndex, IDictionary <string, IChromosome> refNameToChromosome)
        {
            var match = regex.Match(variant.AltAllele);

            if (!match.Success)
            {
                throw new InvalidDataException($"Unable to successfully parse the complex rearrangements for the following allele: {variant.AltAllele}");
            }

            bool   partnerOnReverseStrand = match.Groups[partnerBracketIndex].Value == ReverseBracket;
            var    partnerPosition        = Convert.ToInt32(match.Groups[3].Value);
            string partnerReferenceName   = match.Groups[2].Value;
            var    partnerChromosome      = ReferenceNameUtilities.GetChromosome(refNameToChromosome, partnerReferenceName);

            var origin  = new BreakPoint(variant.Chromosome, variant.Start, onReverseStrand);
            var partner = new BreakPoint(partnerChromosome, partnerPosition, partnerOnReverseStrand);

            return(new[] { new BreakEndAdjacency(origin, partner) });
        }
Пример #5
0
 public BreakEndAdjacency(BreakPoint origin, BreakPoint partner)
 {
     Origin  = origin;
     Partner = partner;
 }