Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web VEP: fix incorrect variant end #1059

Draft
wants to merge 2 commits into
base: postreleasefix/112
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/Bio/EnsEMBL/Variation/VariationFeature.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,8 @@ sub to_VCF_record {
$non_acgt = 1 if $allele && $allele !~ /^[ACGTN\.]+$/;
}

my $INFO = $self->end ? 'END='.$self->end : '.';

# in/del/unbalanced
if($non_acgt || scalar keys %allele_lengths > 1) {

Expand Down Expand Up @@ -2382,7 +2384,7 @@ sub to_VCF_record {
$self->variation_name || '.',
shift @alleles,
(join ",", @alleles) || '.',
'.', '.', '.'
'.', '.', $INFO
];

}
Expand All @@ -2395,7 +2397,7 @@ sub to_VCF_record {
$self->variation_name || '.',
shift @alleles,
(join ",", @alleles) || '.',
'.', '.', '.'
'.', '.', $INFO
];
}
}
Expand Down
24 changes: 12 additions & 12 deletions modules/t/variationFeature.t
Original file line number Diff line number Diff line change
Expand Up @@ -161,50 +161,50 @@ my $sr_start = $vf->seq_region_start;

is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start, $vname, 'A', 'T', '.', '.', '.'],
[$chr, $sr_start, $vname, 'A', 'T', '.', '.', "END=$end"],
'to_VCF_record'
);

$vf->strand(-1);
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start, $vname, 'T', 'A', '.', '.', '.'],
[$chr, $sr_start, $vname, 'T', 'A', '.', '.', "END=$end"],
'to_VCF_record - rev strand'
);
$vf->strand($strand);

$vf->allele_string('A/G/T');
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start, $vname, 'A', 'G,T', '.', '.', '.'],
[$chr, $sr_start, $vname, 'A', 'G,T', '.', '.', "END=$end"],
'to_VCF_record - multiple alts'
);

$vf->allele_string('AG/CT');
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start, $vname, 'AG', 'CT', '.', '.', '.'],
[$chr, $sr_start, $vname, 'AG', 'CT', '.', '.', "END=$end"],
'to_VCF_record - balanced non-SNP'
);

$vf->allele_string('A/-');
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start - 1, $vname, 'NA', 'N', '.', '.', '.'],
[$chr, $sr_start - 1, $vname, 'NA', 'N', '.', '.', "END=$end"],
'to_VCF_record - deletion'
);

$vf->allele_string('-/A');
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start - 1, $vname, 'N', 'NA', '.', '.', '.'],
[$chr, $sr_start - 1, $vname, 'N', 'NA', '.', '.', "END=$end"],
'to_VCF_record - insertion'
);

$vf->allele_string('A/-/G');
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start - 1, $vname, 'NA', 'N,NG', '.', '.', '.'],
[$chr, $sr_start - 1, $vname, 'NA', 'N,NG', '.', '.', "END=$end"],
'to_VCF_record - mixed'
);

Expand All @@ -213,21 +213,21 @@ $vf->allele_string('HGMD_MUTATION');
$vf->{class_SO_term} = 'SNV';
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start, $vname, 'N', 'N', '.', '.', '.'],
[$chr, $sr_start, $vname, 'N', 'N', '.', '.', "END=$end"],
'to_VCF_record - unknown alleles SNV'
);

$vf->{class_SO_term} = 'insertion';
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start - 1, $vname, 'N', '<INS>', '.', '.', '.'],
[$chr, $sr_start - 1, $vname, 'N', '<INS>', '.', '.', "END=$end"],
'to_VCF_record - unknown alleles insertion'
);

$vf->{class_SO_term} = 'deletion';
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start - 1, $vname, 'NN', 'N', '.', '.', '.'],
[$chr, $sr_start - 1, $vname, 'NN', 'N', '.', '.', "END=$end"],
'to_VCF_record - unknown alleles deletion'
);

Expand All @@ -242,14 +242,14 @@ my $fully_justified_allele_str = 'ACGTGGACG/ACG/ACGTGGACGTGGACG';
$vf->allele_string($fully_justified_allele_str);
is_deeply(
$vf->to_VCF_record(),
[$chr, $sr_start, $vname, 'ACGTGGA', 'A,ACGTGGACGTGGA', '.', '.', '.'],
[$chr, $sr_start, $vname, 'ACGTGGA', 'A,ACGTGGACGTGGA', '.', '.', "END=$end"],
'to_VCF_record - fully justified allele string clipped'
);


is_deeply(
$vf->to_VCF_record(1),
[$chr, $sr_start, $vname, 'ACGTGGACG', 'ACG,ACGTGGACGTGGACG', '.', '.', '.'],
[$chr, $sr_start, $vname, 'ACGTGGACG', 'ACG,ACGTGGACGTGGACG', '.', '.', "END=$end"],
'to_VCF_record - fully justified allele string not clipped'
);

Expand Down