From 763b7a38f69f1c1b87472fa655099a988c424294 Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Thu, 23 Mar 2023 12:38:56 +0100 Subject: [PATCH] fix: remove ref length validation (#57) --- src/parser/impl_validate.rs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/parser/impl_validate.rs b/src/parser/impl_validate.rs index 292c5bf..f8ad5c5 100644 --- a/src/parser/impl_validate.rs +++ b/src/parser/impl_validate.rs @@ -96,18 +96,13 @@ impl Validateable for CdsLocEdit { }; match self.edit.inner() { - NaEdit::RefAlt { reference, .. } - | NaEdit::DelRef { reference } - | NaEdit::Dup { reference } - | NaEdit::InvRef { reference } => { - if !reference.is_empty() && range.len() != reference.len() { - Err(anyhow::anyhow!( - "Length implied by coordinates must equal reference sequence length ({})", - &self - )) - } else { - Ok(()) - } + NaEdit::RefAlt { .. } + | NaEdit::DelRef { .. } + | NaEdit::Dup { .. } + | NaEdit::InvRef { .. } => { + // We cannot make assumptions about reference length as we can have positon + // offsets. + Ok(()) } NaEdit::Ins { .. } => { if range.len() != 2 {