Skip to content

Commit

Permalink
fix: fixing wrong validation assumption about insertions (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Mar 27, 2023
1 parent 0a6a109 commit bf027dc
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/parser/impl_validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,12 @@ impl Validateable for CdsLocEdit {
NaEdit::RefAlt { .. }
| NaEdit::DelRef { .. }
| NaEdit::Dup { .. }
| NaEdit::Ins { .. }
| NaEdit::InvRef { .. } => {
// We cannot make assumptions about reference length as we can have positon
// offsets.
Ok(())
}
NaEdit::Ins { .. } => {
if range.len() != 2 {
Err(anyhow::anyhow!(
"Locus length must be 1 for insertions ({}, {:?})",
&self,
&range
))
} else {
Ok(())
}
}
NaEdit::DelNum { count } | NaEdit::NumAlt { count, .. } | NaEdit::InvNum { count } => {
if range.len() as i32 != *count {
Err(anyhow::anyhow!(
Expand Down

0 comments on commit bf027dc

Please sign in to comment.