private List <MitoMapSvItem> ExtractSvItemFromDeletionsSingle(List <string> info) { var junctions = info[0].OptimizedSplit(':').Select(int.Parse).ToList(); var start = junctions[0] + 1; var end = junctions[1] - 1; if (end < start) { throw new ArgumentOutOfRangeException($"Deletions with end position smaller than start position: start: {start}, end: {end}"); } var calculatedSize = end - start + 1; var size = int.Parse(info[1].Substring(1)); if (size <= MitomapParsingParameters.LargeDeletionCutoff) { return(new List <MitoMapSvItem>()); } if (calculatedSize != size) { Console.WriteLine($"Incorrect size of deleted region: size of {start}-{end} should be {calculatedSize}, provided size is {size}. Provided size is used."); } var refSequence = _sequenceProvider.Sequence.Substring(start - 1, size); var newStart = _variantAligner.LeftAlign(start, refSequence, "").Item1; if (start != newStart) { Console.WriteLine($"Deletion of {size} bps. Original start start position: {start}; new position after left-alignment {newStart}."); } var mitoMapSvItem = new MitoMapSvItem(_chromosome, newStart, newStart + size - 1, VariantType.deletion); return(new List <MitoMapSvItem> { mitoMapSvItem }); }
public void LeftAlignmentAlleleChange(string chromosome, int refPos, string refAllele, string altAllele, int alignedPos, string alignedRefAllele, string alignedAltAllele) { var sequence = new VariantAligner.ReferenceSequence("GGCTAGCTAGCTTATTATATAT"); var aligner = new VariantAligner(sequence); var leftAlignedVariant = aligner.LeftAlign(refPos, refAllele, altAllele); Assert.Equal(Tuple.Create(alignedPos, alignedRefAllele, alignedAltAllele), leftAlignedVariant); }
public void LeftAlignmentTest(string chromosome, int refPos, string refAllele, string altAllele, int alignedPos, string alignedRefAllele, string alignedAltAllele) { var sequence = new VariantAligner.ReferenceSequence("TGGGGTGAGAATCATTGACATAATTGTAACAGGATAATATTCAGGAAATATGGAGATAAATAATTTTCTTCTCGACATTAAAAAAATCTAATAAAAAGTTTTATGTTTTCCCCTAACTCAGGGTCATCAGCCTTCAAGCTTCAGTCTCTGTGTGTTCACAGGTGCTGTAAACACACGCATCACTACTAATATCCCACTTCAGTGCTATTGCTGCTCCCAAAACTCCAGGTATTTTTAACCTTATAAACCTCCAGAATAATGAGACCACTGGGTTCAGTAAATTGCTTTGTTTTGAAGCACTATTAGACAAAGTGGGAGACTAGAAGATAAATCTGTCAATGACATGTCCTTTAAGACTACTTAGATTTTGTTGAATTTGTGGATCATTCCTTACTTGAGCAAATGGTAAATTAACTCTCTCTTTTCTCTCTCTCTCTAGCTGGCACACTTTTTCCAGTAGCCATTCTACTTGGTATGCTTACTTATCAGCTGTCCTCCAGGGGCCTCACATTAGATGTTTCTCTGA", 106514); var aligner = new VariantAligner(sequence); var leftAlignedVariant = aligner.LeftAlign(refPos, refAllele, altAllele); Assert.Equal(Tuple.Create(alignedPos, alignedRefAllele, alignedAltAllele), leftAlignedVariant); }
public void AlleleChangeDeletion() { var sequence = new VariantAligner.ReferenceSequence("AAAAAAAAAATTTTTTTTTTGGGGGGCTATTAACCCAAAAAAAAAATTTTTTTTTTGGGGGG"); var aligner = new VariantAligner(sequence); var leftAlignedVariant = aligner.LeftAlign(29, "ATTA", "A"); Assert.Equal(Tuple.Create(28, "TAT", ""), leftAlignedVariant); var rightAlingedVariant = aligner.RightAlign(27, "CTAT", "C"); Assert.Equal(Tuple.Create(30, "TTA", ""), rightAlingedVariant); }