Exemplo n.º 1
0
 def __init__(self):
     CommandLineApp.__init__(self)
     op = self.option_parser
     op.set_usage('usage: filter-sam.py')
     op.add_option('-i',
                   '--infile',
                   dest='infile',
                   type='string',
                   default=None,
                   help='Input .sam file')
     op.add_option('-o',
                   '--outfile',
                   dest='outfile',
                   type='string',
                   default=None,
                   help='Output .sam file')
     op.add_option('-a',
                   '--bwa_alg',
                   dest='bwa_alg',
                   type='string',
                   default='',
                   help='Output .sam file')
     op.add_option('-s',
                   '--use_stampy',
                   dest='use_stampy',
                   type='int',
                   default=0,
                   help='SAM file was mapped with stampy')
Exemplo n.º 2
0
    def __init__(self):
        CommandLineApp.__init__(self)
        #self.force_exit = False #enable this when profiling
        
        op = self.option_parser
        op.set_usage('usage: extract_ref_alleles -i indiv -d samdir -o outdir --parent1 parent1_genome --parent2 parent2_genome --chroms csv_list --verbosity')

        op.add_option('-i', '--individual', dest='indiv', type='string', default=None, 
                      help='Name of individual. E.g. for sam file aln_indivA6_AACGAG_sec.sam.gz, indiv would be "indivA6_AACGAG"')

        op.add_option('-d', '--samdir', dest='samdir', type='string', default='', 
                      help='Directory containing SAM files')

        op.add_option('-o', '--outdir', dest='outdir', type='string', default='', 
                      help='Output directory')

        op.add_option('--parent1', dest='parent1', type='string', default=None, 
                      help='Parent 1 genome file to align against')

        op.add_option('--parent2', dest='parent2', type='string', default=None, 
                      help='Parent 2 genome file to align against')

        op.add_option('--chroms', dest='chroms', type='string', default=None, 
                      help='chromosomes desired')

        op.add_option('--verbosity', action="store_true", dest='verbosity', default=False,
                      help="make lots of noise")
Exemplo n.º 3
0
    def __init__(self):
        CommandLineApp.__init__(self)
        
        op = self.option_parser
        op.set_usage('usage: parse_and_map -[npm] -i reads.fq -b barcodes --parent1 parent1_genome --parent2 parent2_genome')

        op.add_option('-i', '--raw-data', dest='raw_data_file', type='string', default=None, 
                      help='Raw Illumina data file')

        op.add_option('-b', '--barcodes', dest='barcodes_file', type='string', default=None, 
                      help='Barcodes file')

        op.add_option('--re_cutter', dest='re_cutter', type='string', default=None, 
                      help='restriction enzyme')

        op.add_option('--linker_system', dest='linker_system', type='string', default=None, 
                      help='linker system')

        op.add_option('--parent1', dest='parent1', type='string', default=None, 
                      help='Parent 1 genome file to align against')

        op.add_option('--parent2', dest='parent2', type='string', default=None, 
                      help='Parent 2 genome file to align against')

        op.add_option('-m', '--map-only', dest='map_only', default=False, action='store_true', 
                      help='Just map data?')

        op.add_option('-n', '--num-ind', dest='num_ind', default=None, type='int',
                      help='Number of individuals to map')

        op.add_option('-p', '--parse-only', dest='parse_only', default=False, action='store_true',
                      help='Just parse data?')
Exemplo n.º 4
0
    def __init__(self):
        CommandLineApp.__init__(self)
        
        op = self.option_parser
        op.set_usage('usage: parse_and_map -[npm] -i reads.fq -b barcodes --parent1 parent1_genome --parent2 parent2_genome')

        op.add_option('-i', '--raw-data', dest='raw_data_file', type='string', default=None, 
                      help='Raw Illumina data file')

        op.add_option('-b', '--barcodes', dest='barcodes_file', type='string', default=None, 
                      help='Barcodes file')

        op.add_option('--re_cutter', dest='re_cutter', type='string', default=None, 
                      help='restriction enzyme')

        op.add_option('--linker_system', dest='linker_system', type='string', default=None, 
                      help='linker system')

        op.add_option('--parent1', dest='parent1', type='string', default=None, 
                      help='Parent 1 genome file to align against')

        op.add_option('--parent2', dest='parent2', type='string', default=None, 
                      help='Parent 2 genome file to align against')

        op.add_option('-m', '--map-only', dest='map_only', default=False, action='store_true', 
                      help='Just map data?')

        op.add_option('-n', '--num-ind', dest='num_ind', default=None, type='int',
                      help='Number of individuals to map')

        op.add_option('-p', '--parse-only', dest='parse_only', default=False, action='store_true',
                      help='Just parse data?')
Exemplo n.º 5
0
 def __init__(self):
     CommandLineApp.__init__(self)
     op = self.option_parser
     op.set_usage('usage: filter-sam.py')
     op.add_option('-i', '--infile', dest='infile', type='string', default=None, 
                   help='Input .sam file')
     op.add_option('-o', '--outfile', dest='outfile', type='string', default=None, 
                   help='Output .sam file')
Exemplo n.º 6
0
    def __init__(self):
        CommandLineApp.__init__(self)

        op = self.option_parser
        op.set_usage(
            'usage: extract_ref_alleles -i indiv -d samdir -o outdir --parent1 parent1_genome --parent2 parent2_genome --chroms csv_list --verbosity'
        )

        op.add_option(
            '-i',
            '--individual',
            dest='indiv',
            type='string',
            default=None,
            help=
            'Name of individual. E.g. for sam file aln_indivA6_AACGAG_sec.sam.gz, indiv would be "indivA6_AACGAG"'
        )

        op.add_option('-d',
                      '--samdir',
                      dest='samdir',
                      type='string',
                      default='',
                      help='Directory containing SAM files')

        op.add_option('-o',
                      '--outdir',
                      dest='outdir',
                      type='string',
                      default='',
                      help='Output directory')

        op.add_option('--parent1',
                      dest='parent1',
                      type='string',
                      default=None,
                      help='Parent 1 genome file to align against')

        op.add_option('--parent2',
                      dest='parent2',
                      type='string',
                      default=None,
                      help='Parent 2 genome file to align against')

        op.add_option('--chroms',
                      dest='chroms',
                      type='string',
                      default=None,
                      help='chromosomes desired')

        op.add_option('--verbosity',
                      action="store_true",
                      dest='verbosity',
                      default=False,
                      help="make lots of noise [default]")
Exemplo n.º 7
0
    def __init__(self):
        CommandLineApp.__init__(self)

        op = self.option_parser
        op.set_usage('usage: stitchContigs.py')
        op.add_option('-c',
                      '--chrom',
                      dest='chrom',
                      type='string',
                      default='X',
                      help='chromosome')
Exemplo n.º 8
0
    def __init__(self):
        CommandLineApp.__init__(self)
        
        op = self.option_parser
        op.set_usage('usage: create_stats -i reads.fq -b barcodes')

        op.add_option('-i', '--raw-data', dest='raw_data_file', type='string', default=None, 
                      help='Raw Illumina data file')

        op.add_option('-b', '--barcodes', dest='barcodes_file', type='string', default=None, 
                      help='Barcodes file')
Exemplo n.º 9
0
 def __init__(self):
     CommandLineApp.__init__(self)
     op = self.option_parser
     op.set_usage('usage: filter-sam.py')
     op.add_option('-i', '--infile', dest='infile', type='string', default=None, 
                   help='Input .sam file')
     op.add_option('-o', '--outfile', dest='outfile', type='string', default=None, 
                   help='Output .sam file')
     op.add_option('-a', '--bwa_alg', dest='bwa_alg', type='string', default='', 
                   help='Output .sam file')
     op.add_option('-s', '--use_stampy', dest='use_stampy', type='int', default=0, 
                   help='SAM file was mapped with stampy')
Exemplo n.º 10
0
    def __init__(self):
        CommandLineApp.__init__(self)
        argv = sys.argv
        op = self.option_parser
        usage = 'usage: %s tree1 tree2' % os.path.basename(argv[0])
        op.set_usage(usage)

        op.add_option('-n', '--dry-run', dest='dry_run', default=False, action='store_true',
                      help="Just print shell commands; don't actually do anything")

        op.add_option('-d', '--delete', dest='delete', default=False, action='store_true',
                      help="Delete files from receiver that do not exist in sender")

        op.add_option('--delete-only', dest='delete_only', default=False, action='store_true',
                      help="Delete files from receiver that do not exist in sender, and do not copy files.")
Exemplo n.º 11
0
 def __init__(self):
     CommandLineApp.__init__(self)
     op = self.option_parser
     op.set_usage('usage: filter-sam.py')
     op.add_option('-i',
                   '--infile',
                   dest='infile',
                   type='string',
                   default=None,
                   help='Input .sam file')
     op.add_option('-o',
                   '--outfile',
                   dest='outfile',
                   type='string',
                   default=None,
                   help='Output .sam file')
Exemplo n.º 12
0
    def __init__(self):
        CommandLineApp.__init__(self)
        
        op = self.option_parser
        usage = []
        usage.append("%s --snptest --controls 58C --cases NBS --chrom '21 22' --local"
                     % __progname__)
        usage.append('%s --cohorts "58C NBS POBI" --snpfile ~/wtccc2/celine-snps-ill'% __progname__)
        op.set_usage('\n' + '\n'.join(usage))

        op.add_option('--pca', dest='pca', default=False, action='store_true',
                      help='Perform PCA of selected cohorts')
        op.add_option('', '--make-gen', dest='make_gen', default=False, action='store_true',
                      help="Convert to .gen input data format used by chiamo and related software")
        op.add_option('--snptest', dest='snptest', default=False, action='store_true',
                      help='Perform association tests of selected cases & controls')
        op.add_option('--sstat', dest='sstat', default=False, action='store_true',
                      help='Compute summary statistics for selected cohorts')
        op.add_option('--cohorts', dest='cohorts', type='string', default='',
                      help='Space-separated list of cohorts')
        op.add_option('--cases', dest='cases', type='string', default='',
                      help='Space-separated list of case cohorts')
        op.add_option('--controls', dest='controls', type='string', default='',
                      help='Space-separated list of control cohorts') 
        op.add_option('--outfile', dest='outfile', type='string', default=None,
                      help='Name of output file')
        op.add_option('--local', dest='local', default=False, action='store_true',
                      help='Run PCA / snptest locally, not on the cluster')
        op.add_option('--chrom', dest='chroms', type='string', default=None,
                      help='Chromosomes to include (space-separated; default is 1-22)')
        op.add_option('--snpfile', dest='snpfile', type='string', default=None,
                      help='File containing SNPs to use (.map format)')
        op.add_option('--samplefile', dest='samplefile', type='string', default=None,
                      help='sample file to use (chiamo .sample format; defaults to WTCCC2 cohort sample file)')
        op.add_option('--snptest-opts', dest='snptest_opts', type='string', default='',
                      help='Options to pass to snptest')
        op.add_option('--factorfile', dest='factor_file', type='string', default=None,
                      help='File containing integer factor classifying individuals (minimum factor level is 1)')
        op.add_option('--exclude', dest='excludefile', type='string', default=None,
                      help='File containing IDs of individuals to exclude' + \
                          'in addition to project exclusions (one ID per line)')
        op.add_option('-n', dest='dry_run', default=False, action='store_true',
                      help="Don't actually do anything, just print commands")
        op.add_option('', '--messy', dest='messy', default=False, action='store_true',
                      help="Do not remove intermediate files")
        op.add_option('--platform', dest='platform', type='string', default=None)
Exemplo n.º 13
0
        def __init__(self):
            CommandLineApp.__init__(self)
            op = self.option_parser
            usage = 'usage: %s file [file ...]' % os.path.basename(sys.argv[0])
            op.set_usage(usage)
    
            op.add_option('-f', '--field', dest='field', default=None, type='int',
                          help='Column index of field on which comparison of lines is to be based')
    
            op.add_option('-d', '--delimiter', dest='delim', default=None, type='string',
                          help='Field delimiter (default is <TAB>)')
    
            op.add_option('-i', '--inplace', dest='inplace', default=False, action='store_true',
                          help='Overwrite input files')
    
            op.add_option('-o', '--out', dest='outdir', default='.', type='string',
                          help='Directory into which output files will be saved.' +\
                              'Defaults to current directory.' +\
                              'The output files are given the name of the corresponding ' + \
                              'input file, with the suffix .insect')

            op.add_option('-u', '--unique', dest='unique', default=False, action='store_true',
                          help='Restrict keys to unique values before insecting. ' + \
                              'Duplicate keys result in an error unless this option is in force.')
Exemplo n.º 14
0
    def __init__(self):
        CommandLineApp.__init__(self)
        #self.force_exit = False #enable this when profiling
        
        op = self.option_parser
        op.set_usage('usage: extract_ref_alleles -i indiv -d samdir -o outdir --parent1 parent1_genome --parent2 parent2_genome --chroms csv_list --repeat_threshold AS-XS --verbosity')

        op.add_option('-i', '--individual', dest='indiv', type='string', default=None, 
                      help='Name of individual. E.g. for sam file aln_indivA6_AACGAG_sec.sam.gz, indiv would be "indivA6_AACGAG"')

        op.add_option('-d', '--samdir', dest='samdir', type='string', default='', 
                      help='Directory containing SAM files')

        op.add_option('-o', '--outdir', dest='outdir', type='string', default='', 
                      help='Output directory')

        op.add_option('--parent1', dest='parent1', type='string', default=None, 
                      help='Parent 1 genome file to align against')

        op.add_option('--parent2', dest='parent2', type='string', default=None, 
                      help='Parent 2 genome file to align against')

        op.add_option('--chroms', dest='chroms', type='string', default=None, 
                      help='chromosomes desired')

        op.add_option('--verbosity', action="store_true", dest='verbosity', default=False,
                      help="make lots of noise")

        op.add_option('--bwa_alg', dest='bwa_alg', type='string', default='', 
                      help='BWA algorithm used to generate SAM files. It should be "aln" or "bwasw".')

        op.add_option('--use_stampy', dest='use_stampy', type='int', default=0, 
            help='Was STAMPY used to generate SAM files? Set this to 1.')
            
        op.add_option('--repeat_threshold', dest='AS_XS_threshold', type='int', default=6,
            help='Minimum difference between top alignment and suboptimal alignment scores to keep')
Exemplo n.º 15
0
    def __init__(self):
        CommandLineApp.__init__(self)

        op = self.option_parser
        usage = 'usage: [options] %s -i %s -o %s' % (
            __progname__,
            os.path.sep.join(['location','of','music', 'library']),
            os.path.sep.join(['folder','to','receive','output']))
        op.set_usage(usage)

        op.add_option('-i', '--library', dest='libdir', type='string', default=None,
                      help='Location of root of music library')

        op.add_option('-o', '--outdir', dest='outdir', type='string', default='.',
                      help='Folder to receive output, defaults to current folder.')

        # op.add_option('-u', '--update', dest='update', default=False, action='store_true',
        #               help='Don\'t re-scan whole library; instead update saved dbm data base.')

        op.add_option('-f', '--libfile', dest='savefile', type='string', default='library.dbm',
                      help="Saved library file, defaults to 'library.dbm'")

        op.add_option('-r', '--rockbox', dest='path_to_rockbox', type='string', default=None,
                      help='Location of rockbox digital audio player.')

        op.add_option('', '--mintracks', dest='minArtistTracks', default=0, type='int',
                      help='Playlists and linkfiles will only be generated for artists with' + \
                          ' more than this number of tracks in the library.')

        op.add_option('', '--numtries', dest='numtries', default=3, type='int',
                      help='Number of times to attempt web query for an artist before giving up.')

        op.add_option('', '--noweb', dest='query_lastfm', default=True, action='store_false',
                      help="Don't query last.fm similar artists.")

        op.add_option('-n', '', dest='create_files', default=True, action='store_false',
                      help='Don\'t create any playlists or link files')

        op.add_option('', '--version', dest='show_version', default=False, action='store_true',
                      help='Print out version information and exit')

        op.add_option('', '--show-library', dest='show_tree', default=False, action='store_true',
                      help='Print sparse representation of library, and exit')

        op.add_option('', '--show-tracks', dest='show_tracks', default=False, action='store_true',
                      help='Include track information when using --show')

        op.add_option('', '--show-artists', dest='show_artists', default=False, action='store_true',
                      help='Print information on artists in library, and exit')

        op.add_option('-s', '--musicspace', dest='music_space_file', type='string', default=None,
                      help='Music space file')

        op.add_option('', '--show-musicspace', dest='show_musicspace', default=False, action='store_true',
                      help="Print summary of neighbouring artists in musicspace, and exit")

        op.add_option('', '--dropoff', dest='musicspace_dropoff_param', type='float', default=3.0,
                      help="Parameter controlling rate at which probability of inclusion falls away with distance in music space. When generating playlists for artist X, a value of 0 means that all other artists will be included with equal probability; a value of more than 5 or so means that you'll rarely get anybody but X. Default is 3.0")
        op.add_option('', '--create-musicspace-skeleton', dest='write_music_space', default=False,
                      action='store_true',
                      help='create skeleton music space spreadsheet file and exit')

        op.add_option('-t', '--target', dest='target', default='rockbox', type='string',
                      help="Specify target platform: defaults to rockbox; " +\
                          "in the future you will be able to use --target=native " +\
                          "to create playlists and links for use on the local machine.")
Exemplo n.º 16
0
	def __init__(self):
		CommandLineApp.__init__(self)

		op = self.option_parser
		op.set_usage('usage: stitchContigs.py')
		op.add_option('-c', '--chrom', dest='chrom', type='string', default='X', help='chromosome')
Exemplo n.º 17
0
    def __init__(self):
        CommandLineApp.__init__(self)

        op = self.option_parser
        usage = 'usage: [options] %s -i %s -o %s' % (
            __progname__,
            os.path.sep.join(['location', 'of', 'music', 'library']),
            os.path.sep.join(['folder', 'to', 'receive', 'output']))
        op.set_usage(usage)

        op.add_option('-i',
                      '--library',
                      dest='libdir',
                      type='string',
                      default=None,
                      help='Location of root of music library')

        op.add_option(
            '-o',
            '--outdir',
            dest='outdir',
            type='string',
            default='.',
            help='Folder to receive output, defaults to current folder.')

        # op.add_option('-u', '--update', dest='update', default=False, action='store_true',
        #               help='Don\'t re-scan whole library; instead update saved dbm data base.')

        op.add_option('-f',
                      '--libfile',
                      dest='savefile',
                      type='string',
                      default='library.dbm',
                      help="Saved library file, defaults to 'library.dbm'")

        op.add_option('-r',
                      '--rockbox',
                      dest='path_to_rockbox',
                      type='string',
                      default=None,
                      help='Location of rockbox digital audio player.')

        op.add_option('', '--mintracks', dest='minArtistTracks', default=0, type='int',
                      help='Playlists and linkfiles will only be generated for artists with' + \
                          ' more than this number of tracks in the library.')

        op.add_option(
            '',
            '--numtries',
            dest='numtries',
            default=3,
            type='int',
            help=
            'Number of times to attempt web query for an artist before giving up.'
        )

        op.add_option('',
                      '--noweb',
                      dest='query_lastfm',
                      default=True,
                      action='store_false',
                      help="Don't query last.fm similar artists.")

        op.add_option('-n',
                      '',
                      dest='create_files',
                      default=True,
                      action='store_false',
                      help='Don\'t create any playlists or link files')

        op.add_option('',
                      '--version',
                      dest='show_version',
                      default=False,
                      action='store_true',
                      help='Print out version information and exit')

        op.add_option('',
                      '--show-library',
                      dest='show_tree',
                      default=False,
                      action='store_true',
                      help='Print sparse representation of library, and exit')

        op.add_option('',
                      '--show-tracks',
                      dest='show_tracks',
                      default=False,
                      action='store_true',
                      help='Include track information when using --show')

        op.add_option('',
                      '--show-artists',
                      dest='show_artists',
                      default=False,
                      action='store_true',
                      help='Print information on artists in library, and exit')

        op.add_option('-s',
                      '--musicspace',
                      dest='music_space_file',
                      type='string',
                      default=None,
                      help='Music space file')

        op.add_option(
            '',
            '--show-musicspace',
            dest='show_musicspace',
            default=False,
            action='store_true',
            help="Print summary of neighbouring artists in musicspace, and exit"
        )

        op.add_option(
            '',
            '--dropoff',
            dest='musicspace_dropoff_param',
            type='float',
            default=3.0,
            help=
            "Parameter controlling rate at which probability of inclusion falls away with distance in music space. When generating playlists for artist X, a value of 0 means that all other artists will be included with equal probability; a value of more than 5 or so means that you'll rarely get anybody but X. Default is 3.0"
        )
        op.add_option(
            '',
            '--create-musicspace-skeleton',
            dest='write_music_space',
            default=False,
            action='store_true',
            help='create skeleton music space spreadsheet file and exit')

        op.add_option('-t', '--target', dest='target', default='rockbox', type='string',
                      help="Specify target platform: defaults to rockbox; " +\
                          "in the future you will be able to use --target=native " +\
                          "to create playlists and links for use on the local machine.")
Exemplo n.º 18
0
    def __init__(self):
        CommandLineApp.__init__(self)
        
        op = self.option_parser
        op.set_usage('usage: parse_and_map -[npm] -i reads.fq -b barcodes --parent1 parent1_genome --parent2 parent2_genome')

        op.add_option('-i', '--raw-data', dest='raw_data_file', type='string', default=None, 
                      help='Raw Illumina data file')

        op.add_option('-b', '--barcodes', dest='barcodes_file', type='string', default=None, 
                      help='Barcodes file')

        op.add_option('--re_cutter', dest='re_cutter', type='string', default=None, 
                      help='restriction enzyme')

        op.add_option('--linker_system', dest='linker_system', type='string', default=None, 
                      help='linker system')

        op.add_option('--parent1', dest='parent1', type='string', default=None, 
                      help='Parent 1 genome file to align against')

        op.add_option('--parent2', dest='parent2', type='string', default=None, 
                      help='Parent 2 genome file to align against')

        op.add_option('-m', '--map-only', dest='map_only', default=False, action='store_true', 
                      help='Just map data?')

        op.add_option('-n', '--num-ind', dest='num_ind', default=None, type='int',
                      help='Number of individuals to map')

        op.add_option('-p', '--parse-only', dest='parse_only', default=False, action='store_true',
                      help='Just parse data?')

        op.add_option('--bwa_alg', dest='bwa_alg', type='string', default="aln", 
                      help='Algorithm for BWA mapping. Use aln or bwasw. This is ignored is use_stampy is 1.')

        op.add_option('--bwa_threads', dest='bwa_threads', type='int', default=1, 
                      help='Number of threads in the BWA multi-threading mode')

        op.add_option('--use_stampy', dest='use_stampy', type='int', default=0, 
                      help='Use stampy for mapping')

        op.add_option('--stampy_premap_w_bwa', dest='stampy_premap_w_bwa', type='int', default=1, 
                      help='Use BWA before running stampy for a speed boost.')

        op.add_option('--stampy_pseudo_threads', dest='stampy_pseudo_threads', type='int', default=0, 
                      help='Use qsub commands to split up stampy processes during mapping. NOT currently used.')
        
        op.add_option('--dbg', dest='debug', default=False, action='store_true', 
                      help='More verbose output and leaves temporary files instead of cleaning up')

        op.add_option('--quality_trim_reads_thresh', dest='quality_trim_reads_thresh', default=None, type='int',
                      help='Illumina parsing only - what level should split files be quality trimmed at')
                      
        op.add_option('--quality_trim_reads_consec', dest='quality_trim_reads_consec', default=None, type='int',
                      help='Illumina parsing only - Minimum number of consecutive bases passing threshold values')

        #Set divergence for mapping to a foreign reference (note: this is
        #strongly recommended for divergences >3%, as it will automatically
        #shut down BWA pre-mapping which otherwise cause occasional segfaults)
        #(stampy default if .001)
        op.add_option('--indiv_stampy_substitution_rate', dest='stampy_substitution_rate', type='float', default=0.001, 
                      help='Set divergence for mapping to a foreign reference')
                      
        op.add_option('--indiv_mapq_filter', dest='mapq_filter', type='int', default=0, 
                      help='Filter out poor alignments.  Set this to 0 to skip.')

        op.add_option('--new_parser', dest='new_parser', type='int', default=0, 
                      help='Use a faster, experimental parser')

        op.add_option('--new_parser_offset', dest='new_parser_offset', type='int', default=0, 
                      help='When using new parser, how many base pairs after barcode to omit')

        op.add_option('--new_parser_filter_out_seq', dest='new_parser_filter_out_seq', type='string',
            default=None, help='A sequence to remove from parsed reads')
                
        #Illumina indexing only
        op.add_option('--index_file', dest='index_file', type='string', default=None, 
                      help='When using Illumina indexes, this is the fastq/fasta file with the indexes.')
        op.add_option('--index_barcodes', dest='index_barcodes', type='string', default=None, 
                      help='When using Illumina indexes, this the the file with a listing of index sequences and labels')
Exemplo n.º 19
0
    def __init__(self):
        CommandLineApp.__init__(self)

        op = self.option_parser
        op.set_usage(
            'usage: parse_and_map -[npm] -i reads.fq -b barcodes --parent1 parent1_genome --parent2 parent2_genome'
        )

        op.add_option('-i',
                      '--raw-data',
                      dest='raw_data_file',
                      type='string',
                      default=None,
                      help='Raw Illumina data file')

        op.add_option('-b',
                      '--barcodes',
                      dest='barcodes_file',
                      type='string',
                      default=None,
                      help='Barcodes file')

        op.add_option('--re_cutter',
                      dest='re_cutter',
                      type='string',
                      default=None,
                      help='restriction enzyme')

        op.add_option('--linker_system',
                      dest='linker_system',
                      type='string',
                      default=None,
                      help='linker system')

        op.add_option('--parent1',
                      dest='parent1',
                      type='string',
                      default=None,
                      help='Parent 1 genome file to align against')

        op.add_option('--parent2',
                      dest='parent2',
                      type='string',
                      default=None,
                      help='Parent 2 genome file to align against')

        op.add_option('-m',
                      '--map-only',
                      dest='map_only',
                      default=False,
                      action='store_true',
                      help='Just map data?')

        op.add_option('-n',
                      '--num-ind',
                      dest='num_ind',
                      default=None,
                      type='int',
                      help='Number of individuals to map')

        op.add_option('-p',
                      '--parse-only',
                      dest='parse_only',
                      default=False,
                      action='store_true',
                      help='Just parse data?')

        op.add_option(
            '--bwa_alg',
            dest='bwa_alg',
            type='string',
            default='aln',
            help=
            'Algorithm for BWA mapping. Use aln or bwasw. This is ignored is use_stampy is 1.'
        )

        op.add_option('--bwa_threads',
                      dest='bwa_threads',
                      type='int',
                      default=1,
                      help='Number of threads in the BWA multi-threading mode')

        op.add_option('--use_stampy',
                      dest='use_stampy',
                      type='int',
                      default=0,
                      help='Use stampy for mapping')

        op.add_option('--stampy_premap_w_bwa',
                      dest='stampy_premap_w_bwa',
                      type='int',
                      default=1,
                      help='Use BWA before running stampy for a speed boost.')

        op.add_option(
            '--stampy_pseudo_threads',
            dest='stampy_pseudo_threads',
            type='int',
            default=0,
            help=
            'Use qsub commands to split up stampy processes during mapping. NOT currently used.'
        )

        op.add_option(
            '--dbg',
            dest='debug',
            default=False,
            action='store_true',
            help=
            'More verbose output and leaves temporary files instead of cleaning up'
        )

        op.add_option(
            '--quality_trim_reads_thresh',
            dest='quality_trim_reads_thresh',
            default=None,
            type='int',
            help=
            'Illumina parsing only - what level should split files be quality trimmed at'
        )

        op.add_option(
            '--quality_trim_reads_consec',
            dest='quality_trim_reads_consec',
            default=None,
            type='int',
            help=
            'Illumina parsing only - Minimum number of consecutive bases passing threshold values'
        )

        op.add_option(
            '-S',
            '--samtools_path',
            dest='samtools_path',
            default='samtools',
            type='string',
            help=
            'Path to samtools 0.1.9 including the name of the binary at the end of the string'
        )

        #Set divergence for mapping to a foreign reference (note: this is
        #strongly recommended for divergences >3%, as it will automatically
        #shut down BWA pre-mapping which otherwise cause occasional segfaults)
        #(stampy default if .001)
        op.add_option('--indiv_stampy_substitution_rate',
                      dest='stampy_substitution_rate',
                      type='float',
                      default=0.001,
                      help='Set divergence for mapping to a foreign reference')

        op.add_option(
            '--indiv_mapq_filter',
            dest='mapq_filter',
            type='int',
            default=0,
            help='Filter out poor alignments.  Set this to 0 to skip.')

        op.add_option('--new_parser',
                      dest='new_parser',
                      type='int',
                      default=0,
                      help='Use a faster, experimental parser')

        op.add_option(
            '--new_parser_offset',
            dest='new_parser_offset',
            type='int',
            default=0,
            help=
            'When using new parser, how many base pairs after barcode to omit')

        op.add_option('--new_parser_filter_out_seq',
                      dest='new_parser_filter_out_seq',
                      type='string',
                      default=None,
                      help='A sequence to remove from parsed reads')

        #Illumina indexing only
        op.add_option(
            '--index_file',
            dest='index_file',
            type='string',
            default=None,
            help=
            'When using Illumina indexes, this is the fastq/fasta file with the indexes.'
        )
        op.add_option(
            '--index_barcodes',
            dest='index_barcodes',
            type='string',
            default=None,
            help=
            'When using Illumina indexes, this the the file with a listing of index sequences and labels'
        )