Skip to content
Snippets Groups Projects

fix: add cli to sample_from_input

Closed Michele Garioni requested to merge feature into main
7 unresolved threads
2 files
+ 65
4
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -71,3 +71,30 @@ def sample_from_input(
@@ -71,3 +71,30 @@ def sample_from_input(
myfile.write(line + '\n')
myfile.write(line + '\n')
myfile.close()
myfile.close()
LOG.info('output written.')
LOG.info('output written.')
 
 
 
def main():
 
"""CLI interface for the transcripts sampler.
 
 
Accepts arguments from the command line and
 
runs the transcript sampler.
 
"""
 
import argparse
 
parser = argparse.ArgumentParser(description='Read functions argument')
 
parser.add_argument('input', action='store',
 
type=Path, help='path of the input file')
 
parser.add_argument('-o', action='store',
 
type=Path, default=Path.cwd() / 'sampled_cell.csv',
 
help='path of the output file')
 
parser.add_argument('-n', action='store',
 
type=int, default=10000,
 
help='number of total reads to be simulated')
 
parser.add_argument('-sep', action='store',
 
type=str, default=',',
 
help='separator of the input file')
 
args = parser.parse_args()
 
sample_from_input(args.input, args.o, args.n, args.sep)
 
 
 
if __name__ == '__main__':
 
main()
Loading