bio-grumpy 0.1.4__tar.gz → 0.1.6__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.
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "grumpy"
79
- version = "0.1.4"
79
+ version = "0.1.6"
80
80
  dependencies = [
81
81
  "gb-io",
82
82
  "ordered-float",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "grumpy"
3
- version = "0.1.4"
3
+ version = "0.1.6"
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.3
2
2
  Name: bio-grumpy
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -508,7 +508,7 @@ impl GeneDifference{
508
508
  let e = these_minor_indels[0];
509
509
  // We have a single minor indel which is much easier
510
510
  if e.alt_type == AltType::INS{
511
- _mutation = alt_cd.reference.to_string() + "_" + &alt_cd.nucleotide_number.to_string() + "_ins_" + &e.base;
511
+ _mutation = alt_cd.nucleotide_number.to_string() + "_ins_" + &e.base;
512
512
  indel_length = Some(e.base.len() as i64);
513
513
  indel_nucleotides = Some(e.base.clone());
514
514
  evidence = vec![e.evidence.clone()];
@@ -153,17 +153,32 @@ impl VCFFile{
153
153
  // println!("Minor calls {:?}\n", record_minor_calls);
154
154
 
155
155
  for call in record_calls{
156
+ let mut added = false;
156
157
  if calls_map.contains_key(&call.genome_index){
157
158
  println!("Multiple calls at genome position {}! {:?}\n", call.genome_index, calls_map.get(&call.genome_index).unwrap());
158
159
  if ignore_filter || passed || call.call_type == AltType::NULL{
159
160
  calls_map.get_mut(&call.genome_index).unwrap().push(call.clone());
161
+ added = true;
160
162
  }
161
163
  }
162
164
  else{
163
165
  if ignore_filter || passed || call.call_type == AltType::NULL{
164
166
  calls_map.insert(call.genome_index, vec![call.clone()]);
167
+ added = true;
165
168
  }
166
169
  }
170
+ if !added{
171
+ // Call skipped due to filter fail, so add as a minor call
172
+ let mut c = call.clone();
173
+ c.is_minor = true;
174
+ if minor_calls_map.contains_key(&c.genome_index){
175
+ minor_calls_map.get_mut(&c.genome_index).unwrap().push(c.clone());
176
+ }
177
+ else{
178
+ minor_calls_map.insert(c.genome_index, vec![c.clone()]);
179
+ }
180
+ }
181
+
167
182
  }
168
183
  // Add minor calls if the filter is passed or ignored, or specifcally just the MIN_FRS has failed
169
184
  if (ignore_filter || passed) || (!passed && filters.len() == 1 && filters.contains(&"MIN_FRS".to_string())){
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