Skip to content

Commit a463b6b

Browse files
committed
cleaning up qc report for repo
1 parent ef07fd0 commit a463b6b

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ga4ghphetools"
3-
version = "0.5.3"
3+
version = "0.5.4"
44
edition = "2021"
55
keywords = ["GA4GH", "Phenopacket Schema", "Human Phenotype Ontology"]
66
description = "Generate GA4GH phenopackets from tabular data"

src/repo/gpt_repository.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct GptRepository {
1616

1717

1818
impl GptRepository {
19-
fn new(root_path: &str) -> Self {
19+
pub fn new(root_path: &PathBuf) -> Self {
2020
let mut all_cohorts: Vec<CohortDir> = Vec::new();
2121
let entries = WalkDir::new(root_path)
2222
.min_depth(1)
@@ -77,12 +77,6 @@ mod tests {
7777
}
7878

7979

80-
#[rstest]
81-
fn test_repo(repo_path: String) {
82-
let repo = GptRepository::new(&repo_path);
83-
let repoqc = repo.repo_qc().unwrap();
84-
85-
}
8680

8781

8882

src/repo/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33
//!
44
//!
55
6+
use std::path::PathBuf;
7+
8+
use crate::repo::{gpt_repository::GptRepository, repo_qc::RepoQc};
9+
610

711
mod cohort_dir;
812
mod cohort_qc;
913
pub mod dashboard_data;
1014
mod disease_qc;
1115
mod gpt_repository;
1216
pub mod qc_report;
13-
mod repo_qc;
17+
pub mod repo_qc;
18+
19+
20+
21+
pub fn get_repo_qc(path: &PathBuf) -> Result<RepoQc, String> {
22+
let repo = GptRepository::new(path);
23+
repo.repo_qc()
24+
}

src/repo/qc_report.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use std::collections::HashSet;
22

33

44

5-
#[derive(Debug, Clone, serde::Serialize)] // Serialize helps if passing to a web-based GUI
5+
#[derive(Debug, Clone, serde::Serialize)]
6+
#[serde(rename_all = "camelCase")]
67
pub struct QcReport {
78
pub cohort_name: String,
89
pub message: String,

src/repo/repo_qc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use crate::repo::{cohort_qc::CohortQc, qc_report::QcReport};
44

55

66

7-
7+
#[derive(Debug, Clone, serde::Serialize)]
8+
#[serde(rename_all = "camelCase")]
89
pub struct RepoQc {
910
pub repo_path: String,
1011
pub cohort_count: usize,

0 commit comments

Comments
 (0)