From 05815c8e689d110d1b73bbd3f4ac6afdfbc930cc Mon Sep 17 00:00:00 2001 From: Timothee Cezard Date: Fri, 20 Aug 2021 19:49:31 +0100 Subject: [PATCH 1/4] Remove variant that have non ATGC bases in the reference --- variant_remapping_tools/reads_to_remapped_variants.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/variant_remapping_tools/reads_to_remapped_variants.py b/variant_remapping_tools/reads_to_remapped_variants.py index 5cfef47..1f94be7 100755 --- a/variant_remapping_tools/reads_to_remapped_variants.py +++ b/variant_remapping_tools/reads_to_remapped_variants.py @@ -8,6 +8,7 @@ from Bio.Alphabet import generic_dna import pysam +nucleotide_alphabet = {'A', 'T', 'C', 'G'} def reverse_complement(sequence): return str(Seq(sequence, generic_dna).reverse_complement()) @@ -27,6 +28,9 @@ def calculate_new_variant_definition(left_read, right_read, ref_fasta, original_ new_ref = fetch_bases(ref_fasta, left_read.reference_name, left_read.reference_end + 1, right_read.reference_start - left_read.reference_end).upper() + if len(set(new_ref).difference(nucleotide_alphabet)) != 0 : + failure_reason = 'Reference Allele not in non ACGT' + new_pos = left_read.reference_end + 1 # 1. Handle reference strand change From d1c669834cc54e7cb50a4f451a03654e1fe0fb88 Mon Sep 17 00:00:00 2001 From: Timothee Cezard Date: Fri, 20 Aug 2021 20:13:18 +0100 Subject: [PATCH 2/4] remove bowtie --- conda.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/conda.yml b/conda.yml index eb3341a..5a7e960 100755 --- a/conda.yml +++ b/conda.yml @@ -5,7 +5,6 @@ channels: - bioconda dependencies: - bedtools=2.29.2 - - bowtie2=2.4.1 - minimap2=2.17 - samtools=1.9 - bcftools=1.9 From 82359ae2467bdd6f135358bf8fab273af50ba56d Mon Sep 17 00:00:00 2001 From: Timothee Cezard Date: Fri, 20 Aug 2021 21:30:24 +0100 Subject: [PATCH 3/4] remove versions --- conda.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/conda.yml b/conda.yml index 5a7e960..0939745 100755 --- a/conda.yml +++ b/conda.yml @@ -4,9 +4,8 @@ channels: - conda-forge - bioconda dependencies: - - bedtools=2.29.2 - - minimap2=2.17 - - samtools=1.9 - - bcftools=1.9 - - bedops=2.4.39 - - tabix=0.2.6 + - bedtools + - minimap2 + - samtools + - bcftools + - tabix From bc3661f6870837f65ac5b5cc765456018d2651bc Mon Sep 17 00:00:00 2001 From: Timothee Cezard Date: Mon, 23 Aug 2021 12:55:39 +0100 Subject: [PATCH 4/4] Update variant_remapping_tools/reads_to_remapped_variants.py Co-authored-by: April Shen --- variant_remapping_tools/reads_to_remapped_variants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variant_remapping_tools/reads_to_remapped_variants.py b/variant_remapping_tools/reads_to_remapped_variants.py index 1f94be7..87b7b82 100755 --- a/variant_remapping_tools/reads_to_remapped_variants.py +++ b/variant_remapping_tools/reads_to_remapped_variants.py @@ -29,7 +29,7 @@ def calculate_new_variant_definition(left_read, right_read, ref_fasta, original_ right_read.reference_start - left_read.reference_end).upper() if len(set(new_ref).difference(nucleotide_alphabet)) != 0 : - failure_reason = 'Reference Allele not in non ACGT' + failure_reason = 'Reference Allele not in ACGT' new_pos = left_read.reference_end + 1