Skip to content

Commit

Permalink
version 1.0.2: adding backtrace for production-stage debugging + fixe…
Browse files Browse the repository at this point in the history
…d geno.rs bug when input allele freq tsv has one less allele per locus and some loci are completely fixed
  • Loading branch information
jeffersonfparil committed Jun 27, 2024
1 parent fedd75a commit 601cb45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'imputef'
version = '1.0.0'
version = '1.0.2'
edition = '2021'

[dependencies]
Expand Down
3 changes: 2 additions & 1 deletion src/geno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ impl LoadAll for FileGeno {
for j in 0..l {
let idx_ini = loci_idx[j];
let idx_fin = loci_idx[j + 1];
let n_alleles = idx_fin - idx_ini;
let mut freq_sum_less_than_one = false;
for i in 0..n {
if mat[(i, idx_ini)].is_nan() {
Expand All @@ -354,7 +355,7 @@ impl LoadAll for FileGeno {
};
}
}
if freq_sum_less_than_one {
if (n_alleles == 1) || freq_sum_less_than_one {
p += 1;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use clap::Parser;

use rand::Rng;
use std::env;

mod aldknni;
mod filter_missing;
Expand Down Expand Up @@ -104,6 +105,7 @@ struct Args {
/// The first two parameters (minimum loci correlation and maximum genetic distance thresholds) can be optimised per locus requiring imputation using non-missing samples as replicates simulating missing data to minimum the mean absolute error in imputation.
/// This library can also perform simple genotype data filtering prior to imputation.
fn main() {
env::set_var("RUST_BACKTRACE", "1");
let args = Args::parse();
// Identify the format of the input file
// 1) vcf - richest (*.vcf)
Expand Down

0 comments on commit 601cb45

Please sign in to comment.