@@ -13,6 +13,8 @@ from prince import __version__
1313
1414DEFAULT_K = 25
1515DEFAULT_BOOST_OUTPUT = resource_filename ('prince.resources' , 'training_data_w_extensions.txt' )
16+ DEFAULT_PRIMERS = resource_filename ('prince.resources' , 'TB_primers_extended.json' )
17+ DEFAULT_TEMPLATES = resource_filename ('prince.resources' , 'templates.fasta' )
1618
1719def main ():
1820 parser = argparse .ArgumentParser (description = 'Prince Options.' )
@@ -21,7 +23,7 @@ def main():
2123 help = "output file for training data / training data used to predict copy numbers for queries" )
2224 parser .add_argument ('-to' , '--target_output' , default = "results/predictions.csv" ,
2325 help = "output file for query copy number predictions" )
24- parser .add_argument ('-tmp' ,'--templates' , default = "templates.fasta" ,
26+ parser .add_argument ('-tmp' ,'--templates' , default = DEFAULT_TEMPLATES ,
2527 help = "VNTR templates. Default is for M.TB" )
2628 parser .add_argument ('-tf' , '--target_file' , default = None ,
2729 help = "target genome names in a text file" )
@@ -31,7 +33,7 @@ def main():
3133 help = "Kmer size used during read recruitment." )
3234 parser .add_argument ('-cn' , '--copynumber' , default = 1 ,type = int ,
3335 help = "Copy number for training genome." )
34- parser .add_argument ('-p' , '--primers' , default = "TB_primers_extended.json" ,
36+ parser .add_argument ('-p' , '--primers' , default = DEFAULT_PRIMERS ,
3537 help = "Flanking sequences used in coverage adjustments" )
3638 parser .add_argument ('-np' , '--num_procs' , default = 1 ,type = int ,
3739 help = "Number of cores for parallel processing." )
@@ -44,12 +46,12 @@ def main():
4446 if prince_options .k != DEFAULT_K and prince_options .boost_output == DEFAULT_BOOST_OUTPUT :
4547 warnings .warn ("Warning: Target kmer size does not equal training settings. May lead to inaccurate predictions." )
4648
47- with open (resource_filename ( 'prince.resources' , prince_options .primers ) ) as primers :
49+ with open (prince_options .primers ) as primers :
4850 primers = json .load (primers )
4951
5052 #Template data initialized
5153
52- templates = list (SeqIO .parse (resource_filename ( 'prince.resources' , prince_options .templates ) , "fasta" ))
54+ templates = list (SeqIO .parse (prince_options .templates , "fasta" ))
5355 templateNames = [t .id for t in templates ]
5456 templates = [str (t .seq ) for t in templates ]
5557
0 commit comments