Skip to content

Commit f6945ad

Browse files
committed
Filter for only FORMAT headers
1 parent 71489a6 commit f6945ad

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

vcf/src/vcf.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ pub fn parse_vcf(source: impl BufRead) -> Result<VCF, VCFError> {
180180
Err(e) => Err(VCFError::IoError(e)),
181181
}
182182
)
183+
.filter(
184+
|result| match result {
185+
Ok(header) if header.key == "FORMAT" => true,
186+
Err(_) => true,
187+
_ => false,
188+
}
189+
)
183190
.collect::<Result<Vec<_>, _>>()?;
184191
Ok(
185192
VCF {

0 commit comments

Comments
 (0)