Skip to content

Add one to each BED mask interval to work with corrected augur mask - #4

Open
huddlej wants to merge 1 commit into
mainfrom
fix-bed-offset
Open

Add one to each BED mask interval to work with corrected augur mask#4
huddlej wants to merge 1 commit into
mainfrom
fix-bed-offset

Conversation

@huddlej

@huddlej huddlej commented Apr 14, 2020

Copy link
Copy Markdown
Contributor

augur mask now reads in BED files following the standard expectation of a
zero-indexed, half-open interval such that the last value in each interval is
not included in the coordinates [1]. This commit updates the mask BED file for
this build to increment each interval by one to compensate this change in augur
mask.

[1] nextstrain/augur#512 (comment)

augur mask now reads in BED files following the standard expectation of a
zero-indexed, half-open interval such that the last value in each interval is
not included in the coordinates [1]. This commit updates the mask BED file for
this build to decrement each interval's start by one to compensate this change
in augur mask.

[1] nextstrain/augur#512 (comment)
@huddlej

huddlej commented Apr 14, 2020

Copy link
Copy Markdown
Contributor Author

Ok, this took four attempts, but I think I've worked it out. The change here is simple but the reasoning involves annoying coordinate bookkeeping. Here is an example.

In the original augur mask implementation the following BED file,

SEQ    3    5

was converted to 1-indexed positions 3, 4, 5.

The standard BED file format should read these coordinates into the 0-indexed positions 3, 4. These positions correspond to the following 1-indexed positions that would be expected by vcftools 4, 5.

To get the expected 1-indexed positions for vcftools from a BED file, we need to decrement the interval start by 1:

SEQ    2    5

This produces the 0-indexed positions of 2, 3, 4 and the 1-indexed positions of 3, 4, 5.

@huddlej
huddlej requested a review from emmahodcroft April 14, 2020 18:47
@genehack

Copy link
Copy Markdown
Contributor

@huddlej @emmahodcroft Is this still relevant, or can this old PR be closed out?

@huddlej

huddlej commented Dec 5, 2024

Copy link
Copy Markdown
Contributor Author

I defer to @emmahodcroft here, although this may eventually affect @kimandrews if she's tackling a TB build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants