-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix get_end VCF parser - ENSINT-2005 #171
Conversation
- patched get_end (not for SV) - fixed test suite and re-arranged test data
About the question that PS: with the latest change request I made the or, better, if we add all the changes to |
Co-authored-by: Syed Nakib Hossain <snhossain@ebi.ac.uk>
@nakib103 - I have updated the code, basically as per your suggestions (thanks!). Would you mind to double check the logic of the changes? @TamaraNaboulsi - would you mind to have a look at these changes, should I have missed anything? Thank you both! |
@@ -310,17 +310,20 @@ sub get_end { | |||
my $self = shift; | |||
my $info = $self->get_info; | |||
my $end; | |||
my $alternatives = join(",", @{$self->get_alternatives}); | |||
if (defined($info->{END})) { | |||
$end = $info->{END}; | |||
} | |||
elsif(defined($info->{SVLEN})) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding - https://github.com/Ensembl/ensembl-io/pull/171/files#r1814776276
- The expected change would be to change the order in the if-elsif like so,
currently we have -
if (defined($info->{END})) {
$end = $info->{END};
}
elsif(defined($info->{SVLEN})) {
return unless $self->get_start;
my $svlen = (split(',',$info->{SVLEN}))[0];
$end = $self->get_start + abs($svlen) - 1;
}
change it to -
if (defined($info->{SVLEN})) {
return unless $self->get_start;
my $svlen = (split(',',$info->{SVLEN}))[0];
$end = $self->get_start + abs($svlen) - 1;
}
elsif (defined($info->{END})) {
$end = $info->{END};
}
So we calculate end using SVLEN first if available.
- Also, for
sub get_raw_end
, it is better to change it to callget_end
as all these changes should be added in get_raw_end too (but we do not want to duplicate effort) -
sub get_raw_end {
my $self = shift;
return $self->get_end;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes ... and you mentioned that before ... bear with me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sgiorgetti !
Hi @sgiorgetti , thanks a lot for the changes! There still one change request that needs to be addressed. I have added that above. Also tagging @likhitha-surapaneni as she will also be reviewing the changes. |
Re-requested review to confirm - also added @likhitha-surapaneni explicitly :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change includes:
- Updated the get_raw_end method to be equivalent to get_end
- Updated get_end method to include alternative sequences, checks for additional info (SVTYPE), and changing the order of checking SVLEN vs END
- Updated the test file with some clarity in assigning the test_sample and added a new test for loading the 7th record
Looks good to me and all requests were resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix @sgiorgetti, the code works as expected for the examples tested. Currently, testing on a larger SV VCF file to check that there are no breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with larger file and looks good to me
Thanks @likhitha-surapaneni ! Shall go ahead and merge this in. |
Changes so far
NOTES - This is still draft
release/114
get_end
andget_raw_end
are the same unless$info->{SVLEN}
get_end
Vsget_raw_end
esp. when the two differ ... when?