bio-grumpy 1.1.2__tar.gz → 1.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/Cargo.lock +30 -30
  2. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/Cargo.toml +1 -1
  3. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/PKG-INFO +1 -1
  4. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/src/difference.rs +80 -38
  5. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/src/genome.rs +42 -47
  6. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/src/vcf.rs +10 -3
  7. bio_grumpy-1.1.3/test/intracellulare.vcf +20 -0
  8. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/.github/workflows/release.yaml +0 -0
  9. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/.github/workflows/test.yaml +0 -0
  10. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/.gitignore +0 -0
  11. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/LICENSE +0 -0
  12. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/README-python.md +0 -0
  13. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/README.md +0 -0
  14. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/pyproject.toml +0 -0
  15. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/reference/MN908947.3.gb +0 -0
  16. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/reference/NC_000962.3.gbk +0 -0
  17. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/reference/NZ_CP085945.1.gbk +0 -0
  18. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/reference/TEST-DNA.gbk +0 -0
  19. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/src/common.rs +0 -0
  20. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/src/gene.rs +0 -0
  21. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/src/lib.rs +0 -0
  22. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/src/main.rs +0 -0
  23. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/TEST-DNA-4-minor.vcf +0 -0
  24. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/TEST-DNA-4.vcf +0 -0
  25. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/TEST-DNA-misc-indel.vcf +0 -0
  26. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/TEST-DNA.vcf +0 -0
  27. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/complex.vcf +0 -0
  28. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/dummy.vcf +0 -0
  29. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/minor-populations-revcomp-AD.vcf +0 -0
  30. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/minor-populations-revcomp.vcf +0 -0
  31. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/revcomp-del-first-pos.vcf +0 -0
  32. {bio_grumpy-1.1.2 → bio_grumpy-1.1.3}/test/tb-snp-after-del.vcf +0 -0
@@ -78,9 +78,9 @@ checksum = "b0fc239e0f6cb375d2402d48afb92f76f5404fd1df208a41930ec81eda078bea"
78
78
 
79
79
  [[package]]
80
80
  name = "clap"
81
- version = "4.5.53"
81
+ version = "4.5.56"
82
82
  source = "registry+https://github.com/rust-lang/crates.io-index"
83
- checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8"
83
+ checksum = "a75ca66430e33a14957acc24c5077b503e7d374151b2b4b3a10c83b4ceb4be0e"
84
84
  dependencies = [
85
85
  "clap_builder",
86
86
  "clap_derive",
@@ -88,9 +88,9 @@ dependencies = [
88
88
 
89
89
  [[package]]
90
90
  name = "clap_builder"
91
- version = "4.5.53"
91
+ version = "4.5.56"
92
92
  source = "registry+https://github.com/rust-lang/crates.io-index"
93
- checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00"
93
+ checksum = "793207c7fa6300a0608d1080b858e5fdbe713cdc1c8db9fb17777d8a13e63df0"
94
94
  dependencies = [
95
95
  "anstream",
96
96
  "anstyle",
@@ -100,21 +100,21 @@ dependencies = [
100
100
 
101
101
  [[package]]
102
102
  name = "clap_derive"
103
- version = "4.5.49"
103
+ version = "4.5.55"
104
104
  source = "registry+https://github.com/rust-lang/crates.io-index"
105
- checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671"
105
+ checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5"
106
106
  dependencies = [
107
107
  "heck",
108
108
  "proc-macro2",
109
109
  "quote",
110
- "syn 2.0.111",
110
+ "syn 2.0.114",
111
111
  ]
112
112
 
113
113
  [[package]]
114
114
  name = "clap_lex"
115
- version = "0.7.6"
115
+ version = "0.7.7"
116
116
  source = "registry+https://github.com/rust-lang/crates.io-index"
117
- checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
117
+ checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32"
118
118
 
119
119
  [[package]]
120
120
  name = "colorchoice"
@@ -192,7 +192,7 @@ dependencies = [
192
192
 
193
193
  [[package]]
194
194
  name = "grumpy"
195
- version = "1.1.2"
195
+ version = "1.1.3"
196
196
  dependencies = [
197
197
  "clap",
198
198
  "gb-io",
@@ -236,9 +236,9 @@ dependencies = [
236
236
 
237
237
  [[package]]
238
238
  name = "libc"
239
- version = "0.2.177"
239
+ version = "0.2.180"
240
240
  source = "registry+https://github.com/rust-lang/crates.io-index"
241
- checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
241
+ checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
242
242
 
243
243
  [[package]]
244
244
  name = "lock_api"
@@ -251,9 +251,9 @@ dependencies = [
251
251
 
252
252
  [[package]]
253
253
  name = "log"
254
- version = "0.4.28"
254
+ version = "0.4.29"
255
255
  source = "registry+https://github.com/rust-lang/crates.io-index"
256
- checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
256
+ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
257
257
 
258
258
  [[package]]
259
259
  name = "memchr"
@@ -376,9 +376,9 @@ dependencies = [
376
376
 
377
377
  [[package]]
378
378
  name = "portable-atomic"
379
- version = "1.11.1"
379
+ version = "1.13.0"
380
380
  source = "registry+https://github.com/rust-lang/crates.io-index"
381
- checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
381
+ checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
382
382
 
383
383
  [[package]]
384
384
  name = "precomputed-hash"
@@ -422,9 +422,9 @@ dependencies = [
422
422
 
423
423
  [[package]]
424
424
  name = "proc-macro2"
425
- version = "1.0.103"
425
+ version = "1.0.106"
426
426
  source = "registry+https://github.com/rust-lang/crates.io-index"
427
- checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
427
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
428
428
  dependencies = [
429
429
  "unicode-ident",
430
430
  ]
@@ -475,7 +475,7 @@ dependencies = [
475
475
  "proc-macro2",
476
476
  "pyo3-macros-backend",
477
477
  "quote",
478
- "syn 2.0.111",
478
+ "syn 2.0.114",
479
479
  ]
480
480
 
481
481
  [[package]]
@@ -488,14 +488,14 @@ dependencies = [
488
488
  "proc-macro2",
489
489
  "pyo3-build-config",
490
490
  "quote",
491
- "syn 2.0.111",
491
+ "syn 2.0.114",
492
492
  ]
493
493
 
494
494
  [[package]]
495
495
  name = "quote"
496
- version = "1.0.42"
496
+ version = "1.0.44"
497
497
  source = "registry+https://github.com/rust-lang/crates.io-index"
498
- checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f"
498
+ checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
499
499
  dependencies = [
500
500
  "proc-macro2",
501
501
  ]
@@ -593,14 +593,14 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
593
593
  dependencies = [
594
594
  "proc-macro2",
595
595
  "quote",
596
- "syn 2.0.111",
596
+ "syn 2.0.114",
597
597
  ]
598
598
 
599
599
  [[package]]
600
600
  name = "siphasher"
601
- version = "1.0.1"
601
+ version = "1.0.2"
602
602
  source = "registry+https://github.com/rust-lang/crates.io-index"
603
- checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
603
+ checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
604
604
 
605
605
  [[package]]
606
606
  name = "smallvec"
@@ -652,9 +652,9 @@ dependencies = [
652
652
 
653
653
  [[package]]
654
654
  name = "syn"
655
- version = "2.0.111"
655
+ version = "2.0.114"
656
656
  source = "registry+https://github.com/rust-lang/crates.io-index"
657
- checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87"
657
+ checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
658
658
  dependencies = [
659
659
  "proc-macro2",
660
660
  "quote",
@@ -675,9 +675,9 @@ dependencies = [
675
675
 
676
676
  [[package]]
677
677
  name = "target-lexicon"
678
- version = "0.13.3"
678
+ version = "0.13.4"
679
679
  source = "registry+https://github.com/rust-lang/crates.io-index"
680
- checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c"
680
+ checksum = "b1dd07eb858a2067e2f3c7155d54e929265c264e6f37efe3ee7a8d1b5a1dd0ba"
681
681
 
682
682
  [[package]]
683
683
  name = "thiserror"
@@ -696,7 +696,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
696
696
  dependencies = [
697
697
  "proc-macro2",
698
698
  "quote",
699
- "syn 2.0.111",
699
+ "syn 2.0.114",
700
700
  ]
701
701
 
702
702
  [[package]]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "grumpy"
3
- version = "1.1.2"
3
+ version = "1.1.3"
4
4
  edition = "2021"
5
5
  description = "Genetic analysis in Rust."
6
6
  license-file = "LICENSE"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bio-grumpy
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: Implementation :: CPython
@@ -248,12 +248,27 @@ impl GenomeDifference {
248
248
 
249
249
  if alt.evidence.is_minor {
250
250
  // Append coverage to the variant
251
- if minor_type == MinorType::COV && alt.evidence.cov.is_some() {
252
- garc = garc + ":" + &alt.evidence.cov.unwrap().to_string();
251
+ if minor_type == MinorType::COV {
252
+ match alt.evidence.cov {
253
+ Some(cov) => {
254
+ garc = garc + ":" + &cov.to_string();
255
+ }
256
+ None => {
257
+ panic!(
258
+ "Missing coverage for minor allele: {}, skipping!",
259
+ garc
260
+ );
261
+ }
262
+ }
253
263
  } else if minor_type == MinorType::FRS && alt.evidence.frs.is_some() {
254
- garc = garc
255
- + ":"
256
- + &trim_float_string(format!("{:.3}", alt.evidence.frs.unwrap()));
264
+ match alt.evidence.frs {
265
+ Some(frs) => {
266
+ garc = garc + ":" + &trim_float_string(format!("{:.3}", frs));
267
+ }
268
+ None => {
269
+ panic!("Missing FRS for minor allele: {}, skipping!", garc);
270
+ }
271
+ }
257
272
  } else {
258
273
  println!("Missing evidence for minor allele: {}, skipping!", garc);
259
274
  continue;
@@ -658,20 +673,32 @@ impl GeneDifference {
658
673
  indel_nucleotides = Some(e.base.clone());
659
674
  evidence = vec![e.evidence.clone()];
660
675
  }
661
- if minor_type == MinorType::COV && e.evidence.cov.is_some()
662
- {
663
- _mutation = _mutation
664
- + ":"
665
- + &e.evidence.cov.unwrap().to_string();
666
- } else if minor_type == MinorType::FRS
667
- && e.evidence.frs.is_some()
668
- {
669
- _mutation = _mutation
670
- + ":"
671
- + &trim_float_string(format!(
672
- "{:.3}",
673
- e.evidence.frs.unwrap()
674
- ));
676
+ if minor_type == MinorType::COV {
677
+ match e.evidence.cov {
678
+ Some(cov) => {
679
+ _mutation = _mutation + ":" + &cov.to_string();
680
+ }
681
+ None => {
682
+ panic!(
683
+ "Missing coverage for minor allele: {}, skipping!",
684
+ _mutation
685
+ );
686
+ }
687
+ }
688
+ } else if minor_type == MinorType::FRS {
689
+ match e.evidence.frs {
690
+ Some(frs) => {
691
+ _mutation = _mutation
692
+ + ":"
693
+ + &trim_float_string(format!("{:.3}", frs));
694
+ }
695
+ None => {
696
+ panic!(
697
+ "Missing FRS for minor allele: {}, skipping!",
698
+ _mutation
699
+ );
700
+ }
701
+ }
675
702
  } else {
676
703
  println!(
677
704
  "Missing evidence for minor allele: {}, skipping!",
@@ -844,28 +871,43 @@ impl GeneDifference {
844
871
 
845
872
  if alt.evidence.is_minor {
846
873
  // Append coverage to the variant
847
- if minor_type == MinorType::COV && alt.evidence.cov.is_some() {
848
- mutation =
849
- mutation + ":" + &alt.evidence.cov.unwrap().to_string();
850
- } else if minor_type == MinorType::FRS && alt.evidence.frs.is_some()
851
- {
852
- mutation = mutation
853
- + ":"
854
- + &trim_float_string(format!(
855
- "{:.3}",
856
- alt.evidence.frs.unwrap()
857
- ));
874
+ if minor_type == MinorType::COV {
875
+ match alt.evidence.cov {
876
+ Some(cov) => {
877
+ mutation = mutation + ":" + &cov.to_string();
878
+ }
879
+ None => {
880
+ panic!(
881
+ "Missing coverage for minor allele: {}, skipping!",
882
+ mutation
883
+ );
884
+ }
885
+ }
886
+ } else if minor_type == MinorType::FRS {
887
+ match alt.evidence.frs {
888
+ Some(frs) => {
889
+ mutation = mutation
890
+ + ":"
891
+ + &trim_float_string(format!("{:.3}", frs));
892
+ }
893
+ None => {
894
+ panic!(
895
+ "Missing FRS for minor allele: {}, skipping!",
896
+ mutation
897
+ );
898
+ }
899
+ }
858
900
  }
859
901
  if alt.alt_type == AltType::DEL {
860
- if alt.evidence.cov.is_some()
861
- && alt.evidence.cov.unwrap() > minor_deleted_cov
862
- {
863
- minor_deleted_cov = alt.evidence.cov.unwrap();
902
+ if let Some(cov) = alt.evidence.cov {
903
+ if cov > minor_deleted_cov {
904
+ minor_deleted_cov = cov;
905
+ }
864
906
  }
865
- if alt.evidence.frs.is_some()
866
- && alt.evidence.frs.unwrap() > minor_deleted_frs
867
- {
868
- minor_deleted_frs = alt.evidence.frs.unwrap();
907
+ if let Some(frs) = alt.evidence.frs {
908
+ if frs > minor_deleted_frs {
909
+ minor_deleted_frs = frs;
910
+ }
869
911
  }
870
912
  }
871
913
  if alt.alt_type == AltType::DEL || alt.alt_type == AltType::INS {
@@ -90,6 +90,7 @@ pub struct Genome {
90
90
  pub vcf_records: Option<Vec<VCFRow>>,
91
91
  }
92
92
 
93
+ #[allow(clippy::only_used_in_recursion)]
93
94
  /// Recursively parse a GenBank location into ranges
94
95
  /// Required as complement and join can be nested
95
96
  ///
@@ -111,11 +112,7 @@ pub fn parse_genbank_location(
111
112
  return true;
112
113
  }
113
114
  Range(s, e) => {
114
- if reverse_complement {
115
- ranges.push((e.0, s.0));
116
- } else {
117
- ranges.push((s.0, e.0));
118
- }
115
+ ranges.push((s.0, e.0));
119
116
  }
120
117
  Join(loc_ranges) => {
121
118
  // Checking for PRFS
@@ -263,13 +260,7 @@ impl Genome {
263
260
  for gene in self.gene_definitions.iter_mut() {
264
261
  // First pass to add gene names to all positions they exist in
265
262
  for (start, end) in gene.ranges.iter() {
266
- let mut start_idx = *start;
267
- let mut end_idx = *end;
268
- if gene.reverse_complement {
269
- start_idx = *end;
270
- end_idx = *start;
271
- }
272
- for i in start_idx..end_idx {
263
+ for i in *start..*end {
273
264
  self.genome_positions[i as usize]
274
265
  .genes
275
266
  .push(gene.name.clone());
@@ -281,9 +272,13 @@ impl Genome {
281
272
  // Check for overlapping genes, assigning promoters to non-overlapping genes
282
273
  let start;
283
274
  if gene.ranges.len() == 1 {
284
- start = gene.ranges[0].0;
275
+ if gene.reverse_complement {
276
+ start = gene.ranges[0].1;
277
+ } else {
278
+ start = gene.ranges[0].0;
279
+ }
285
280
  } else if gene.reverse_complement {
286
- start = gene.ranges[gene.ranges.len() - 1].0;
281
+ start = gene.ranges[gene.ranges.len() - 1].1;
287
282
  } else {
288
283
  start = gene.ranges[0].0;
289
284
  }
@@ -369,42 +364,30 @@ impl Genome {
369
364
  let mut nucleotide_sequence = "".to_string();
370
365
  let mut nucleotide_index = Vec::new();
371
366
  let mut genome_positions: Vec<GenomePosition> = Vec::new();
372
- if gene_def.reverse_complement {
373
- for (idx, (start, end)) in gene_def.ranges.iter().rev().enumerate() {
374
- let mut last_idx: usize = if idx == 0 && gene_def.promoter_start != -1 {
375
- gene_def.promoter_start as usize
376
- } else {
377
- *start as usize
378
- };
379
- if last_idx == self.genome_positions.len() {
380
- last_idx -= 1;
381
- }
382
- for i in *end as usize..last_idx + 1 {
383
- nucleotide_sequence.push(self.genome_positions[i].reference);
384
- nucleotide_index.push(self.genome_positions[i].genome_idx);
385
- genome_positions.push(self.genome_positions[i].clone());
386
- }
367
+ if !gene_def.reverse_complement && gene_def.promoter_start != -1 {
368
+ for idx in
369
+ (gene_def.promoter_start as usize).saturating_sub(1)..gene_def.ranges[0].0 as usize
370
+ {
371
+ nucleotide_sequence.push(self.genome_positions[idx].reference);
372
+ nucleotide_index.push(self.genome_positions[idx].genome_idx);
373
+ genome_positions.push(self.genome_positions[idx].clone());
387
374
  }
388
- } else {
389
- for (idx, (start, end)) in gene_def.ranges.iter().enumerate() {
390
- let first_idx: usize;
391
- if idx == 0 && gene_def.promoter_start != -1 {
392
- if gene_def.promoter_start == 0 {
393
- first_idx = 0;
394
- } else {
395
- first_idx = gene_def.promoter_start as usize - 1;
396
- }
397
- } else {
398
- first_idx = *start as usize;
399
- }
400
- for i in first_idx..*end as usize {
401
- nucleotide_sequence.push(self.genome_positions[i].reference);
402
- nucleotide_index.push(self.genome_positions[i].genome_idx);
403
- genome_positions.push(self.genome_positions[i].clone());
404
- }
375
+ }
376
+ for (start, end) in gene_def.ranges.iter() {
377
+ for i in *start as usize..*end as usize {
378
+ nucleotide_sequence.push(self.genome_positions[i].reference);
379
+ nucleotide_index.push(self.genome_positions[i].genome_idx);
380
+ genome_positions.push(self.genome_positions[i].clone());
381
+ }
382
+ }
383
+ if gene_def.reverse_complement && gene_def.promoter_start != -1 {
384
+ for idx in gene_def.ranges.last().unwrap().1 as usize..=gene_def.promoter_start as usize
385
+ {
386
+ nucleotide_sequence.push(self.genome_positions[idx].reference);
387
+ nucleotide_index.push(self.genome_positions[idx].genome_idx);
388
+ genome_positions.push(self.genome_positions[idx].clone());
405
389
  }
406
390
  }
407
-
408
391
  // I hate implicit returns, but appease clippy
409
392
  Gene::new(
410
393
  gene_def,
@@ -5093,5 +5076,17 @@ mod tests {
5093
5076
  assert!(reference
5094
5077
  .gene_names
5095
5078
  .contains(&"INCOMPLETE_LK403_RS00005".to_string()));
5079
+
5080
+ // Check that a mutation is correctly placed (rather than erroring)
5081
+ let vcf = VCFFile::new("test/intracellulare.vcf".to_string(), false, 3);
5082
+ let mut sample = mutate(&reference, vcf);
5083
+ let ref_gene = reference.get_gene("INCOMPLETE_LK403_RS14635".to_string());
5084
+ let sample_gene = sample.get_gene("INCOMPLETE_LK403_RS14635".to_string());
5085
+ // Getting to this point without error is the main test here, but check that the mutation is placed too
5086
+ let gene_diff = GeneDifference::new(ref_gene, sample_gene, MinorType::COV);
5087
+ println!("Gene diff mutations: {:?}", gene_diff.mutations);
5088
+ assert!(gene_diff.mutations.len() == 1);
5089
+ assert!(gene_diff.minor_mutations.is_empty());
5090
+ assert!(gene_diff.mutations[0].mutation == "-6_del_ca");
5096
5091
  }
5097
5092
  }
@@ -284,12 +284,19 @@ impl VCFFile {
284
284
  VCFFile::parse_record_for_calls(row.clone(), min_dp, vcf_row_index);
285
285
 
286
286
  // if record.position == 178452 {
287
- // println!("{:?}\t{:?}\t{:?}\t{:?}\t{:?}", record.position, String::from_utf8_lossy(&record.reference), alts, filters, fields);
288
- // for call in record_calls.iter(){
287
+ // println!(
288
+ // "{:?}\t{:?}\t{:?}\t{:?}\t{:?}",
289
+ // record.position,
290
+ // String::from_utf8_lossy(&record.reference),
291
+ // alts,
292
+ // filters,
293
+ // fields
294
+ // );
295
+ // for call in record_calls.iter() {
289
296
  // println!("{:?}\n", call);
290
297
  // }
291
298
  // println!("--");
292
- // for call in record_minor_calls.iter(){
299
+ // for call in record_minor_calls.iter() {
293
300
  // println!("{:?}\n", call);
294
301
  // }
295
302
  // println!("\n\n");
@@ -0,0 +1,20 @@
1
+ ##fileformat=VCFv4.2
2
+ ##source=minos, version 0.12.5
3
+ ##fileDate=2026-01-27
4
+ ##FORMAT=<ID=ALLELE_DP,Number=R,Type=Float,Description="Mean read depth of ref and each allele">
5
+ ##FORMAT=<ID=COV,Number=R,Type=Integer,Description="Number of reads on ref and alt alleles">
6
+ ##FORMAT=<ID=COV_TOTAL,Number=1,Type=Integer,Description="Total reads mapped at this site, from gramtools">
7
+ ##FORMAT=<ID=DP,Number=1,Type=Float,Description="Mean read depth of called allele (ie the ALLELE_DP of the called allele)">
8
+ ##FORMAT=<ID=FRS,Number=1,Type=Float,Description="Fraction of reads that support the genotype call">
9
+ ##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
10
+ ##FORMAT=<ID=GT_CONF,Number=1,Type=Float,Description="Genotype confidence. Difference in log likelihood of most likely and next most likely genotype">
11
+ ##minosMeanReadDepth=24.34
12
+ ##minosReadDepthVariance=52.347
13
+ ##contig=<ID=CP015278.1,length=5865644>
14
+ ##FORMAT=<ID=GT_CONF_PERCENTILE,Number=1,Type=Float,Description="Percentile of GT_CONF">
15
+ ##FILTER=<ID=MIN_FRS,Description="Minimum FRS of 0.9">
16
+ ##FILTER=<ID=MIN_DP,Description="Minimum DP of 3">
17
+ ##FILTER=<ID=MIN_GCP,Description="Minimum GT_CONF_PERCENTILE of 0.5">
18
+ ##FILTER=<ID=MAX_DP,Description="Maximum DP of 46.0453679996447 (= 3.0 standard deviations from the mean read depth 24.34)">
19
+ #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT sample
20
+ CP015278.1 3115422 . CTG C . PASS . GT:DP:ALLELE_DP:FRS:COV_TOTAL:COV:GT_CONF:GT_CONF_PERCENTILE 1/1:32:0,32:1.0:32:0,32:227.66:85.78
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes