예제 #1
0
def motif_enrichment_control(in_files, out_enrichment):
    """Determine a motif's enrichment vs. control data"""
    in_motifs, in_peaks, in_control_sample = in_files[0]
    for zscore in cfg.get('motifs', 'motif_zscores').split(','):
        args = shlex.split('''%s --motif_file=%s --bg_samples=%s --genome=%s
                              --output_file=%s --zscore=%s''' % (
                                        in_peaks, in_motifs, in_control_sample,
                                        cfg.get('DEFAULT', 'worldbase_genome'),
                                        out_enrichment, zscore))
        motif_significance.main(args)
예제 #2
0
def motif_enrichment_control(in_files, out_enrichment):
    """Determine a motif's enrichment vs. control data"""
    in_motifs, in_peaks, in_control_sample = in_files[0]
    for zscore in cfg.get('motifs', 'motif_zscores').split(','):
        args = shlex.split(
            '''%s --motif_file=%s --bg_samples=%s --genome=%s
                              --output_file=%s --zscore=%s''' %
            (in_peaks, in_motifs, in_control_sample,
             cfg.get('DEFAULT', 'worldbase_genome'), out_enrichment, zscore))
        motif_significance.main(args)
예제 #3
0
def consensus_enrichment(in_files, out_enrichment):
    """Determine a consensus motif's enrichment vs. genomic samples"""
    in_samples, in_peaks = in_files[:2]
    in_consensuses = in_files[2:]
    for in_con in in_consensuses:
        args = shlex.split('''%s --consensus_file=%s --bg_samples=%s --genome=%s
                              --output_file=%s ''' % (
                                        in_peaks, in_con, in_samples,
                                        cfg.get('DEFAULT', 'worldbase_genome'),
                                        out_enrichment))
        motif_significance.main(args)
예제 #4
0
def consensus_enrichment(in_files, out_enrichment):
    """Determine a consensus motif's enrichment vs. genomic samples"""
    in_samples, in_peaks = in_files[:2]
    in_consensuses = in_files[2:]
    for in_con in in_consensuses:
        args = shlex.split(
            '''%s --consensus_file=%s --bg_samples=%s --genome=%s
                              --output_file=%s ''' %
            (in_peaks, in_con, in_samples,
             cfg.get('DEFAULT', 'worldbase_genome'), out_enrichment))
        motif_significance.main(args)
예제 #5
0
def motif_enrichment_genomic(in_files, out_pattern, out_template):
    """Determine a motif's enrichment vs. genomic samples"""
    in_motifs = in_files[0]
    in_peaks = in_files[1][0]
    in_control_samples = filter(lambda x: x.endswith('sample'), in_files[1][1:])
    
    for peak_file in in_peaks:
        # get the similar control data
        cur_control = filter(lambda x: x == (peak_file + '.similar.genomic.sample'),
                             in_control_samples)
        for c in cur_control:
            short_control = c.split(peak_file)[1][1:]
            for zscore in cfg.get('motifs', 'motif_zscores').split(','):
                outfile = out_template % (zscore)
                args = shlex.split( '%s --motif_file=%s --bg_samples=%s '
                                   '--genome=%s --output_file=%s --zscore=%s' %
                                        (peak_file, in_motifs, c,
                                         cfg.get('DEFAULT', 'worldbase_genome'),
                                         outfile, zscore))
                print args
                motif_significance.main(args)
예제 #6
0
def motif_enrichment_genomic(in_files, out_pattern, out_template):
    """Determine a motif's enrichment vs. genomic samples"""
    in_motifs = in_files[0]
    in_peaks = in_files[1][0]
    in_control_samples = filter(lambda x: x.endswith('sample'),
                                in_files[1][1:])

    for peak_file in in_peaks:
        # get the similar control data
        cur_control = filter(
            lambda x: x == (peak_file + '.similar.genomic.sample'),
            in_control_samples)
        for c in cur_control:
            short_control = c.split(peak_file)[1][1:]
            for zscore in cfg.get('motifs', 'motif_zscores').split(','):
                outfile = out_template % (zscore)
                args = shlex.split(
                    '%s --motif_file=%s --bg_samples=%s '
                    '--genome=%s --output_file=%s --zscore=%s' %
                    (peak_file, in_motifs, c,
                     cfg.get('DEFAULT', 'worldbase_genome'), outfile, zscore))
                print args
                motif_significance.main(args)