-
Notifications
You must be signed in to change notification settings - Fork 111
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
Do not read contig and filter header lines on VCF ingest #189
Do not read contig and filter header lines on VCF ingest #189
Conversation
Signed-off-by: Karen Feng <[email protected]>
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.
Some minor comments, feel free to merge after addressing
headers.flatMap { header => | ||
val infoHeaderLines = header.getInfoHeaderLines.asScala | ||
val formatHeaderLines = header.getFormatHeaderLines.asScala | ||
val contigHeaderLines = header.getContigLines.asScala | ||
val filterHeaderLines = header.getFilterLines.asScala | ||
val contigHeaderLines = |
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.
nit: can you consolidate into a single if else
? Generally it's less error-prone to check flags in as few places as possible.
@@ -103,19 +103,23 @@ object VCFHeaderUtils extends GlowLogging { | |||
} | |||
|
|||
/** | |||
* Find the unique header lines from an RDD of VCF headers. | |||
* Find the unique desired header lines from an RDD of VCF headers. | |||
* If lines of the same class found with the same ID, we pick one unless they are incompatible. | |||
* If there are incompatible lines, [[IllegalArgumentException]] is thrown. | |||
* Incompatible lines are: | |||
* - FORMAT or INFO lines with the same ID but different types or counts | |||
* - contig lines with the same ID but different lengths |
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.
Add a brief comment about the meaning of getNonSchemaHeaderLines
.
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
==========================================
- Coverage 93.67% 93.64% -0.03%
==========================================
Files 86 86
Lines 4077 4077
Branches 379 365 -14
==========================================
- Hits 3819 3818 -1
- Misses 258 259 +1
Continue to review full report at Codecov.
|
Signed-off-by: Karen Feng <[email protected]>
…#189) * Do not read contig and filter header lines on VCF ingest Signed-off-by: Karen Feng <[email protected]> * Cleanup Signed-off-by: Karen Feng <[email protected]> Signed-off-by: Henry Davidge <[email protected]>
What changes are proposed in this pull request?
With #173, VCF ingest now fails when merging files with contig lines that are missing the
length
field. This is resolved in newer versions of the HTSJDK as of samtools/htsjdk#1418.As we don't need contig and filter header lines for schema inference during VCF ingest, we can skip reading them entirely. This PR adds an option to skip reading non-schema header lines while reading unique header lines.
How is this patch tested?