45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
'''
|
|
Created on 8 mars 2016
|
|
|
|
@author: coissac
|
|
'''
|
|
|
|
from obitools3.apps.progress import ProgressBar # @UnresolvedImport
|
|
import time
|
|
|
|
__title__="Counts sequences in a sequence set"
|
|
|
|
|
|
default_config = { 'countmode' : None
|
|
}
|
|
|
|
def addOptions(parser):
|
|
parser.add_argument(dest='obi:input', metavar='obi:input',
|
|
nargs='?',
|
|
default=None,
|
|
help='input data set' )
|
|
|
|
group=parser.add_argument_group('Obicount specific options')
|
|
group.add_argument('-s','--sequence',
|
|
action="store_true", dest="count:sequence",
|
|
default=False,
|
|
help="Prints only the number of sequence records."
|
|
)
|
|
|
|
group.add_argument('-a','--all',
|
|
action="store_true", dest="count:all",
|
|
default=False,
|
|
help="Prints only the total count of sequence records (if a sequence has no `count` attribute, its default count is 1) (default: False)."
|
|
)
|
|
|
|
|
|
|
|
def run(config):
|
|
# The code of my command
|
|
pb = ProgressBar(1000,config,seconde=1)
|
|
|
|
for i in range(1,1001):
|
|
pb(i)
|
|
time.sleep(0.01)
|
|
|