config.rs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. #[derive(Debug, Clone)]
  2. pub struct Config {
  3. pub pod_dir: String,
  4. pub result_dir: String,
  5. pub align: AlignConfig,
  6. pub reference: String,
  7. pub reference_name: String,
  8. pub dict_file: String,
  9. pub refseq_gff: String,
  10. pub docker_max_memory_go: u16,
  11. pub savana_bin: String,
  12. pub savana_threads: u8,
  13. pub tumoral_name: String,
  14. pub normal_name: String,
  15. pub haplotagged_bam_tag_name: String,
  16. pub count_dir_name: String,
  17. pub count_bin_size: u32,
  18. pub count_n_chunks: u32,
  19. pub savana_output_dir: String,
  20. pub savana_copy_number: String,
  21. pub savana_read_counts: String,
  22. pub germline_phased_vcf: String,
  23. pub savana_passed_vcf: String,
  24. pub conda_sh: String,
  25. pub savana_force: bool,
  26. pub deepvariant_output_dir: String,
  27. pub severus_bin: String,
  28. pub severus_force: bool,
  29. pub severus_threads: u8,
  30. pub vntrs_bed: String,
  31. pub severus_pon: String,
  32. pub severus_output_dir: String,
  33. pub severus_solo_output_dir: String,
  34. pub longphase_bin: String,
  35. pub longphase_threads: u8,
  36. pub longphase_modcall_vcf: String,
  37. pub modkit_bin: String,
  38. pub modkit_summary_threads: u8,
  39. pub modkit_summary_file: String,
  40. pub longphase_modcall_threads: u8,
  41. pub deepvariant_threads: u8,
  42. pub deepvariant_bin_version: String,
  43. pub deepvariant_model_type: String,
  44. pub deepvariant_force: bool,
  45. pub deepsomatic_output_dir: String,
  46. pub deepsomatic_threads: u8,
  47. pub deepsomatic_bin_version: String,
  48. pub deepsomatic_model_type: String,
  49. pub deepsomatic_force: bool,
  50. pub bam_min_mapq: u8,
  51. pub bam_n_threads: u8,
  52. pub db_cases_path: String,
  53. pub somatic_pipe_stats: String,
  54. pub clairs_threads: u8,
  55. pub clairs_force: bool,
  56. pub clairs_platform: String,
  57. pub clairs_output_dir: String,
  58. pub mask_bed: String,
  59. pub somatic_min_constit_depth: u16,
  60. pub somatic_max_alt_constit: u16,
  61. pub entropy_seq_len: usize,
  62. pub min_shannon_entropy: f64,
  63. pub nanomonsv_bin: String,
  64. pub nanomonsv_output_dir: String,
  65. pub nanomonsv_force: bool,
  66. pub nanomonsv_threads: u8,
  67. pub nanomonsv_passed_vcf: String,
  68. pub nanomonsv_solo_output_dir: String,
  69. pub nanomonsv_solo_passed_vcf: String,
  70. pub somatic_pipe_force: bool,
  71. pub somatic_pipe_threads: u8,
  72. pub min_high_quality_depth: u32,
  73. pub min_n_callers: u8,
  74. pub somatic_scan_force: bool,
  75. pub early_bed: String,
  76. pub late_bed: String,
  77. pub panels: Vec<(String, String)>,
  78. pub cpg_bed: String,
  79. pub max_depth_low_quality: u32,
  80. }
  81. // Here comes names that can't be changed from output of tools
  82. lazy_static! {
  83. static ref DEEPVARIANT_OUTPUT_NAME: &'static str = "{id}_{time}_DeepVariant.vcf.gz";
  84. static ref CLAIRS_OUTPUT_NAME: &'static str = "output.vcf.gz";
  85. static ref CLAIRS_OUTPUT_INDELS_NAME: &'static str = "indel.vcf.gz";
  86. static ref CLAIRS_GERMLINE_NORMAL: &'static str = "clair3_normal_germline_output.vcf.gz";
  87. static ref CLAIRS_GERMLINE_TUMOR: &'static str = "clair3_tumor_germline_output.vcf.gz";
  88. }
  89. impl Default for Config {
  90. fn default() -> Self {
  91. Self {
  92. pod_dir: "/data/run_data".to_string(),
  93. align: Default::default(),
  94. // Reference genome
  95. reference: "/data/ref/hs1/chm13v2.0.fa".to_string(),
  96. reference_name: "hs1".to_string(),
  97. dict_file: "/data/ref/hs1/chm13v2.0.dict".to_string(),
  98. refseq_gff: "/data/ref/hs1/chm13v2.0_RefSeq_Liftoff_v5.1_sorted.gff3.gz".to_string(),
  99. docker_max_memory_go: 400,
  100. // File structure
  101. result_dir: "/data/longreads_basic_pipe".to_string(),
  102. tumoral_name: "diag".to_string(),
  103. normal_name: "mrd".to_string(),
  104. haplotagged_bam_tag_name: "HP".to_string(),
  105. count_dir_name: "counts".to_string(),
  106. count_bin_size: 1_000,
  107. count_n_chunks: 1_000,
  108. bam_min_mapq: 40,
  109. bam_n_threads: 150,
  110. db_cases_path: "/data/cases.sqlite".to_string(),
  111. //
  112. mask_bed: "{result_dir}/{id}/diag/mask.bed".to_string(),
  113. germline_phased_vcf: "{result_dir}/{id}/diag/{id}_variants_constit_phased.vcf.gz"
  114. .to_string(),
  115. conda_sh: "/data/miniconda3/etc/profile.d/conda.sh".to_string(),
  116. somatic_pipe_stats: "{result_dir}/{id}/diag/somatic_pipe_stats"
  117. .to_string(),
  118. // DeepVariant
  119. deepvariant_output_dir: "{result_dir}/{id}/{time}/DeepVariant".to_string(),
  120. deepvariant_threads: 150,
  121. deepvariant_bin_version: "1.9.0".to_string(),
  122. deepvariant_model_type: "ONT_R104".to_string(),
  123. deepvariant_force: false,
  124. // DeepSomatic
  125. deepsomatic_output_dir: "{result_dir}/{id}/{time}/DeepSomatic".to_string(),
  126. deepsomatic_threads: 150,
  127. deepsomatic_bin_version: "1.9.0".to_string(),
  128. deepsomatic_model_type: "ONT".to_string(),
  129. deepsomatic_force: false,
  130. // ClairS
  131. clairs_output_dir: "{result_dir}/{id}/diag/ClairS".to_string(),
  132. clairs_threads: 155,
  133. clairs_platform: "ont_r10_dorado_sup_5khz_ssrs".to_string(),
  134. clairs_force: false,
  135. // Savana
  136. savana_bin: "savana".to_string(),
  137. // savana_bin: "/home/prom/.local/bin/savana".to_string(),
  138. savana_threads: 150,
  139. savana_output_dir: "{result_dir}/{id}/diag/savana".to_string(),
  140. savana_passed_vcf: "{output_dir}/{id}_diag_savana_PASSED.vcf.gz".to_string(),
  141. savana_copy_number: "{output_dir}/{id}_diag_{reference_name}_{haplotagged_bam_tag_name}_segmented_absolute_copy_number.tsv".to_string(),
  142. savana_read_counts: "{output_dir}/{id}_diag_{reference_name}_{haplotagged_bam_tag_name}_raw_read_counts.tsv".to_string(),
  143. savana_force: false,
  144. // Severus
  145. severus_bin: "/data/tools/MySeverus/severus.py".to_string(),
  146. severus_threads: 32,
  147. vntrs_bed: "/data/ref/hs1/vntrs_chm13.bed".to_string(),
  148. severus_pon: "/data/ref/hs1/PoN_1000G_chm13.tsv.gz".to_string(),
  149. severus_output_dir: "{result_dir}/{id}/diag/severus".to_string(),
  150. severus_solo_output_dir: "{result_dir}/{id}/{time}/severus".to_string(),
  151. severus_force: false,
  152. // Longphase
  153. longphase_bin: "/data/tools/longphase_linux-x64".to_string(),
  154. longphase_threads: 150,
  155. longphase_modcall_threads: 8, // ! out of memory
  156. longphase_modcall_vcf:
  157. "{result_dir}/{id}/{time}/5mC_5hmC/{id}_{time}_5mC_5hmC_modcall.vcf.gz".to_string(),
  158. // modkit
  159. modkit_bin: "modkit".to_string(),
  160. modkit_summary_threads: 50,
  161. modkit_summary_file: "{result_dir}/{id}/{time}/{id}_{time}_5mC_5hmC_summary.txt"
  162. .to_string(),
  163. // Nanomonsv
  164. // tabix, bgzip, mafft in PATH
  165. // pip install pysam, parasail; pip install nanomonsv
  166. nanomonsv_bin: "/home/prom/.local/bin/nanomonsv".to_string(),
  167. nanomonsv_output_dir: "{result_dir}/{id}/{time}/nanomonsv".to_string(),
  168. nanomonsv_threads: 150,
  169. nanomonsv_force: false,
  170. nanomonsv_passed_vcf: "{output_dir}/{id}_diag_nanomonsv_PASSED.vcf.gz".to_string(),
  171. nanomonsv_solo_output_dir: "{result_dir}/{id}/{time}/nanomonsv-solo".to_string(),
  172. nanomonsv_solo_passed_vcf: "{output_dir}/{id}_{time}_nanomonsv-solo_PASSED.vcf.gz"
  173. .to_string(),
  174. // Scan
  175. somatic_scan_force: false,
  176. // Pipe
  177. somatic_pipe_force: true,
  178. somatic_pipe_threads: 150,
  179. somatic_min_constit_depth: 5,
  180. somatic_max_alt_constit: 1,
  181. entropy_seq_len: 10,
  182. min_shannon_entropy: 1.0,
  183. max_depth_low_quality: 20,
  184. min_high_quality_depth: 14,
  185. min_n_callers: 1,
  186. early_bed: "/data/ref/hs1/replication_early_25_hs1.bed".to_string(),
  187. late_bed: "/data/ref/hs1/replication_late_75_hs1.bed".to_string(),
  188. panels: vec![
  189. ("OncoT".to_string(), "/data/ref/hs1/V1_V2_V3_V4_V5_intersect_targets_hs1_uniq.bed".to_string()),
  190. ("variable_chips".to_string(), "/data/ref/hs1/top_1500_sd_pos.bed".to_string()),
  191. ],
  192. cpg_bed: "/data/ref/hs1/hs1/hs1_CpG.bed".to_string(),
  193. }
  194. }
  195. }
  196. #[derive(Debug, Clone)]
  197. pub struct AlignConfig {
  198. pub dorado_bin: String,
  199. pub dorado_basecall_arg: String,
  200. pub ref_fa: String,
  201. pub ref_mmi: String,
  202. pub samtools_view_threads: u16,
  203. pub samtools_sort_threads: u16,
  204. }
  205. impl Default for AlignConfig {
  206. fn default() -> Self {
  207. Self {
  208. dorado_bin: "/data/tools/dorado-1.0.0-linux-x64/bin/dorado".to_string(),
  209. // dorado_bin: "/data/tools/dorado-0.9.1-linux-x64/bin/dorado".to_string(),
  210. dorado_basecall_arg: "-x 'cuda:0,1,2,3' sup,5mC_5hmC".to_string(),
  211. // to specify cuda devices (exclude the T1000)
  212. ref_fa: "/data/ref/hs1/chm13v2.0.fa".to_string(),
  213. ref_mmi: "/data/ref/chm13v2.0.mmi".to_string(),
  214. samtools_view_threads: 20,
  215. samtools_sort_threads: 50,
  216. }
  217. }
  218. }
  219. impl Config {
  220. pub fn tumoral_dir(&self, id: &str) -> String {
  221. format!("{}/{}/{}", self.result_dir, id, self.tumoral_name)
  222. }
  223. pub fn normal_dir(&self, id: &str) -> String {
  224. format!("{}/{}/{}", self.result_dir, id, self.normal_name)
  225. }
  226. pub fn solo_dir(&self, id: &str, time: &str) -> String {
  227. format!("{}/{}/{}", self.result_dir, id, time)
  228. }
  229. pub fn solo_bam(&self, id: &str, time: &str) -> String {
  230. format!(
  231. "{}/{}_{}_{}.bam",
  232. self.solo_dir(id, time),
  233. id,
  234. time,
  235. self.reference_name,
  236. )
  237. }
  238. pub fn tumoral_bam(&self, id: &str) -> String {
  239. format!(
  240. "{}/{}_{}_{}.bam",
  241. self.tumoral_dir(id),
  242. id,
  243. self.tumoral_name,
  244. self.reference_name,
  245. )
  246. }
  247. pub fn normal_bam(&self, id: &str) -> String {
  248. format!(
  249. "{}/{}_{}_{}.bam",
  250. self.normal_dir(id),
  251. id,
  252. self.normal_name,
  253. self.reference_name,
  254. )
  255. }
  256. pub fn tumoral_haplotagged_bam(&self, id: &str) -> String {
  257. format!(
  258. "{}/{}_{}_{}_{}.bam",
  259. self.tumoral_dir(id),
  260. id,
  261. self.tumoral_name,
  262. self.reference_name,
  263. self.haplotagged_bam_tag_name
  264. )
  265. }
  266. pub fn normal_haplotagged_bam(&self, id: &str) -> String {
  267. format!(
  268. "{}/{}_{}_{}_{}.bam",
  269. self.normal_dir(id),
  270. id,
  271. self.normal_name,
  272. self.reference_name,
  273. self.haplotagged_bam_tag_name
  274. )
  275. }
  276. pub fn normal_dir_count(&self, id: &str) -> String {
  277. format!("{}/{}", self.normal_dir(id), self.count_dir_name)
  278. }
  279. pub fn tumoral_dir_count(&self, id: &str) -> String {
  280. format!("{}/{}", self.tumoral_dir(id), self.count_dir_name)
  281. }
  282. pub fn mask_bed(&self, id: &str) -> String {
  283. self.mask_bed
  284. .replace("{result_dir}", &self.result_dir)
  285. .replace("{id}", id)
  286. }
  287. pub fn germline_phased_vcf(&self, id: &str) -> String {
  288. self.germline_phased_vcf
  289. .replace("{result_dir}", &self.result_dir)
  290. .replace("{id}", id)
  291. }
  292. pub fn somatic_pipe_stats(&self, id: &str) -> String {
  293. self.somatic_pipe_stats
  294. .replace("{result_dir}", &self.result_dir)
  295. .replace("{id}", id)
  296. }
  297. // DeepVariant
  298. pub fn deepvariant_output_dir(&self, id: &str, time: &str) -> String {
  299. self.deepvariant_output_dir
  300. .replace("{result_dir}", &self.result_dir)
  301. .replace("{id}", id)
  302. .replace("{time}", time)
  303. }
  304. pub fn deepvariant_solo_output_vcf(&self, id: &str, time: &str) -> String {
  305. format!(
  306. "{}/{}",
  307. self.deepvariant_output_dir(id, time),
  308. *DEEPVARIANT_OUTPUT_NAME
  309. )
  310. .replace("{id}", id)
  311. .replace("{time}", time)
  312. }
  313. pub fn deepvariant_normal_output_dir(&self, id: &str) -> String {
  314. self.deepvariant_output_dir(id, &self.normal_name)
  315. }
  316. pub fn deepvariant_tumoral_output_dir(&self, id: &str) -> String {
  317. self.deepvariant_solo_passed_vcf(id, &self.tumoral_name)
  318. }
  319. pub fn deepvariant_solo_passed_vcf(&self, id: &str, time: &str) -> String {
  320. format!(
  321. "{}/{}_{}_DeepVariant_PASSED.vcf.gz",
  322. self.deepvariant_output_dir(id, time),
  323. id,
  324. time
  325. )
  326. }
  327. pub fn deepvariant_normal_passed_vcf(&self, id: &str) -> String {
  328. self.deepvariant_solo_passed_vcf(id, &self.normal_name)
  329. }
  330. pub fn deepvariant_tumoral_passed_vcf(&self, id: &str) -> String {
  331. self.deepvariant_solo_passed_vcf(id, &self.tumoral_name)
  332. }
  333. // DeepSomatic
  334. pub fn deepsomatic_output_dir(&self, id: &str) -> String {
  335. self.deepsomatic_output_dir
  336. .replace("{result_dir}", &self.result_dir)
  337. .replace("{id}", id)
  338. .replace("{time}", &self.tumoral_name)
  339. }
  340. pub fn deepsomatic_output_vcf(&self, id: &str) -> String {
  341. format!(
  342. "{}/{}_{}_DeepSomatic.vcf.gz",
  343. self.deepsomatic_output_dir(id),
  344. id,
  345. self.tumoral_name
  346. )
  347. }
  348. pub fn deepsomatic_passed_vcf(&self, id: &str) -> String {
  349. format!(
  350. "{}/{}_{}_DeepSomatic_PASSED.vcf.gz",
  351. // ERROR replace but before rename actually misplaced
  352. // self.deepsomatic_output_dir(id),
  353. self.deepvariant_normal_output_dir(id),
  354. id,
  355. self.tumoral_name
  356. )
  357. }
  358. // ClairS
  359. pub fn clairs_output_dir(&self, id: &str) -> String {
  360. self.clairs_output_dir
  361. .replace("{result_dir}", &self.result_dir)
  362. .replace("{id}", id)
  363. }
  364. pub fn clairs_output_vcfs(&self, id: &str) -> (String, String) {
  365. let dir = self.clairs_output_dir(id);
  366. (
  367. format!("{dir}/{}", *CLAIRS_OUTPUT_NAME),
  368. format!("{dir}/{}", *CLAIRS_OUTPUT_INDELS_NAME),
  369. )
  370. }
  371. pub fn clairs_passed_vcf(&self, id: &str) -> String {
  372. format!(
  373. "{}/{}_{}_clairs_PASSED.vcf.gz",
  374. self.clairs_output_dir(id),
  375. id,
  376. self.tumoral_name
  377. )
  378. }
  379. pub fn clairs_germline_normal_vcf(&self, id: &str) -> String {
  380. let dir = self.clairs_output_dir(id);
  381. format!("{dir}/{}", *CLAIRS_GERMLINE_NORMAL)
  382. }
  383. pub fn clairs_germline_tumor_vcf(&self, id: &str) -> String {
  384. let dir = self.clairs_output_dir(id);
  385. format!("{dir}/{}", *CLAIRS_GERMLINE_TUMOR)
  386. }
  387. pub fn clairs_germline_passed_vcf(&self, id: &str) -> String {
  388. let dir = self.clairs_output_dir(id);
  389. format!("{dir}/{id}_diag_clair3-germline_PASSED.vcf.gz")
  390. }
  391. // Nanomonsv
  392. pub fn nanomonsv_output_dir(&self, id: &str, time: &str) -> String {
  393. self.nanomonsv_output_dir
  394. .replace("{result_dir}", &self.result_dir)
  395. .replace("{id}", id)
  396. .replace("{time}", time)
  397. }
  398. pub fn nanomonsv_passed_vcf(&self, id: &str) -> String {
  399. self.nanomonsv_passed_vcf
  400. .replace("{output_dir}", &self.nanomonsv_output_dir(id, "diag"))
  401. .replace("{id}", id)
  402. }
  403. // Nanomonsv solo
  404. pub fn nanomonsv_solo_output_dir(&self, id: &str, time: &str) -> String {
  405. self.nanomonsv_solo_output_dir
  406. .replace("{result_dir}", &self.result_dir)
  407. .replace("{id}", id)
  408. .replace("{time}", time)
  409. }
  410. pub fn nanomonsv_solo_passed_vcf(&self, id: &str, time: &str) -> String {
  411. self.nanomonsv_solo_passed_vcf
  412. .replace("{output_dir}", &self.nanomonsv_solo_output_dir(id, time))
  413. .replace("{id}", id)
  414. .replace("{time}", time)
  415. }
  416. // Savana
  417. pub fn savana_output_dir(&self, id: &str) -> String {
  418. self.savana_output_dir
  419. .replace("{result_dir}", &self.result_dir)
  420. .replace("{id}", id)
  421. }
  422. pub fn savana_output_vcf(&self, id: &str) -> String {
  423. let output_dir = self.savana_output_dir(id);
  424. format!(
  425. "{output_dir}/{id}_{}_{}_{}.classified.somatic.vcf",
  426. self.tumoral_name, self.reference_name, self.haplotagged_bam_tag_name
  427. )
  428. }
  429. pub fn savana_passed_vcf(&self, id: &str) -> String {
  430. self.savana_passed_vcf
  431. .replace("{output_dir}", &self.savana_output_dir(id))
  432. .replace("{id}", id)
  433. }
  434. // {output_dir}/{id}_diag_{reference_name}_{haplotagged_bam_tag_name}
  435. pub fn savana_read_counts(&self, id: &str) -> String {
  436. self.savana_read_counts
  437. .replace("{output_dir}", &self.savana_output_dir(id))
  438. .replace("{id}", id)
  439. .replace("{reference_name}", &self.reference_name)
  440. .replace("{haplotagged_bam_tag_name}", &self.haplotagged_bam_tag_name)
  441. }
  442. pub fn savana_copy_number(&self, id: &str) -> String {
  443. self.savana_copy_number
  444. .replace("{output_dir}", &self.savana_output_dir(id))
  445. .replace("{id}", id)
  446. .replace("{reference_name}", &self.reference_name)
  447. .replace("{haplotagged_bam_tag_name}", &self.haplotagged_bam_tag_name)
  448. }
  449. // Severus
  450. pub fn severus_output_dir(&self, id: &str) -> String {
  451. self.severus_output_dir
  452. .replace("{result_dir}", &self.result_dir)
  453. .replace("{id}", id)
  454. }
  455. pub fn severus_output_vcf(&self, id: &str) -> String {
  456. let output_dir = self.severus_output_dir(id);
  457. format!("{output_dir}/somatic_SVs/severus_somatic.vcf")
  458. }
  459. pub fn severus_passed_vcf(&self, id: &str) -> String {
  460. format!(
  461. "{}/{}_diag_severus_PASSED.vcf.gz",
  462. &self.severus_output_dir(id),
  463. id
  464. )
  465. }
  466. // Severus solo
  467. pub fn severus_solo_output_dir(&self, id: &str, time: &str) -> String {
  468. self.severus_solo_output_dir
  469. .replace("{result_dir}", &self.result_dir)
  470. .replace("{id}", id)
  471. .replace("{time}", time)
  472. }
  473. pub fn severus_solo_output_vcf(&self, id: &str, time: &str) -> String {
  474. let output_dir = self.severus_solo_output_dir(id, time);
  475. format!("{output_dir}/all_SVs/severus_all.vcf")
  476. }
  477. pub fn severus_solo_passed_vcf(&self, id: &str, time: &str) -> String {
  478. format!(
  479. "{}/{}_{}_severus-solo_PASSED.vcf.gz",
  480. &self.severus_solo_output_dir(id, time),
  481. id,
  482. time
  483. )
  484. }
  485. pub fn constit_vcf(&self, id: &str) -> String {
  486. self.clairs_germline_passed_vcf(id)
  487. // format!("{}/{}_variants_constit.vcf.gz", self.tumoral_dir(id), id)
  488. }
  489. pub fn constit_phased_vcf(&self, id: &str) -> String {
  490. format!(
  491. "{}/{}_variants_constit_phased.vcf.gz",
  492. self.tumoral_dir(id),
  493. id
  494. )
  495. }
  496. // SomaticScan
  497. pub fn somatic_scan_solo_output_dir(&self, id: &str, time: &str) -> String {
  498. format!("{}/counts", self.solo_dir(id, time))
  499. }
  500. pub fn somatic_scan_normal_output_dir(&self, id: &str) -> String {
  501. self.somatic_scan_solo_output_dir(id, &self.normal_name)
  502. }
  503. pub fn somatic_scan_tumoral_output_dir(&self, id: &str) -> String {
  504. self.somatic_scan_solo_output_dir(id, &self.tumoral_name)
  505. }
  506. pub fn somatic_scan_solo_count_file(&self, id: &str, time: &str, contig: &str) -> String {
  507. format!(
  508. "{}/{}_count.tsv.gz",
  509. self.somatic_scan_solo_output_dir(id, time),
  510. contig
  511. )
  512. }
  513. pub fn somatic_scan_normal_count_file(&self, id: &str, contig: &str) -> String {
  514. self.somatic_scan_solo_count_file(id, &self.normal_name, contig)
  515. }
  516. pub fn somatic_scan_tumoral_count_file(&self, id: &str, contig: &str) -> String {
  517. self.somatic_scan_solo_count_file(id, &self.tumoral_name, contig)
  518. }
  519. // Modkit
  520. pub fn modkit_summary_file(&self, id: &str, time: &str) -> String {
  521. self.modkit_summary_file
  522. .replace("{result_dir}", &self.result_dir)
  523. .replace("{id}", id)
  524. .replace("{time}", time)
  525. }
  526. pub fn longphase_modcall_vcf(&self, id: &str, time: &str) -> String {
  527. self.longphase_modcall_vcf
  528. .replace("{result_dir}", &self.result_dir)
  529. .replace("{id}", id)
  530. .replace("{time}", time)
  531. }
  532. }