| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- use pandora_lib_scan::par_whole_scan;
- #[derive(Debug, Clone)]
- pub struct WholeScanConfig {
- pub result_dir: String,
- pub scan_dir: String,
- pub dict_file: String,
- }
- impl Default for WholeScanConfig {
- fn default() -> Self {
- Self {
- result_dir: "/data/longreads_basic_pipe".to_string(),
- scan_dir: "scan".to_string(),
- dict_file: "".to_string(),
- }
- }
- }
- #[derive(Debug)]
- pub struct WholeScan {
- pub id: String,
- pub time_point: String,
- pub bam_path: String,
- pub config: WholeScanConfig,
- }
- impl WholeScan {
- pub fn new(
- id: String,
- time_point: String,
- bam_path: String,
- config: WholeScanConfig
- ) -> anyhow::Result<Self> {
- Ok(WholeScan {
- id,
- time_point,
- config,
- bam_path,
- })
- }
- pub fn run(&self) -> anyhow::Result<()> {
- let scan_dir = format!(
- "{}/{}/{}/{}",
- &self.config.result_dir, self.id, self.time_point, self.config.scan_dir
- );
- par_whole_scan(&self.config.dict_file, &self.bam_path, &scan_dir)?;
- Ok(())
- }
- }
|