當前位置: 首頁>>代碼示例>>Python>>正文


Python CGATPipelines.PipelineMappingQC類代碼示例

本文整理匯總了Python中CGATPipelines.PipelineMappingQC的典型用法代碼示例。如果您正苦於以下問題:Python PipelineMappingQC類的具體用法?Python PipelineMappingQC怎麽用?Python PipelineMappingQC使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PipelineMappingQC類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: buildCoverageStats

def buildCoverageStats(infile, outfile):
    '''Generate coverage statistics for regions of interest from a
       bed file using Picard'''

    # TS check whether this is always required or specific to current baits file

    # baits file requires modification to make picard accept it
    # this is performed before CalculateHsMetrics
    to_cluster = USECLUSTER
    baits = PARAMS["roi_baits"]
    modified_baits = infile + "_temp_baits_final.bed"
    regions = PARAMS["roi_regions"]
    statement = '''samtools view -H %(infile)s > %(infile)s_temp_header.txt;
                awk 'NR>2' %(baits)s |
                awk -F '\\t' 'BEGIN { OFS="\\t" } {print $1,$2,$3,"+",$4;}'
                > %(infile)s_temp_baits.bed;
                cat  %(infile)s_temp_header.txt %(infile)s_temp_baits.bed
                > %(modified_baits)s; checkpoint ;
                rm -rf %(infile)s_temp_baits.bed %(infile)s_temp_header.txt
                '''
    P.run()

    PipelineMappingQC.buildPicardCoverageStats(
        infile, outfile, modified_baits, modified_baits)

    IOTools.zapFile(modified_baits)
開發者ID:gjaime,項目名稱:CGATPipelines,代碼行數:26,代碼來源:pipeline_exome_cancer.py

示例2: buildPicardStats

def buildPicardStats(infile, outfile):
    '''build alignment stats using picard.
    Note that picards counts reads but they are in fact alignments.
    '''
    if PARAMS["pool_reads"]:
        reffile = os.path.join(
            os.path.dirname(infile), "agg-agg-agg.filtered.contigs.fa")
    else:
        reffile = P.snip(infile, ".bam") + ".fa"
    PipelineMappingQC.buildPicardAlignmentStats(infile,
                                                outfile,
                                                reffile)
開發者ID:Charlie-George,項目名稱:cgat,代碼行數:12,代碼來源:pipeline_metagenomeassembly.py

示例3: runPicardOnRealigned

def runPicardOnRealigned(infile, outfile):
    to_cluster = USECLUSTER
    job_options = getGATKOptions()
    # TS no multithreading so why 6 threads?
    # job_threads = 6
    tmpdir_gatk = P.getTempDir('/ifs/scratch')
    # threads = PARAMS["gatk_threads"]

    outfile_tumor = outfile.replace("Control", PARAMS["mutect_tumour"])
    infile_tumor = infile.replace("Control", PARAMS["mutect_tumour"])

    track = P.snip(os.path.basename(infile), ".bam")
    track_tumor = track.replace("Control", PARAMS["mutect_tumour"])

    genome = "%s/%s.fa" % (PARAMS["bwa_index_dir"],
                           PARAMS["genome"])

    PipelineMappingQC.buildPicardAlignmentStats(infile, outfile, genome)
    PipelineMappingQC.buildPicardAlignmentStats(infile_tumor,
                                                outfile_tumor, genome)

    # check above functions then remove statement
    statement = '''
    cat %(infile)s
    | python %%(scriptsdir)s/bam2bam.py -v 0 --method=set-sequence
    | CollectMultipleMetrics
    INPUT=/dev/stdin
    REFERENCE_SEQUENCE=%%(bwa_index_dir)s/%%(genome)s.fa
    ASSUME_SORTED=true
    OUTPUT=%(outfile)s
    VALIDATION_STRINGENCY=SILENT
    >& %(outfile)s;
    cat %(infile_tumor)s
    | python %%(scriptsdir)s/bam2bam.py -v 0
    --method=set-sequence --output-sam
    | CollectMultipleMetrics
    INPUT=/dev/stdin
    REFERENCE_SEQUENCE=%%(bwa_index_dir)s/%%(genome)s.fa
    ASSUME_SORTED=true
    OUTPUT=%(outfile_tumor)s
    VALIDATION_STRINGENCY=SILENT
    >& %(outfile_tumor)s;''' % locals()
開發者ID:hainm,項目名稱:CGATPipelines,代碼行數:42,代碼來源:pipeline_exome_cancer.py

示例4: runPicardOnRealigned

def runPicardOnRealigned(infile, outfile):
    to_cluster = USECLUSTER
    job_memory = PARAMS["gatk_memory"]

    tmpdir_gatk = P.getTempDir()

    outfile_tumor = outfile.replace(
        PARAMS["sample_control"], PARAMS["sample_tumour"])
    infile_tumor = infile.replace(
        PARAMS["sample_control"], PARAMS["sample_tumour"])

    track = P.snip(os.path.basename(infile), ".bam")
    track_tumor = track.replace(
        PARAMS["sample_control"], PARAMS["sample_tumour"])

    genome = "%s/%s.fa" % (PARAMS["bwa_index_dir"],
                           PARAMS["genome"])

    PipelineMappingQC.buildPicardAlignmentStats(infile, outfile, genome)
    PipelineMappingQC.buildPicardAlignmentStats(infile_tumor,
                                                outfile_tumor, genome)
開發者ID:gjaime,項目名稱:CGATPipelines,代碼行數:21,代碼來源:pipeline_exome_cancer.py

示例5: loadPicardDuplicateStats

def loadPicardDuplicateStats( infiles, outfile ):
    '''Merge Picard duplicate stats into single table and load into SQLite.
    '''
    PipelineMappingQC.loadPicardDuplicateStats( infiles, outfile, pipeline_suffix = ".bed.gz" )
開發者ID:pombredanne,項目名稱:cgat,代碼行數:4,代碼來源:pipeline_windows.py

示例6: loadPicardStats

def loadPicardStats(infiles, outfile):
    '''merge alignment stats into single tables.'''

    PipelineMappingQC.loadPicardAlignmentStats(infiles, outfile)
開發者ID:Charlie-George,項目名稱:cgat,代碼行數:4,代碼來源:pipeline_metagenomeassembly.py

示例7: loadPicardAlignStats

def loadPicardAlignStats(infiles, outfile):
    '''Merge Picard alignment stats into single table and load into SQLite.'''
    PipelineMappingQC.loadPicardAlignmentStats(infiles, outfile)
開發者ID:Charlie-George,項目名稱:cgat,代碼行數:3,代碼來源:pipeline_exome.py

示例8: loadCoverageStats

def loadCoverageStats(infiles, outfile):
    PipelineMappingQC.loadPicardCoverageStats(infiles, outfile)
開發者ID:gjaime,項目名稱:CGATPipelines,代碼行數:2,代碼來源:pipeline_exome_cancer.py

示例9: loadBAMStats

def loadBAMStats(infiles, outfile):
    '''Import bam statistics into SQLite'''
    PipelineMappingQC.loadBAMStats(infiles, outfile)
開發者ID:lesheng,項目名稱:cgat,代碼行數:3,代碼來源:pipeline_medip.py

示例10: buildBAMStats

def buildBAMStats(infile, outfile):
    '''Count number of reads mapped, duplicates, etc. '''
    PipelineMappingQC.buildBAMStats(infile, outfile)
開發者ID:lesheng,項目名稱:cgat,代碼行數:3,代碼來源:pipeline_medip.py

示例11: buildPicardGCStats

def buildPicardGCStats(infile, outfile):
    '''Gather BAM file GC bias stats using Picard '''
    PipelineMappingQC.buildPicardGCStats(infile, outfile,
                                         os.path.join(PARAMS["bwa_index_dir"],
                                                      PARAMS["genome"] + ".fa"))
開發者ID:lesheng,項目名稱:cgat,代碼行數:5,代碼來源:pipeline_medip.py

示例12: buildPicardAlignmentStats

def buildPicardAlignmentStats(infile, outfile):
    '''Gather BAM file alignment statistics using Picard '''

    PipelineMappingQC.buildPicardAlignmentStats(infile, outfile,
                                                os.path.join(PARAMS["bwa_index_dir"],
                                                             PARAMS["genome"] + ".fa"))
開發者ID:lesheng,項目名稱:cgat,代碼行數:6,代碼來源:pipeline_medip.py


注:本文中的CGATPipelines.PipelineMappingQC類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。