From 7f882b96542f6d788dda0e8ee0f281601998b141 Mon Sep 17 00:00:00 2001 From: Hyunbin Kim Date: Wed, 16 Oct 2024 19:01:36 +0900 Subject: [PATCH] Refactor query_pdb output by removing ID container and adjusting result header --- src/cli/workflows/query_pdb.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cli/workflows/query_pdb.rs b/src/cli/workflows/query_pdb.rs index 03ae832..b48e89a 100644 --- a/src/cli/workflows/query_pdb.rs +++ b/src/cli/workflows/query_pdb.rs @@ -54,7 +54,7 @@ Options: --node Number of nodes to retrieve (default 2) "; // TODO: need to think about the column name -pub const QUERY_RESULT_HEADER: &str = "id\tpath\tidf_score\ttotal_match_count\tnode_count\tedge_count\texact_match_count\toverflow_count\tnres\tplddt\tmatching_residues\tresidues_rescued\tquery_residues\tquery_file\tindex_path"; +pub const QUERY_RESULT_HEADER: &str = "id\tidf_score\ttotal_match_count\tnode_count\tedge_count\texact_match_count\toverflow_count\tnres\tplddt\tmatching_residues\tresidues_rescued\tquery_residues\tquery_file\tindex_path"; pub const DEFAULT_NODE_COUNT: usize = 2; @@ -380,10 +380,10 @@ pub fn query_pdb(env: AppArgs) { &log_msg(FAIL, &format!("Failed to write to file: {}", &output_path)) ); } - let mut id_container = String::new(); + // let mut id_container = String::new(); for (_k, v) in queried_from_indices.iter_mut() { - parse_path_by_id_type_with_string(v.id, &id_type, &mut id_container); - writer.write_all(format!("{}\t{:?}\t{}\t{}\t{}\n", id_container, v, query_string, pdb_path, index_path.clone().unwrap()).as_bytes()).expect( + // parse_path_by_id_type_with_string(v.id, &id_type, &mut id_container); + writer.write_all(format!("{:?}\t{}\t{}\t{}\n", v, query_string, pdb_path, index_path.clone().unwrap()).as_bytes()).expect( &log_msg(FAIL, &format!("Failed to write to file: {}", &output_path)) ); } @@ -391,10 +391,10 @@ pub fn query_pdb(env: AppArgs) { if header { println!("{}", QUERY_RESULT_HEADER); } - let mut id_container = String::new(); + // let mut id_container = String::new(); for (_k, v) in queried_from_indices.iter_mut() { - parse_path_by_id_type_with_string(v.id, &id_type, &mut id_container); - println!("{}\t{:?}\t{}\t{}\t{}", id_container, v, query_string, pdb_path, index_path.clone().unwrap()); + // parse_path_by_id_type_with_string(v.id, &id_type, &mut id_container); + println!("{:?}\t{}\t{}\t{}", v, query_string, pdb_path, index_path.clone().unwrap()); } } }); // queries