|
1 | 1 | use crate::utils::af_utils::*; |
2 | 2 |
|
| 3 | +use crate::utils::prog_parsing_utils; |
3 | 4 | use crate::utils::prog_utils; |
4 | 5 | use crate::utils::prog_utils::{CommandVerbosityLevel, ReqProgs}; |
5 | | -use crate::utils::prog_parsing_utils; |
6 | 6 |
|
7 | 7 | use anyhow::{bail, Context}; |
8 | 8 | use serde_json::json; |
@@ -626,7 +626,6 @@ being used by simpleaf"#, |
626 | 626 | if !cres.status.success() { |
627 | 627 | bail!("piscem mapping failed with exit status {:?}", cres.status); |
628 | 628 | } |
629 | | - |
630 | 629 | } |
631 | 630 | IndexType::Salmon(ref index_base) => { |
632 | 631 | // using a salmon index |
@@ -737,33 +736,36 @@ being used by simpleaf"#, |
737 | 736 | // make the quant directory |
738 | 737 | let gpl_output = opts.output.join("af_quant"); |
739 | 738 |
|
740 | | - let _r = std::fs::create_dir_all(&gpl_output).with_context( |
741 | | - || format!("Failed to create quantification output directory {}", gpl_output.display()) |
742 | | - )?; |
743 | | - |
744 | | - // attempt to get the relevant information from map_info to propagate forward to the |
| 739 | + std::fs::create_dir_all(&gpl_output).with_context(|| { |
| 740 | + format!( |
| 741 | + "Failed to create quantification output directory {}", |
| 742 | + gpl_output.display() |
| 743 | + ) |
| 744 | + })?; |
| 745 | + |
| 746 | + // attempt to get the relevant information from map_info to propagate forward to the |
745 | 747 | // quantification directory |
746 | 748 | //get_mapping_info |
747 | 749 | let mapping_log = match index_type { |
748 | 750 | IndexType::Piscem(_) => { |
749 | 751 | let piscem_map_log_path = map_output.join("map_info.json"); |
750 | 752 | prog_parsing_utils::construct_json_from_piscem_log(piscem_map_log_path)? |
751 | | - }, |
| 753 | + } |
752 | 754 | IndexType::Salmon(_) => { |
753 | 755 | let salmon_log_path = map_output.join("logs").join("salmon_quant.log"); |
754 | 756 | prog_parsing_utils::construct_json_from_salmon_log(salmon_log_path)? |
755 | | - }, |
| 757 | + } |
756 | 758 | IndexType::NoIndex => { |
757 | 759 | serde_json::json!({ |
758 | 760 | "mapper" : "pre_mapped", |
759 | 761 | "num_mapped": 0, |
760 | 762 | "num_poisoned": 0, |
761 | 763 | "num_reads": 0, |
762 | | - "percent_mapped": 0. |
| 764 | + "percent_mapped": 0. |
763 | 765 | }) |
764 | 766 | } |
765 | 767 | }; |
766 | | - |
| 768 | + |
767 | 769 | let map_info_path = gpl_output.join("simpleaf_map_info.json"); |
768 | 770 | let map_info_file = std::fs::File::create(map_info_path)?; |
769 | 771 | serde_json::to_writer(map_info_file, &mapping_log)?; |
|
0 commit comments