config.rs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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. "
  115. .to_string(),
  116. conda_sh: "/data/miniconda3/etc/profile.d/conda.sh".to_string(),
  117. somatic_pipe_stats: "{result_dir}/{id}/diag/somatic_pipe_stats"
  118. .to_string(),
  119. // DeepVariant
  120. deepvariant_output_dir: "{result_dir}/{id}/{time}/DeepVariant".to_string(),
  121. deepvariant_threads: 150,
  122. deepvariant_bin_version: "1.8.0".to_string(),
  123. deepvariant_model_type: "ONT_R104".to_string(),
  124. deepvariant_force: false,
  125. // DeepSomatic
  126. deepsomatic_output_dir: "{result_dir}/{id}/{time}/DeepSomatic".to_string(),
  127. deepsomatic_threads: 155,
  128. deepsomatic_bin_version: "1.8.0".to_string(),
  129. deepsomatic_model_type: "ONT".to_string(),
  130. deepsomatic_force: false,
  131. // ClairS
  132. clairs_output_dir: "{result_dir}/{id}/diag/ClairS".to_string(),
  133. clairs_threads: 155,
  134. clairs_platform: "ont_r10_dorado_sup_5khz_ssrs".to_string(),
  135. clairs_force: false,
  136. // Savana
  137. savana_bin: "savana".to_string(),
  138. // savana_bin: "/home/prom/.local/bin/savana".to_string(),
  139. savana_threads: 150,
  140. savana_output_dir: "{result_dir}/{id}/diag/savana".to_string(),
  141. savana_passed_vcf: "{output_dir}/{id}_diag_savana_PASSED.vcf.gz".to_string(),
  142. savana_copy_number: "{output_dir}/{id}_diag_{reference_name}_{haplotagged_bam_tag_name}_segmented_absolute_copy_number.tsv".to_string(),
  143. savana_read_counts: "{output_dir}/{id}_diag_{reference_name}_{haplotagged_bam_tag_name}_raw_read_counts.tsv".to_string(),
  144. savana_force: false,
  145. // Severus
  146. severus_bin: "/data/tools/Severus/severus.py".to_string(),
  147. severus_threads: 32,
  148. vntrs_bed: "/data/ref/hs1/vntrs_chm13.bed".to_string(),
  149. severus_pon: "/data/ref/hs1/PoN_1000G_chm13.tsv.gz".to_string(),
  150. severus_output_dir: "{result_dir}/{id}/diag/severus".to_string(),
  151. severus_solo_output_dir: "{result_dir}/{id}/{time}/severus".to_string(),
  152. severus_force: false,
  153. // Longphase
  154. longphase_bin: "/data/tools/longphase_linux-x64".to_string(),
  155. longphase_threads: 150,
  156. longphase_modcall_threads: 8, // ! out of memory
  157. longphase_modcall_vcf:
  158. "{result_dir}/{id}/{time}/5mC_5hmC/{id}_{time}_5mC_5hmC_modcall.vcf.gz".to_string(),
  159. // modkit
  160. modkit_bin: "modkit".to_string(),
  161. modkit_summary_threads: 50,
  162. modkit_summary_file: "{result_dir}/{id}/{time}/{id}_{time}_5mC_5hmC_summary.txt"
  163. .to_string(),
  164. // Nanomonsv
  165. // tabix, bgzip, mafft in PATH
  166. // pip install pysam, parasail; pip install nanomonsv
  167. nanomonsv_bin: "/home/prom/.local/bin/nanomonsv".to_string(),
  168. nanomonsv_output_dir: "{result_dir}/{id}/{time}/nanomonsv".to_string(),
  169. nanomonsv_threads: 150,
  170. nanomonsv_force: false,
  171. nanomonsv_passed_vcf: "{output_dir}/{id}_diag_nanomonsv_PASSED.vcf.gz".to_string(),
  172. nanomonsv_solo_output_dir: "{result_dir}/{id}/{time}/nanomonsv-solo".to_string(),
  173. nanomonsv_solo_passed_vcf: "{output_dir}/{id}_{time}_nanomonsv-solo_PASSED.vcf.gz"
  174. .to_string(),
  175. // Scan
  176. somatic_scan_force: false,
  177. // Pipe
  178. somatic_pipe_force: true,
  179. somatic_pipe_threads: 150,
  180. somatic_min_constit_depth: 5,
  181. somatic_max_alt_constit: 1,
  182. entropy_seq_len: 10,
  183. min_shannon_entropy: 1.0,
  184. max_depth_low_quality: 20,
  185. min_high_quality_depth: 14,
  186. min_n_callers: 1,
  187. early_bed: "/data/ref/hs1/replication_early_25_hs1.bed".to_string(),
  188. late_bed: "/data/ref/hs1/replication_late_75_hs1.bed".to_string(),
  189. panels: vec![
  190. ("OncoT".to_string(), "/data/ref/hs1/V1_V2_V3_V4_V5_intersect_targets_hs1_uniq.bed".to_string()),
  191. ("variable_chips".to_string(), "/data/ref/hs1/top_1500_sd_pos.bed".to_string()),
  192. ],
  193. cpg_bed: "/data/ref/hs1/hs1/hs1_CpG.bed".to_string(),
  194. }
  195. }
  196. }
  197. #[derive(Debug, Clone)]
  198. pub struct AlignConfig {
  199. pub dorado_bin: String,
  200. pub dorado_basecall_arg: String,
  201. pub ref_fa: String,
  202. pub ref_mmi: String,
  203. pub samtools_view_threads: u16,
  204. pub samtools_sort_threads: u16,
  205. }
  206. impl Default for AlignConfig {
  207. fn default() -> Self {
  208. Self {
  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. self.deepvariant_normal_output_dir(id),
  352. id,
  353. self.tumoral_name
  354. )
  355. }
  356. // ClairS
  357. pub fn clairs_output_dir(&self, id: &str) -> String {
  358. self.clairs_output_dir
  359. .replace("{result_dir}", &self.result_dir)
  360. .replace("{id}", id)
  361. }
  362. pub fn clairs_output_vcfs(&self, id: &str) -> (String, String) {
  363. let dir = self.clairs_output_dir(id);
  364. (
  365. format!("{dir}/{}", *CLAIRS_OUTPUT_NAME),
  366. format!("{dir}/{}", *CLAIRS_OUTPUT_INDELS_NAME),
  367. )
  368. }
  369. pub fn clairs_passed_vcf(&self, id: &str) -> String {
  370. format!(
  371. "{}/{}_{}_clairs_PASSED.vcf.gz",
  372. self.clairs_output_dir(id),
  373. id,
  374. self.tumoral_name
  375. )
  376. }
  377. pub fn clairs_germline_normal_vcf(&self, id: &str) -> String {
  378. let dir = self.clairs_output_dir(id);
  379. format!("{dir}/{}", *CLAIRS_GERMLINE_NORMAL)
  380. }
  381. pub fn clairs_germline_tumor_vcf(&self, id: &str) -> String {
  382. let dir = self.clairs_output_dir(id);
  383. format!("{dir}/{}", *CLAIRS_GERMLINE_TUMOR)
  384. }
  385. pub fn clairs_germline_passed_vcf(&self, id: &str) -> String {
  386. let dir = self.clairs_output_dir(id);
  387. format!("{dir}/{id}_diag_clair3-germline_PASSED.vcf.gz")
  388. }
  389. // Nanomonsv
  390. pub fn nanomonsv_output_dir(&self, id: &str, time: &str) -> String {
  391. self.nanomonsv_output_dir
  392. .replace("{result_dir}", &self.result_dir)
  393. .replace("{id}", id)
  394. .replace("{time}", time)
  395. }
  396. pub fn nanomonsv_passed_vcf(&self, id: &str) -> String {
  397. self.nanomonsv_passed_vcf
  398. .replace("{output_dir}", &self.nanomonsv_output_dir(id, "diag"))
  399. .replace("{id}", id)
  400. }
  401. // Nanomonsv solo
  402. pub fn nanomonsv_solo_output_dir(&self, id: &str, time: &str) -> String {
  403. self.nanomonsv_solo_output_dir
  404. .replace("{result_dir}", &self.result_dir)
  405. .replace("{id}", id)
  406. .replace("{time}", time)
  407. }
  408. pub fn nanomonsv_solo_passed_vcf(&self, id: &str, time: &str) -> String {
  409. self.nanomonsv_solo_passed_vcf
  410. .replace("{output_dir}", &self.nanomonsv_solo_output_dir(id, time))
  411. .replace("{id}", id)
  412. .replace("{time}", time)
  413. }
  414. // Savana
  415. pub fn savana_output_dir(&self, id: &str) -> String {
  416. self.savana_output_dir
  417. .replace("{result_dir}", &self.result_dir)
  418. .replace("{id}", id)
  419. }
  420. pub fn savana_output_vcf(&self, id: &str) -> String {
  421. let output_dir = self.savana_output_dir(id);
  422. format!(
  423. "{output_dir}/{id}_{}_{}_{}.classified.somatic.vcf",
  424. self.tumoral_name, self.reference_name, self.haplotagged_bam_tag_name
  425. )
  426. }
  427. pub fn savana_passed_vcf(&self, id: &str) -> String {
  428. self.savana_passed_vcf
  429. .replace("{output_dir}", &self.savana_output_dir(id))
  430. .replace("{id}", id)
  431. }
  432. // {output_dir}/{id}_diag_{reference_name}_{haplotagged_bam_tag_name}
  433. pub fn savana_read_counts(&self, id: &str) -> String {
  434. self.savana_read_counts
  435. .replace("{output_dir}", &self.savana_output_dir(id))
  436. .replace("{id}", id)
  437. .replace("{reference_name}", &self.reference_name)
  438. .replace("{haplotagged_bam_tag_name}", &self.haplotagged_bam_tag_name)
  439. }
  440. pub fn savana_copy_number(&self, id: &str) -> String {
  441. self.savana_copy_number
  442. .replace("{output_dir}", &self.savana_output_dir(id))
  443. .replace("{id}", id)
  444. .replace("{reference_name}", &self.reference_name)
  445. .replace("{haplotagged_bam_tag_name}", &self.haplotagged_bam_tag_name)
  446. }
  447. // Severus
  448. pub fn severus_output_dir(&self, id: &str) -> String {
  449. self.severus_output_dir
  450. .replace("{result_dir}", &self.result_dir)
  451. .replace("{id}", id)
  452. }
  453. pub fn severus_output_vcf(&self, id: &str) -> String {
  454. let output_dir = self.severus_output_dir(id);
  455. format!("{output_dir}/somatic_SVs/severus_somatic.vcf")
  456. }
  457. pub fn severus_passed_vcf(&self, id: &str) -> String {
  458. format!(
  459. "{}/{}_diag_severus_PASSED.vcf.gz",
  460. &self.severus_output_dir(id),
  461. id
  462. )
  463. }
  464. // Severus solo
  465. pub fn severus_solo_output_dir(&self, id: &str, time: &str) -> String {
  466. self.severus_solo_output_dir
  467. .replace("{result_dir}", &self.result_dir)
  468. .replace("{id}", id)
  469. .replace("{time}", time)
  470. }
  471. pub fn severus_solo_output_vcf(&self, id: &str, time: &str) -> String {
  472. let output_dir = self.severus_solo_output_dir(id, time);
  473. format!("{output_dir}/all_SVs/severus_all.vcf")
  474. }
  475. pub fn severus_solo_passed_vcf(&self, id: &str, time: &str) -> String {
  476. format!(
  477. "{}/{}_{}_severus-solo_PASSED.vcf.gz",
  478. &self.severus_solo_output_dir(id, time),
  479. id,
  480. time
  481. )
  482. }
  483. pub fn constit_vcf(&self, id: &str) -> String {
  484. self.clairs_germline_passed_vcf(id)
  485. // format!("{}/{}_variants_constit.vcf.gz", self.tumoral_dir(id), id)
  486. }
  487. pub fn constit_phased_vcf(&self, id: &str) -> String {
  488. format!(
  489. "{}/{}_variants_constit_phased.vcf.gz",
  490. self.tumoral_dir(id),
  491. id
  492. )
  493. }
  494. // SomaticScan
  495. pub fn somatic_scan_solo_output_dir(&self, id: &str, time: &str) -> String {
  496. format!("{}/counts", self.solo_dir(id, time))
  497. }
  498. pub fn somatic_scan_normal_output_dir(&self, id: &str) -> String {
  499. self.somatic_scan_solo_output_dir(id, &self.normal_name)
  500. }
  501. pub fn somatic_scan_tumoral_output_dir(&self, id: &str) -> String {
  502. self.somatic_scan_solo_output_dir(id, &self.tumoral_name)
  503. }
  504. pub fn somatic_scan_solo_count_file(&self, id: &str, time: &str, contig: &str) -> String {
  505. format!(
  506. "{}/{}_count.tsv.gz",
  507. self.somatic_scan_solo_output_dir(id, time),
  508. contig
  509. )
  510. }
  511. pub fn somatic_scan_normal_count_file(&self, id: &str, contig: &str) -> String {
  512. self.somatic_scan_solo_count_file(id, &self.normal_name, contig)
  513. }
  514. pub fn somatic_scan_tumoral_count_file(&self, id: &str, contig: &str) -> String {
  515. self.somatic_scan_solo_count_file(id, &self.tumoral_name, contig)
  516. }
  517. // Modkit
  518. pub fn modkit_summary_file(&self, id: &str, time: &str) -> String {
  519. self.modkit_summary_file
  520. .replace("{result_dir}", &self.result_dir)
  521. .replace("{id}", id)
  522. .replace("{time}", time)
  523. }
  524. pub fn longphase_modcall_vcf(&self, id: &str, time: &str) -> String {
  525. self.longphase_modcall_vcf
  526. .replace("{result_dir}", &self.result_dir)
  527. .replace("{id}", id)
  528. .replace("{time}", time)
  529. }
  530. }