Skip to content

Commit

Permalink
Filter for only FORMAT headers
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCurtis committed Sep 5, 2023
1 parent 71489a6 commit f6945ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vcf/src/vcf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ pub fn parse_vcf(source: impl BufRead) -> Result<VCF, VCFError> {
Err(e) => Err(VCFError::IoError(e)),
}
)
.filter(
|result| match result {
Ok(header) if header.key == "FORMAT" => true,
Err(_) => true,
_ => false,
}
)
.collect::<Result<Vec<_>, _>>()?;
Ok(
VCF {
Expand Down

0 comments on commit f6945ad

Please sign in to comment.