src/toil_lib/tools/preprocessing.py
def run_samtools_index(job, bam):
    """
    Runs SAMtools index to create a BAM index file

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str bam: FileStoreID of the BAM file
    :return: FileStoreID for BAM index file
    :rtype: str
    """
    work_dir = job.fileStore.getLocalTempDir()
    job.fileStore.readGlobalFile(bam, os.path.join(work_dir, 'sample.bam'))
    # Call: index the bam
    parameters = ['index', '/data/sample.bam']
    dockerCall(job=job, workDir=work_dir, parameters=parameters,
               tool='quay.io/ucsc_cgl/samtools:0.1.19--dd5ac549b95eb3e5d166a5e310417ef13651994e')
    # Write to fileStore
    return job.fileStore.writeGlobalFile(os.path.join(work_dir, 'sample.bam.bai'))
def run_samtools_index(job, bam):
    """
    Runs SAMtools index to create a BAM index file

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str bam: FileStoreID of the BAM file
    :return: FileStoreID for BAM index file
    :rtype: str
    """
    work_dir = job.fileStore.getLocalTempDir()
    job.fileStore.readGlobalFile(bam, os.path.join(work_dir, 'sample.bam'))
    # Call: index the bam
    parameters = ['index', '/data/sample.bam']
    dockerCall(job=job, workDir=work_dir, parameters=parameters,
               tool='quay.io/ucsc_cgl/samtools:0.1.19--dd5ac549b95eb3e5d166a5e310417ef13651994e')
    # Write to fileStore
    return job.fileStore.writeGlobalFile(os.path.join(work_dir, 'sample.bam.bai'))
Runs SAMtools index to create a BAM index file

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str bam: FileStoreID of the BAM file
    :return: FileStoreID for BAM index file
    :rtype: str