# Path: dark/reads.py
# def addFASTACommandLineOptions(parser):
#     """
#     Add standard command-line options to an argparse parser.
# 
#     @param parser: An C{argparse.ArgumentParser} instance.
#     """
# 
#     parser.add_argument(
#         '--fastaFile', type=open, default=sys.stdin, metavar='FILENAME',
#         help=('The name of the FASTA input file. Standard input will be read '
#               'if no file name is given.'))
# 
#     parser.add_argument(
#         '--readClass', default='DNARead', choices=readClassNameToClass,
#         metavar='CLASSNAME',
#         help=('If specified, give the type of the reads in the input. '
#               'Possible choices: %s.' % ', '.join(readClassNameToClass)))
# 
#     # A mutually exclusive group for either --fasta, --fastq, or --fasta-ss
#     group = parser.add_mutually_exclusive_group()
# 
#     group.add_argument(
#         '--fasta', default=False, action='store_true',
#         help=('If specified, input will be treated as FASTA. This is the '
#               'default.'))
# 
#     group.add_argument(
#         '--fastq', default=False, action='store_true',
#         help='If specified, input will be treated as FASTQ.')
# 
#     group.add_argument(
#         '--fasta-ss', dest='fasta_ss', default=False, action='store_true',
#         help=('If specified, input will be treated as PDB FASTA '
#               '(i.e., regular FASTA with each sequence followed by its '
#               'structure).'))
# 
# def parseFASTACommandLineOptions(args):
#     """
#     Examine parsed command-line options and return a Reads instance.
# 
#     @param args: An argparse namespace, as returned by the argparse
#         C{parse_args} function.
#     @return: A C{Reads} subclass instance, depending on the type of FASTA file
#         given.
#     """
#     # Set default FASTA type.
#     if not (args.fasta or args.fastq or args.fasta_ss):
#         args.fasta = True
# 
#     readClass = readClassNameToClass[args.readClass]
# 
#     if args.fasta:
#         from dark.fasta import FastaReads
#         return FastaReads(args.fastaFile, readClass=readClass)
#     elif args.fastq:
#         from dark.fastq import FastqReads
#         return FastqReads(args.fastaFile, readClass=readClass)
#     else:
#         from dark.fasta_ss import SSFastaReads
#         return SSFastaReads(args.fastaFile, readClass=readClass)


import sys
import argparse
from os.path import join, exists
from os import mkdir, rename
from math import log10
from dark.reads import (addFASTACommandLineOptions,
                        parseFASTACommandLineOptions)
                 'either by their sequence id or numerically.'))

parser.add_argument(
    '--outDir', default='.',
    help='The directory to make the files in.')

parser.add_argument(
    '--verbose', default=False, action='store_true',
    help='If given, print sequence ids as they are processed.')

parser.add_argument(
    '--numeric', default=False, action='store_true',
    help='If given, use numeric filenames, like 1.fasta, 2.fasta, etc.')

parser.add_argument(
    '--noLeadingZeroes', default=False, action='store_true',
    help='If given, numeric filenames will not have leading zeroes.')

parser.add_argument(
    '--force', default=False, action='store_true',
    help='If given, overwrite pre-existing files.')

parser.add_argument(
    '--saveAs', choices=('fasta', 'fastq', 'fasta-ss'),
    help=('The output format. The default is to match the input format, '
          'so there is usually no need to specify this option. It can be '
          'used to force conversion from FASTQ to FASTA'))

addFASTACommandLineOptions(parser)
args = parser.parse_args()

# Path: dark/reads.py
# def addFASTACommandLineOptions(parser):
#     """
#     Add standard command-line options to an argparse parser.
# 
#     @param parser: An C{argparse.ArgumentParser} instance.
#     """
# 
#     parser.add_argument(
#         '--fastaFile', type=open, default=sys.stdin, metavar='FILENAME',
#         help=('The name of the FASTA input file. Standard input will be read '
#               'if no file name is given.'))
# 
#     parser.add_argument(
#         '--readClass', default='DNARead', choices=readClassNameToClass,
#         metavar='CLASSNAME',
#         help=('If specified, give the type of the reads in the input. '
#               'Possible choices: %s.' % ', '.join(readClassNameToClass)))
# 
#     # A mutually exclusive group for either --fasta, --fastq, or --fasta-ss
#     group = parser.add_mutually_exclusive_group()
# 
#     group.add_argument(
#         '--fasta', default=False, action='store_true',
#         help=('If specified, input will be treated as FASTA. This is the '
#               'default.'))
# 
#     group.add_argument(
#         '--fastq', default=False, action='store_true',
#         help='If specified, input will be treated as FASTQ.')
# 
#     group.add_argument(
#         '--fasta-ss', dest='fasta_ss', default=False, action='store_true',
#         help=('If specified, input will be treated as PDB FASTA '
#               '(i.e., regular FASTA with each sequence followed by its '
#               'structure).'))
# 
# def parseFASTACommandLineOptions(args):
#     """
#     Examine parsed command-line options and return a Reads instance.
# 
#     @param args: An argparse namespace, as returned by the argparse
#         C{parse_args} function.
#     @return: A C{Reads} subclass instance, depending on the type of FASTA file
#         given.
#     """
#     # Set default FASTA type.
#     if not (args.fasta or args.fastq or args.fasta_ss):
#         args.fasta = True
# 
#     readClass = readClassNameToClass[args.readClass]
# 
#     if args.fasta:
#         from dark.fasta import FastaReads
#         return FastaReads(args.fastaFile, readClass=readClass)
#     elif args.fastq:
#         from dark.fastq import FastqReads
#         return FastqReads(args.fastaFile, readClass=readClass)
#     else:
#         from dark.fasta_ss import SSFastaReads
#         return SSFastaReads(args.fastaFile, readClass=readClass)


# Path: bin/fasta-split-by-id.py
import sys
import argparse
from os.path import join, exists
from os import mkdir, rename
from math import log10
from dark.reads import (addFASTACommandLineOptions,
                        parseFASTACommandLineOptions)

                 'either by their sequence id or numerically.'))

parser.add_argument(
    '--outDir', default='.',
    help='The directory to make the files in.')

parser.add_argument(
    '--verbose', default=False, action='store_true',
    help='If given, print sequence ids as they are processed.')

parser.add_argument(
    '--numeric', default=False, action='store_true',
    help='If given, use numeric filenames, like 1.fasta, 2.fasta, etc.')

parser.add_argument(
    '--noLeadingZeroes', default=False, action='store_true',
    help='If given, numeric filenames will not have leading zeroes.')

parser.add_argument(
    '--force', default=False, action='store_true',
    help='If given, overwrite pre-existing files.')

parser.add_argument(
    '--saveAs', choices=('fasta', 'fastq', 'fasta-ss'),
    help=('The output format. The default is to match the input format, '
          'so there is usually no need to specify this option. It can be '
          'used to force conversion from FASTQ to FASTA'))

addFASTACommandLineOptions(parser)
args = parser.parse_args()

reads = parseFASTACommandLineOptions(args)