bin/extract_map_reads.py
def _get_args():
    '''This function parses and return arguments passed in'''
    parser = argparse.ArgumentParser(
        prog='extract_mapped_reads',
        formatter_class=argparse.RawDescriptionHelpFormatter,
        description="Remove mapped in bam file from fastq files")
    parser.add_argument('bam_file', help="path to bam file")
    parser.add_argument('fwd', help='path to forward fastq file')
    parser.add_argument(
        '-rev',
        dest="rev",
        default=None,
        help="path to reverse fastq file")
    parser.add_argument(
        '-of',
        dest="out_fwd",
        default=None,
        help="path to forward output fastq file")
    parser.add_argument(
        '-or',
        dest="out_rev",
        default=None,
        help="path to forward output fastq file")
    parser.add_argument(
        '-m',
        dest='mode',
        default='remove',
        help='Read removal mode: remove reads (remove) or replace sequence by N (replace)'
    )
    parser.add_argument(
        '-p',
        dest='process',
        default=4,
        help='Number of parallel processes'
    )

    args = parser.parse_args()

    bam = args.bam_file
    in_fwd = args.fwd
    in_rev = args.rev
    out_fwd = args.out_fwd
    out_rev = args.out_rev
    mode = args.mode
    proc = int(args.process)

    return(bam, in_fwd, in_rev, out_fwd, out_rev, mode, proc)
This function parses and return arguments passed in
This function parses and return arguments passed in
This function parses and return arguments passed in
def _get_args():
    parser = argparse.ArgumentParser(
        prog='extract_mapped_reads',
        formatter_class=argparse.RawDescriptionHelpFormatter,
        description="Remove mapped in bam file from fastq files")
    parser.add_argument('bam_file', help="path to bam file")
    parser.add_argument('fwd', help='path to forward fastq file')
    parser.add_argument(
        '-rev',
        dest="rev",
        default=None,
        help="path to reverse fastq file")
    parser.add_argument(
        '-of',
        dest="out_fwd",
        default=None,
        help="path to forward output fastq file")
    parser.add_argument(
        '-or',
        dest="out_rev",
        default=None,
        help="path to forward output fastq file")
    parser.add_argument(
        '-m',
        dest='mode',
        default='remove',
        help='Read removal mode: remove reads (remove) or replace sequence by N (replace)'
    )
    parser.add_argument(
        '-p',
        dest='process',
        default=4,
        help='Number of parallel processes'
    )
    args = parser.parse_args()
    bam = args.bam_file
    in_fwd = args.fwd
    in_rev = args.rev
    out_fwd = args.out_fwd
    out_rev = args.out_rev
    mode = args.mode
    proc = int(args.process)
    return(bam, in_fwd, in_rev, out_fwd, out_rev, mode, proc)
def _get_args ( ) : parser = argparse . ArgumentParser ( prog = 'extract_mapped_reads' , formatter_class = argparse . RawDescriptionHelpFormatter , description = "Remove mapped in bam file from fastq files" ) parser . add_argument ( 'bam_file' , help = "path to bam file" ) parser . add_argument ( 'fwd' , help = 'path to forward fastq file' ) parser . add_argument ( '-rev' , dest = "rev" , default = None , help = "path to reverse fastq file" ) parser . add_argument ( '-of' , dest = "out_fwd" , default = None , help = "path to forward output fastq file" ) parser . add_argument ( '-or' , dest = "out_rev" , default = None , help = "path to forward output fastq file" ) parser . add_argument ( '-m' , dest = 'mode' , default = 'remove' , help = 'Read removal mode: remove reads (remove) or replace sequence by N (replace)' ) parser . add_argument ( '-p' , dest = 'process' , default = 4 , help = 'Number of parallel processes' ) args = parser . parse_args ( ) bam = args . bam_file in_fwd = args . fwd in_rev = args . rev out_fwd = args . out_fwd out_rev = args . out_rev mode = args . mode proc = int ( args . process ) return ( bam , in_fwd , in_rev , out_fwd , out_rev , mode , proc )
This function parses and return arguments passed in
This function parses and return arguments passed in
'''This function parses and return arguments passed in'''