By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,640 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,640 IT Pros & Developers. It's quick & easy.

Easy Python Function Question

P: 3
I need to create a program called extractGenes.py

The command line parameters need to take 2 OR 3 parameters

1. -s: this is an optional parameter, or switch, indicating that the user wwants the spliced gene sequence(introns removed). The user does not have to provide this (meaning he wants the entire gene sequence), but it he does provide it then it must be the first parameter

2. input file (with the genes)

3. output file (where the program will create to store the fasta file

the file contains line like this:

NM_001003443 chr11 + 5925152 592608098 2 5925152,5925652, 5925404,5926898,

However, I am not sure how to include the -s, optional parameter, into the starting function.
Apr 21 '12 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 626
Check the length (or elements) of sys.argv to see if -s was used.
Apr 21 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.