Skip to content

Fix 10 assorted medium-severity bugs across multiple files#2537

Open
sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6:fix/misc-medium-bugs
Open

Fix 10 assorted medium-severity bugs across multiple files#2537
sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6:fix/misc-medium-bugs

Conversation

@sirus20x6
Copy link
Copy Markdown

Summary

  • vcffilter.c: max_qual int→float (QUAL truncation in IndelGap filtering)
  • vcfview.c: Guard ac[1] access with n_allele >= 2 for 4 ALLELE_ALT1 paths
  • convert.c: Invert bcf_gt_is_phased for unphased * marker in hap output (2 functions)
  • convert.c: Use gt_id instead of fmt->id in GT existence check
  • convert.c: Fix allele bounds al > n_allele to al >= n_allele
  • dist.c: Fix nvalues off-by-one in dist_insert_n (counted cnt+1 instead of cnt)
  • bin.c: Prevent bin_get_idx returning -1 for values below first bin
  • read_consensus.c: Fix loop condition j<dfreq[i].len[j] to dfreq[i].len[j] (nonzero check)
  • gff.c: Fix Mt_rRNA returning GF_MT_tRNA (copy-paste error)
  • gff.c: Fix strncmp("lncRNA", 7) to length 6 — was never matching lncRNA biotype

Fixes #2496

Test plan

  • Existing test suite passes (1920/1920)
  • Verify GFF3 files with lncRNA and Mt_rRNA biotypes are parsed correctly

- vcffilter.c: Change max_qual from int to float to avoid truncation of
  fractional QUAL values
- vcfview.c: Guard args->ac[1] access with n_allele>=2 check for
  ALLELE_ALT1 filtering to prevent out-of-bounds on REF-only sites
- convert.c: Invert bcf_gt_is_phased() condition in process_gt_to_hap
  and process_gt_to_hap2 ('*' marks unphased, not phased)
- convert.c: Use gt_id instead of fmt->id for GT header existence check
  in process_pbinom
- convert.c: Fix off-by-one in allele bounds check (al >= n_allele,
  not al > n_allele) since allele index is 0-based
- dist.c: Fix double-counting in dist_insert_n; dist_insert already
  increments nvalues by 1, so add cnt-1 not cnt
- bin.c: Prevent bin_get_idx from returning -1 when value is below
  first bin boundary
- read_consensus.c: Fix loop condition from j<dfreq[i].len[j] to
  dfreq[i].len[j] (nonzero check) matching the pattern used elsewhere
- gff.c: Fix Mt_rRNA returning GF_MT_tRNA instead of GF_MT_rRNA
  (copy-paste error)
- gff.c: Fix strncmp length for "lncRNA" from 7 to 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GFF3 parsing bug causing lncRNA to be ignored

1 participant