Exemplo n.º 1
0
    long_label=hub_config['hub']['long_label'],
    email=hub_config['hub']['email'],
    genome=hub_config['hub']['genome'])

c = ChIPSeqConfig(
    config, os.path.join(os.path.dirname(args.config),
                         'chipseq_patterns.yaml'))

# Set up subgroups based on unique values from columns specified in the config
df = pandas.read_csv(config['sampletable'], comment='#', sep='\t')
cols = hub_config['subgroups']['columns']
subgroups = []
for col in cols:
    unique = list(df[col].unique())
    mapping = {
        sanitize(i, strict=True): sanitize(i, strict=False)
        for i in unique
    }

    mapping['NA'] = 'NA'

    s = SubGroupDefinition(
        name=sanitize(col, strict=True),
        label=col,
        mapping=mapping,
    )
    subgroups.append(s)

# Add subgroups for algorithm and peaks-or-not for easier subsetting and
# sorting.
subgroups.append(
Exemplo n.º 2
0
# SubGroupDefinitions later.
sample_subgroup_values = defaultdict(set)
bait_subgroup_values = defaultdict(set)

aggregates = {}

for comparison, vals, in config['4c']['comparisons'].items():
    for kind in ['cis', 'nearbait']:

        bait = vals['bait']
        k = config['4c']['baits'][bait][kind + '_k']

        for treatment in ['control', 'treatment', 'all']:

            bait_subgroups = dict(
                bait=sanitize(bait),
                treatment=sanitize(treatment),
                kind=sanitize(kind),
            )
            for key, val in bait_subgroups.items():
                bait_subgroup_values[sanitize(key)].update(
                    [sanitize(val, False)])

            if treatment == 'all':
                local_fn = (
                    '4cker-output/{comparison}/{kind}_k{k}/'
                    '{bait}_{kind}_k{k}_adaptive_windows.bigbed'.format(
                        **locals()))

                bait_bed_view.add_tracks(
                    Track(
Exemplo n.º 3
0
hub_config = yaml.load(open(args.hub_config))

hub, genomes_file, genome, trackdb = default_hub(
    hub_name=hub_config['hub']['name'],
    short_label=hub_config['hub']['short_label'],
    long_label=hub_config['hub']['long_label'],
    email=hub_config['hub']['email'],
    genome=hub_config['hub']['genome'])

# Set up subgroups based on the configured columns
df = pandas.read_table(config['sampletable'], comment='#')
cols = hub_config['subgroups']['columns']
subgroups = []
for col in cols:
    unique = list(df[col].unique())
    s = SubGroupDefinition(name=sanitize(col, strict=True),
                           label=col,
                           mapping={
                               sanitize(i, strict=True): sanitize(i,
                                                                  strict=False)
                               for i in unique
                           })
    subgroups.append(s)

# also add direction as a subgroup
# ASSUMPTION: stranded bigwigs were created
subgroups.append(
    SubGroupDefinition(name='strand',
                       label='strand',
                       mapping={
                           'sense': 'sense',
Exemplo n.º 4
0
hub, genomes_file, genome, trackdb = default_hub(
    hub_name=hub_config['hub']['name'],
    short_label=hub_config['hub']['short_label'],
    long_label=hub_config['hub']['long_label'],
    email=hub_config['hub']['email'],
    genome=hub_config['hub']['genome']
)

# Set up subgroups based on the configured columns
df = pandas.read_csv(config['sampletable'], comment='#', sep='\t')
cols = hub_config['subgroups']['columns']
subgroups = []
for col in cols:
    unique = list(df[col].unique())
    s = SubGroupDefinition(
        name=sanitize(col, strict=True),
        label=col,
        mapping={
            sanitize(i, strict=True): sanitize(i, strict=False)
            for i in unique}
    )
    subgroups.append(s)

# also add direction as a subgroup
# ASSUMPTION: stranded bigwigs were created
subgroups.append(
    SubGroupDefinition(
        name='strand',
        label='strand',
        mapping={'sense': 'sense', 'antisense': 'antisense'}))