File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -191,9 +191,6 @@ sub next {
191
191
while (@$pre_buffer && @$buffer < $buffer_size ) {
192
192
my $vf = $pre_buffer -> [0];
193
193
194
- # # Set minimal to 1 if indel
195
- $self -> {minimal } = 1 if (defined ($vf -> {minimised }) && $vf -> {minimised });
196
-
197
194
# new chromosome
198
195
if ($prev_chr && $vf -> {chr } ne $prev_chr ) {
199
196
$self -> split_variants() if $self -> {minimal };
@@ -212,8 +209,6 @@ sub next {
212
209
if (my $parser = $self -> parser) {
213
210
while (@$buffer < $buffer_size && (my $vf = $parser -> next)) {
214
211
215
- # # Set minimal to 1 if indel
216
- $self -> {minimal } = 1 if (defined ($vf -> {minimised }) && $vf -> {minimised });
217
212
218
213
# exit the program if the maximum number of variants not ordered in the input file is reached
219
214
if (!$self -> param(' no_check_variants_order' ) &&
@@ -262,8 +257,7 @@ sub next {
262
257
die ($error_msg );
263
258
}
264
259
265
- $self -> split_variants() if $self -> {minimal };
266
-
260
+ $self -> split_variants() if $self -> {minimal } ;
267
261
return $buffer ;
268
262
}
269
263
Original file line number Diff line number Diff line change @@ -858,8 +858,16 @@ sub post_process_vfs {
858
858
# For VCF input, the allele_string is trimmed to remove anchor base, so we capture original allele
859
859
860
860
my $original_allele_string = ($vf -> {nontrimmed_allele_string } || $vf -> {allele_string });
861
- my ($ref_allele_string ,$alt_allele_string ) = split (/ \/ / , $original_allele_string );
862
- $is_non_minimised_indel = 1 unless length ($ref_allele_string ) == length ($alt_allele_string ) or $original_allele_string =~ / -/ ;
861
+ my @alleles = split (/ \/ / , $original_allele_string );
862
+ my $ref_allele_string = shift @alleles ;
863
+ my $alt_allele_count ;
864
+
865
+ foreach my $alt (@alleles ) {
866
+ if (length ($ref_allele_string ) != length ($alt ) or $original_allele_string =~ / ^-/ ){
867
+ $is_non_minimised_indel = 1;
868
+ last ;
869
+ }
870
+ }
863
871
$vf = ${$self -> minimise_alleles([$vf ])}[0] if $is_non_minimised_indel ;
864
872
}
865
873
}
@@ -961,6 +969,7 @@ sub minimise_alleles {
961
969
{
962
970
# Updating a flag to minimise multi-allelic variants in split_variants/rejoin_variants
963
971
$vf -> {minimised } = 1;
972
+ $vf -> {original_allele_string } = $vf -> {nontrimmed_allele_string } || $vf -> {allele_string };
964
973
push @return , $vf ;
965
974
}
966
975
You can’t perform that action at this time.
0 commit comments