Exemplo n.º 1
0
def main():
    parser = argparse.ArgumentParser("lookup bait and target intervals")

    # Logging flags.
    parser.add_argument(
        "-d", "--debug", action="store_const", const=logging.DEBUG, dest="level", help="Enable debug logging."
    )
    parser.set_defaults(level=logging.INFO)

    parser.add_argument("--uuid", required=True, help="uuid string")
    parser.add_argument("--bam_path", required=True)
    parser.add_argument("--bam_library_key_json_path", required=False)
    parser.add_argument("--key_interval_json_path", required=False)

    # setup required parameters
    args = parser.parse_args()
    bam_path = args.bam_path
    uuid = args.uuid
    bam_library_key_json_path = args.bam_library_key_json_path
    key_interval_json_path = args.key_interval_json_path

    tool_name = "sra_hs_lookup"
    logger = pipe_util.setup_logging(tool_name, args, uuid)
    engine = pipe_util.setup_db(uuid)

    sra_hs_lookup.sra_hs_lookup(bam_path, bam_library_key_json_path, key_interval_json_path, engine, logger)

    return
Exemplo n.º 2
0
def test_setup_db_with_postgres():
    """Setting up database connection works with postgres.
    """
    engine = pipe_util.setup_db(uuid.uuid4(),
        username='******',
        host='localhost',
        port=5432,
        db='prod_bioinfo',
    )

    # TODO perform additional inspection of database setup
    assert engine, 'database engine not returned'
Exemplo n.º 3
0
def main():
    parser = argparse.ArgumentParser('CRAMtools bam-style-index')

    # Logging flags.
    parser.add_argument('-d', '--debug',
        action = 'store_const',
        const = logging.DEBUG,
        dest = 'level',
        help = 'Enable debug logging.',
    )
    parser.set_defaults(level = logging.INFO)

    # Required flags.

    parser.add_argument('-r', '--reference_fasta_path',
                        required = False,
                        help = 'Reference fasta path.',
    )
    parser.add_argument('-b', '--cram_path',
                        required = False,
                        action="append",
                        help = 'Source cram path.',
    )
    parser.add_argument('-u', '--uuid',
                        required = True,
                        help = 'analysis_id string',
    )
    parser.add_argument('--tool_name',
                        required = True,
                        help = 'cramtools'
    )

    args = parser.parse_args()
    tool_name = args.tool_name
    uuid = args.uuid


    logger = pipe_util.setup_logging(tool_name, args, uuid)
    engine = pipe_util.setup_db(uuid)

    hostname = os.uname()[1]
    logger.info('hostname=%s' % hostname)


    if tool_name == 'index':
        cram_path = pipe_util.get_param(args, 'cram_path')
        reference_fasta_path = pipe_util.get_param(args, 'reference_fasta_path')      
        index(uuid, cram_path, reference_fasta_path, engine, logger)
    else:
        sys.exit('No recognized tool was selected')
Exemplo n.º 4
0
def main():
    parser = argparse.ArgumentParser('bamutil docker tool')

    # Logging flags.
    parser.add_argument('-d', '--debug',
        action = 'store_const',
        const = logging.DEBUG,
        dest = 'level',
        help = 'Enable debug logging.',
    )
    parser.set_defaults(level = logging.INFO)
    
    # Required flags.
    parser.add_argument('--tool_name',
                        required = True,
                        help = 'bamutil tool'
    )
    parser.add_argument('--uuid',
                        required = True,
                        help = 'uuid string',
    )
    
    # Tool flags
    parser.add_argument('--bam_path',
                        required = False
    )

    # setup required parameters
    args = parser.parse_args()
    tool_name = args.tool_name
    uuid = args.uuid

    logger = pipe_util.setup_logging(tool_name, args, uuid)
    engine = pipe_util.setup_db(uuid)

    be_lenient = True
    
    if tool_name == 'splitbam':
        bam_path = pipe_util.get_param(args, 'bam_path')
        splitbam(uuid, bam_path, engine, logger)
    else:
        sys.exit('No recognized tool was selected')
        
    return
Exemplo n.º 5
0
def main():
    parser = argparse.ArgumentParser('GATK MuTect2 Panel Of Normal creation')

    # Logging flags.
    parser.add_argument('-d', '--debug',
        action = 'store_const',
        const = logging.DEBUG,
        dest = 'level',
        help = 'Enable debug logging.',
    )
    parser.set_defaults(level = logging.INFO)

    # Required flags.

    parser.add_argument('-r', '--reference_fasta_path',
                        required = False,
                        help = 'Reference fasta path.',
    )
    parser.add_argument('-rf', '--reference_fasta_fai',
                        required = False,
                        help = 'Reference fasta fai path.',
    )
    parser.add_argument('-snp', '--known_snp_vcf_path',
                        required = False,
                        help='Reference SNP path.',
    )
    parser.add_argument('-cos', '--cosmic_path',
                        required = False,
                        help='Reference COSMIC path.',
    )
    parser.add_argument('-b', '--cram_path',
                        required = False,
                        action="append",
                        help = 'Source cram path.',
    )
    parser.add_argument('-v', '--vcf_path',
                        required = False,
                        action="append",
                        help = 'Individual VCF path',
    )
    parser.add_argument('-j', '--thread_count',
                        required = False,
                        type = is_nat,
                        help = 'Maximum number of threads for execution.',
    )
    parser.add_argument('-bs', '--Parallel_Block_Size',
                        type = is_nat,
                        default = 50000000,
                        required = False,
                        help = 'Parallel Block Size',
    )
    parser.add_argument('-u', '--uuid',
                        required = True,
                        help = 'analysis_id string',
    )
    parser.add_argument('--tool_name',
                        required = True,
                        help = 'gatk tool'
    )

    args = parser.parse_args()
    tool_name = args.tool_name
    uuid = args.uuid
    thread_count = str(args.thread_count)
    Parallel_Block_Size = str(args.Parallel_Block_Size)

    logger = pipe_util.setup_logging('gatk_' + tool_name, args, uuid)
    engine = pipe_util.setup_db(uuid)

    hostname = os.uname()[1]
    logger.info('hostname=%s' % hostname)


    if tool_name == 'mutect2_pon_tool':
        cram_path = pipe_util.get_param(args, 'cram_path')[0]
        known_snp_vcf_path = pipe_util.get_param(args, 'known_snp_vcf_path')
        cosmic_path = pipe_util.get_param(args, 'cosmic_path')
        reference_fasta_path = pipe_util.get_param(args, 'reference_fasta_path')
        thread_count = pipe_util.get_param(args, 'thread_count')
        fai_path = pipe_util.get_param(args, 'reference_fasta_fai')
        blocksize = pipe_util.get_param(args, 'Parallel_Block_Size')
        mutect2_pon_tool.pon(uuid, cram_path, thread_count, reference_fasta_path, cosmic_path, fai_path, blocksize, known_snp_vcf_path, engine, logger)
    elif tool_name == 'CombineVariants':
        vcf_path_list = pipe_util.get_param(args, 'vcf_path')
        reference_fasta_path = pipe_util.get_param(args, 'reference_fasta_path')
        thread_count = pipe_util.get_param(args, 'thread_count')
        CombineVariants.combinevcf(uuid, vcf_path_list, reference_fasta_path, engine, logger)
    else:
        sys.exit('No recognized tool was selected')