bio-grumpy 0.1.2__tar.gz → 0.1.4__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.2"
79
+ version = "0.1.4"
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.2"
3
+ version = "0.1.4"
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.2
3
+ Version: 0.1.4
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -156,6 +156,11 @@ impl GenomeDifference{
156
156
  let mut gene_position = None;
157
157
  let mut codon_idx = None;
158
158
 
159
+ if alt.alt_type == AltType::REF{
160
+ // Skip ref calls
161
+ continue;
162
+ }
163
+
159
164
  // Only annotate with gene information if there is a single gene at this position
160
165
  if alt_pos.genes.len() == 1{
161
166
  gene_name = Some(alt_pos.genes[0].clone());
@@ -638,6 +643,11 @@ impl GeneDifference{
638
643
  let amino_acid_number = None;
639
644
  let amino_acid_sequence = None;
640
645
 
646
+ if alt.alt_type == AltType::REF{
647
+ // Skip ref calls
648
+ continue;
649
+ }
650
+
641
651
  if alt.alt_type == AltType::SNP || alt.alt_type == AltType::HET || alt.alt_type == AltType::NULL{
642
652
  mutation = ref_nc.reference.to_string() + &ref_nc.nucleotide_number.to_string() + &alt.base;
643
653
  ref_nucleotides = Some(ref_nc.reference.to_string());
@@ -35,13 +35,7 @@ fn main() {
35
35
  let sample_start = SystemTime::now();
36
36
  let mut sample = mutate(&reference, vcf);
37
37
  let sample_end = SystemTime::now();
38
- // sample.build_all_genes();
39
38
 
40
- // let gene_name = "ponA1".to_string();
41
-
42
- // let gene_diff = GeneDifference::new(reference.get_gene(gene_name.clone()), sample.get_gene(gene_name.clone()), MinorType::COV);
43
- // println!("{:?}", gene_diff.mutations.iter().map(|mutation| mutation.mutation.clone()).collect::<Vec<String>>());
44
- // println!("{:?}\n", gene_diff.minor_mutations.iter().map(|mutation| mutation.mutation.clone()).collect::<Vec<String>>());
45
39
  let genome_start = SystemTime::now();
46
40
  let difference = GenomeDifference::new(reference.clone(), sample.clone(), MinorType::COV);
47
41
  println!("{:?}", difference.variants.iter().map(|variant| variant.variant.clone()).collect::<Vec<String>>());
@@ -62,12 +56,4 @@ fn main() {
62
56
  println!("Genome diff took {:?}", genome_end.duration_since(genome_start).unwrap());
63
57
  println!("Gene diff took {:?}", gene_end.duration_since(gene_start).unwrap());
64
58
 
65
-
66
- // let gene_name = "fabG1".to_string();
67
- // let rrs_diff = GeneDifference::new(reference.get_gene(gene_name.clone()), sample.get_gene(gene_name.clone()), MinorType::COV);
68
- // println!("{:?}", rrs_diff.mutations.iter().map(|mutation| mutation.mutation.clone()).collect::<Vec<String>>());
69
- // println!("{:?}", rrs_diff.minor_mutations.iter().map(|mutation| mutation.mutation.clone()).collect::<Vec<String>>());
70
-
71
-
72
-
73
59
  }
@@ -237,15 +237,25 @@ impl VCFFile{
237
237
  alt_idx = first.parse::<i32>().unwrap() - 1;
238
238
  }
239
239
  if cov.len() == 1{
240
- // Just 1 item in the call so it's a null call
240
+ // Just 1 item in the call so santiy check if it's a null call
241
+ if genotype == &vec!["0", "0"]{
242
+ // Ref call
243
+ call_type = AltType::REF;
244
+ alt_allele = ref_allele.clone();
245
+ }
246
+ else{
247
+ // Null call
248
+ call_type = AltType::NULL;
249
+ alt_allele = "x".to_string();
250
+ }
241
251
  calls.push(Evidence{
242
252
  cov: Some(cov[0 as usize]),
243
253
  frs: Some(ordered_float::OrderedFloat(1.0)),
244
254
  genotype: genotype.join("/"),
245
- call_type: AltType::NULL,
255
+ call_type,
246
256
  vcf_row: record.clone(),
247
257
  reference: ref_allele.chars().nth(0).unwrap().to_string(),
248
- alt: "x".to_string(),
258
+ alt: alt_allele.clone(),
249
259
  genome_index: record.position,
250
260
  is_minor: false,
251
261
  vcf_idx: 0 as i64
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