@@ -10,13 +10,16 @@ def _get_args():
1010 '''This function parses and return arguments passed in'''
1111 parser = argparse .ArgumentParser (
1212 prog = 'ADRSM v' + str (version ),
13- description = 'Ancient DNA Read Simulator for Metagenomics' )
13+ formatter_class = argparse .RawDescriptionHelpFormatter ,
14+ description = '''
15+ ==================================================\n
16+ ADRSM: Ancient DNA Read Simulator for Metagenomics\n
17+ Author: Maxime Borry\n
18+ Contact: <borry[at]shh.mpg.de>\n
19+ Homepage & Documentation: github.com/maxibor/adrsm
20+ ==================================================
21+ ''' )
1422 parser .add_argument ('confFile' , help = "path to configuration file" )
15- parser .add_argument (
16- '-d' ,
17- dest = "directory" ,
18- default = "." ,
19- help = "path to genome directory. Default = ." )
2023 parser .add_argument (
2124 '-r' ,
2225 dest = 'readLength' ,
@@ -86,7 +89,6 @@ def _get_args():
8689 args = parser .parse_args ()
8790
8891 infile = args .confFile
89- gendir = args .directory
9092 readlen = int (args .readLength )
9193 nbinom = int (args .nbinom )
9294 a1 = args .fwdAdapt
@@ -101,10 +103,10 @@ def _get_args():
101103 seed = int (args .seed )
102104 threads = int (args .threads )
103105
104- return (infile , gendir , readlen , nbinom , a1 , a2 , err , geom_p , themin , themax , outfile , quality , stats , seed , threads )
106+ return (infile , readlen , nbinom , a1 , a2 , err , geom_p , themin , themax , outfile , quality , stats , seed , threads )
105107
106108
107- def read_config (infile , gendir ):
109+ def read_config (infile ):
108110 """
109111 READS CONFIG FILE AND RETURNS CONFIG DICT
110112 """
@@ -128,20 +130,20 @@ def read_config(infile, gendir):
128130 mutrate = 0
129131 age = 0
130132
131- genomes [gendir + "/" + agenome ] = {'size' : ainsert ,
132- 'cov' : acov , 'deam' : deamination , 'mutate' : mutate , 'mutrate' : mutrate , 'age' : age }
133+ genomes [agenome ] = {'size' : ainsert ,
134+ 'cov' : acov , 'deam' : deamination , 'mutate' : mutate , 'mutrate' : mutrate , 'age' : age }
133135 return (genomes )
134136
135137
136138if __name__ == "__main__" :
137- version = 0.7
138- INFILE , GENDIR , READLEN , NBINOM , A1 , A2 , ERR , GEOM_P , THEMIN , THEMAX , OUTFILE , QUALITY , STATS , SEED , PROCESS = _get_args ()
139+ version = 0.8
140+ INFILE , READLEN , NBINOM , A1 , A2 , ERR , GEOM_P , THEMIN , THEMAX , OUTFILE , QUALITY , STATS , SEED , PROCESS = _get_args ()
139141
140142 MINLENGTH = 20
141143 npr .seed (SEED )
142144 genome_dict = {}
143145 stat_dict = {}
144- all_genomes = read_config (INFILE , GENDIR )
146+ all_genomes = read_config (INFILE )
145147 for agenome in all_genomes .keys ():
146148 stat_and_run = ad .run_read_simulation_multi (INFILE = agenome ,
147149 COV = all_genomes [agenome ]['cov' ],
0 commit comments