<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><div>I want to write a function in Python for a tab delimited file I am dealing with,to filter out values from a column, and put that parameter as a command line option while running the script.</div><div><br></div><div>So,if the limit is 10,the filter out all the rows with values less than 10.</div><div>Also,I want to check if the number entered is numeric or not else display the message "its not numeric".</div><div><br></div><div><br></div><div>So,the command line would be:</div><div><br></div><div>    python script.py file --quality [limit]</div><div><br></div><div>    </div><div>  The Python script:</div><div><br></div><div>    import sys</div><div>    arg = []</div><div>        for a in sys.argv:</div><div><span class="Apple-tab-span"
 style="white-space:pre">  </span>    arg.append(a) </div><div>            quality = arg[2]</div><div><br></div><div><br></div><div>To be more specific,the file I am dealing with is a Samfile,and using package </div><div>Pysam,which has mapping quality limits in the 5th column.</div><div><br></div><div>https://media.readthedocs.org/pdf/pysam/latest/pysam.pdf</div><div><br></div><div>Commandline:</div><div><br></div><div>      python script.py samfile --quality [limit]</div><div><br></div><div> I am reading the samfile using this:</div><div><br></div><div>     samfile = pysam.Samfile(arg[1], "rb" )</div><div>     mapqlim = arg[2]</div><div><br></div><div>I am a Python beginner,but saw one of the modules,argparse. How can I accomplish this using argparse in Python?</div><div><br></div><div><br></div></div></div></body></html>