@@ -268,6 +268,24 @@ def common_options(func):
268268 type = click .Path (),
269269 default = "nothing" ,
270270 ),
271+ click .option (
272+ "--depth_filter" ,
273+ help = "Filters all contigs low than this fraction of the chromosome read depth. Will apply on both long- and short-read sets for plassembler run." ,
274+ type = float ,
275+ default = 0.25 ,
276+ ),
277+ click .option (
278+ "--unicycler_options" ,
279+ help = 'Extra Unicycler options - must be encapsulated by quotation marks if multiple "--no_rotate --mode conservative" ' ,
280+ type = str ,
281+ default = None ,
282+ ),
283+ click .option (
284+ "--spades_options" ,
285+ help = 'Extra spades options for Unicycler - must be encapsulated by quotation marks "--tmp-dir /tmp" ' ,
286+ type = str ,
287+ default = None ,
288+ ),
271289 ]
272290 for option in reversed (options ):
273291 func = option (func )
@@ -374,6 +392,9 @@ def run(
374392 flye_assembly ,
375393 flye_info ,
376394 no_chromosome ,
395+ depth_filter ,
396+ unicycler_options ,
397+ spades_options ,
377398 ** kwargs ,
378399):
379400 """Runs Plassembler"""
@@ -401,6 +422,9 @@ def run(
401422 logger .info (f"--flye_info is { flye_info } " )
402423 logger .info (f"--no_chromosome is { no_chromosome } " )
403424 logger .info (f"--use_raven is { use_raven } " )
425+ logger .info (f"--depth_filter is { depth_filter } " )
426+ logger .info (f"--unicycler_options is { unicycler_options } " )
427+ logger .info (f"--spades_options is { spades_options } " )
404428 logdir = Path (f"{ outdir } /logs" )
405429
406430 # check deps
@@ -605,7 +629,14 @@ def run(
605629 unicycler_dir : Path = Path (outdir ) / "unicycler_output"
606630
607631 run_unicycler (
608- threads , logdir , short_r1 , short_r2 , long_reads , unicycler_dir
632+ threads ,
633+ logdir ,
634+ short_r1 ,
635+ short_r2 ,
636+ long_reads ,
637+ unicycler_dir ,
638+ unicycler_options ,
639+ spades_options ,
609640 )
610641
611642 # check for successful unicycler completion
@@ -631,7 +662,7 @@ def run(
631662 # processes output
632663 plass .process_mash_tsv (database )
633664 # combine depth and mash tsvs
634- plass .combine_depth_mash_tsvs (prefix )
665+ plass .combine_depth_mash_tsvs (prefix , depth_filter )
635666
636667 # rename contigs and update copy bumber with plsdb
637668 plass .finalise_contigs (prefix )
@@ -790,7 +821,14 @@ def run(
790821 unicycler_dir : Path = Path (outdir ) / "unicycler_output"
791822
792823 run_unicycler (
793- threads , logdir , short_r1 , short_r2 , long_reads , unicycler_dir
824+ threads ,
825+ logdir ,
826+ short_r1 ,
827+ short_r2 ,
828+ long_reads ,
829+ unicycler_dir ,
830+ unicycler_options ,
831+ spades_options ,
794832 )
795833
796834 # check for successful unicycler completion
@@ -822,7 +860,7 @@ def run(
822860 # processes output
823861 plass .process_mash_tsv (database )
824862 # combine depth and mash tsvs
825- plass .combine_depth_mash_tsvs (prefix )
863+ plass .combine_depth_mash_tsvs (prefix , depth_filter )
826864
827865 # rename contigs and update copy bumber with plsdb
828866 plass .finalise_contigs (prefix )
@@ -948,6 +986,7 @@ def assembled(
948986 logger .info (f"--skip_qc is { skip_qc } " )
949987 logger .info (f"--pacbio_model is { pacbio_model } " )
950988 logger .info (f"--no_copy_numbers is { no_copy_numbers } " )
989+ logger .info (f"--no_copy_numbers is { no_copy_numbers } " )
951990 logdir = Path (f"{ outdir } /logs" )
952991
953992 # check deps
@@ -1189,6 +1228,24 @@ def long_options(func):
11891228 type = float ,
11901229 default = 0.12 ,
11911230 ),
1231+ click .option (
1232+ "--depth_filter" ,
1233+ help = "Filters all contigs low than this fraction of the chromosome read depth. Will apply on both long- and short-read sets for plassembler run." ,
1234+ type = float ,
1235+ default = 0.25 ,
1236+ ),
1237+ click .option (
1238+ "--unicycler_options" ,
1239+ help = 'Extra Unicycler options - must be encapsulated by quotation marks if multiple "--no_rotate --mode conservative" ' ,
1240+ type = str ,
1241+ default = None ,
1242+ ),
1243+ click .option (
1244+ "--spades_options" ,
1245+ help = 'Extra spades options for Unicycler - must be encapsulated by quotation marks "--tmp-dir /tmp" ' ,
1246+ type = str ,
1247+ default = None ,
1248+ ),
11921249 ]
11931250 for option in reversed (options ):
11941251 func = option (func )
@@ -1222,6 +1279,9 @@ def long(
12221279 canu_flag ,
12231280 corrected_error_rate ,
12241281 no_chromosome ,
1282+ depth_filter ,
1283+ unicycler_options ,
1284+ spades_options ,
12251285 ** kwargs ,
12261286):
12271287 """
@@ -1248,6 +1308,9 @@ def long(
12481308 logger .info (f"--flye_info is { flye_info } " )
12491309 logger .info (f"--corrected_error_rate is { corrected_error_rate } " )
12501310 logger .info (f"--no_chromosome is { no_chromosome } " )
1311+ logger .info (f"--depth_filter is { depth_filter } " )
1312+ logger .info (f"--unicycler_options is { unicycler_options } " )
1313+ logger .info (f"--spades_options is { spades_options } " )
12511314 logdir = Path (f"{ outdir } /logs" )
12521315
12531316 # check deps
@@ -1509,7 +1572,13 @@ def long(
15091572
15101573 unicycler_dir : Path = Path (outdir ) / "unicycler_output"
15111574 run_unicycler_long (
1512- threads , logdir , corrected_fastqs , entropy_filtered_fastq , unicycler_dir
1575+ threads ,
1576+ logdir ,
1577+ corrected_fastqs ,
1578+ entropy_filtered_fastq ,
1579+ unicycler_dir ,
1580+ unicycler_options ,
1581+ spades_options ,
15131582 )
15141583 remove_file (corrected_fastqs )
15151584 assembled_fasta = os .path .join (outdir , "unicycler_output" , "assembly.fasta" )
@@ -1557,7 +1626,7 @@ def long(
15571626 plass .process_mash_tsv (database )
15581627
15591628 # combine depth and mash tsvs
1560- plass .combine_depth_mash_tsvs (prefix )
1629+ plass .combine_depth_mash_tsvs (prefix , depth_filter )
15611630
15621631 # rename contigs and update copy number with plsdb
15631632 plass .finalise_contigs_long (prefix )
0 commit comments