예제 #1
0
import pydnameth as pdm
from scripts.develop.routines import *

f = open('cpgs.txt', 'r')
items = f.read().splitlines()
reverses = ['no'] * len(items)
x_ranges = ['auto'] * len(items)
y_ranges = ['auto'] * len(items)

data = pdm.Data(
    base='unn_epic'
)

annotations = pdm.Annotations(
    name='annotations',
    type='850k',
    exclude='bad_cpgs_from_ChAMP',
    select_dict={
        'CHR': ['-X', '-Y']
    }
)

observables = pdm.Observables(
    name='observables',
    types={}
)

cells = pdm.Cells(
    name='',
    types='any'
)
예제 #2
0
import pydnameth as pdm
from scripts.develop.routines import *

data = pdm.Data(
    #path='E:/YandexDisk/Work/pydnameth/tissues/brain(DLPFC)',
    path='',
    base='GSE87571'
)

annotations = pdm.Annotations(
    name='annotations',
    type='450k',
    exclude='bad_cpgs',
    select_dict={
        'CHR': ['-X', '-Y']
    }
)

cells = pdm.Cells(
    name='',
    types='any'
)

observables = pdm.Observables(
    name='observables',
    types={}
)

attributes = pdm.Attributes(
    target='age',
    observables=observables,
    tmp_dict = df.to_dict()
    for key in tmp_dict:
        curr_dict = tmp_dict[key]
        table_dict[key] = list(curr_dict.values())

items = table_dict['i']
x_ranges = [[5, 105]] * len(items)
y_ranges = []
for index in range(0, len(items)):
    y_ranges.append([table_dict['begin'][index], table_dict['end'][index]])

data_bases = ['GSE87571_TEST']

for data_base in data_bases:

    data = pdm.Data(path='', base='GSE43414')

    annotations = pdm.Annotations(name='annotations',
                                  type='450k',
                                  exclude='bad_cpgs',
                                  select_dict={'CHR': ['-X', '-Y']})

    observables = pdm.Observables(name='observables', types={})

    cells = pdm.Cells(name='cells', types='any')

    target = get_target(data.base)
    observables_list = get_observables_list(data.base)
    data_params = get_data_params(data.base)

    attributes = pdm.Attributes(target=target,
import pydnameth as pdm

data_sets = ['GSE87571']

for data_set in data_sets:

    cell_types = ['Bcell', 'CD4T', 'NK', 'CD8T', 'Gran']
    cell_name = 'cells_horvath_calculator'

    data = pdm.Data(path='', base=data_set)

    annotations = pdm.Annotations(name='annotations',
                                  exclude='bad_cpgs',
                                  cross_reactive='any',
                                  snp='any',
                                  chr='NS',
                                  gene_region='any',
                                  geo='any',
                                  probe_class='any')

    observables = pdm.Observables(name='observables', types={})

    cells = pdm.Cells(name=cell_name, types=cell_types)

    attributes = pdm.Attributes(target='age',
                                observables=observables,
                                cells=cells)

    if data.base == 'GSE55763':
        observables_list = [{
            'gender': 'F',
예제 #5
0
import pydnameth as pdm

items = ['entropy']
x_ranges = [[5, 105]] * len(items)
y_ranges = ['auto'] * len(items)

data_bases = ['GSE87571']

for data_base in data_bases:

    data = pdm.Data(
        path='',
        base=data_base
    )

    annotations = pdm.Annotations(
        name='annotations',
        exclude='bad_cpgs',
        cross_reactive='any',
        snp='any',
        chr='NS',
        gene_region='any',
        geo='any',
        probe_class='any'
    )

    observables = pdm.Observables(
        name='observables',
        types={}
    )
예제 #6
0
import pydnameth as pdm
from scripts.develop.routines import *


data = pdm.Data(
    path='',
    base='unn_epic'
)

annotations = pdm.Annotations(
    name='annotations',
    type='850k',
    exclude='none',
    select_dict={}
)

observables = pdm.Observables(
    name='observables_part(v1)',
    types={'COVID': ['no', 'before'],
           'Sample_Chronology': [0, 1]}
)

cells = pdm.Cells(
    name='cell_counts_part(v1)',
    types='any'
)

target = 'Group'
attributes = pdm.Attributes(
    target=target,
    observables=observables,
예제 #7
0
import pydnameth as pdm

data = pdm.Data(
    path=
    'E:/YandexDisk/Work/pydnameth/script_datasets/GPL13534/filtered/blood(whole)',
    base='GSE87571')

data_params = {
    'norm': 'fun',
    'part': 'wo_missedFeatures',
}

chip_type = '450k'
fn = 'observables_part(wo_missedFeatures)'

pdm.betas_horvath_calculator_create_regular(chip_type=chip_type,
                                            observables_fn=fn,
                                            data=data,
                                            data_params=data_params)
예제 #8
0
    tmp_dict = df.to_dict()
    for key in tmp_dict:
        curr_dict = tmp_dict[key]
        cols_dict[key] = list(curr_dict.values())

data_bases = cols_dict['data_bases']

data_list = []
annotations_list = []
attributes_list = []
observables_list = []
data_params_list = []

for data_base in data_bases:

    data = pdm.Data(path='E:/YandexDisk/Work/pydnameth/epityper/FIGN',
                    base=data_base)
    data_list.append(data)

    annotations = pdm.Annotations(name='annotations',
                                  type='epityper',
                                  exclude='none',
                                  select_dict={})
    annotations_list.append(annotations)

    observables = pdm.Observables(name='observables', types={})
    cells = pdm.Cells(name='cells', types='any')

    target = get_target(data.base)
    obs = get_observables_list(data.base)
    data_params = get_data_params(data.base)
예제 #9
0
import pydnameth as pdm
from scripts.develop.routines import *

data = pdm.Data(path='', base='EPIC')

annotations = pdm.Annotations(name='annotations',
                              type='450k',
                              exclude='bad_cpgs',
                              select_dict={'CHR': ['-X', '-Y']})

observables = pdm.Observables(name='observables', types={})

cells = pdm.Cells(name='cells_horvath_calculator', types='any')

target = get_target(data.base)
observables_list = get_observables_list(data.base)
data_params = get_data_params(data.base)
data_params['cells'] = ['Bcell', 'CD4T', 'CD8T', 'Gran', 'NK']

attributes = pdm.Attributes(target=target,
                            observables=observables,
                            cells=cells)

pdm.residuals_table_approach_4(data=data,
                               annotations=annotations,
                               attributes=attributes,
                               observables_list=observables_list,
                               data_params=data_params)
import pydnameth as pdm
from scripts.develop.routines import *

f = open('cpgs.txt', 'r')
items = f.read().splitlines()
x_ranges = ['auto'] * len(items)
y_ranges = ['auto'] * len(items)

data = pdm.Data(
    path='E:/YandexDisk/Work/pydnameth/epityper/PRR4',
    base='control'
)

annotations = pdm.Annotations(
    name='annotations',
    type='epityper',
    exclude='none',
    select_dict={}
)

observables = pdm.Observables(
    name='observables',
    types={}
)

cells = pdm.Cells(
    name='cells',
    types='any'
)

target = get_target(data.base)
예제 #11
0
import pydnameth as pdm

f = open('genes.txt', 'r')
items = f.read().splitlines()
x_ranges = [[5, 105]] * len(items)
y_ranges = ['auto'] * len(items)


data = pdm.Data(
    path='',
    base='E-MTAB-7309-FILTERED'
)

annotations = pdm.Annotations(
    name='annotations',
    exclude='bad_cpgs',
    cross_reactive='any',
    snp='any',
    chr='NS',
    gene_region='any',
    geo='islands_shores',
    probe_class='any'
)

observables = pdm.Observables(
    name='observables',
    types={}
)

cells = pdm.Cells(
    name='cells_horvath_calculator',
import pydnameth as pdm

data = pdm.Data(name='cpg_beta', path='', base='EPIC')

annotations = pdm.Annotations(name='annotations',
                              exclude='none',
                              cross_reactive='ex',
                              snp='ex',
                              chr='NS',
                              gene_region='yes',
                              geo='any',
                              probe_class='any')

observables = pdm.Observables(name='observables', types={})

cells = pdm.Cells(name='cells', types='any')

attributes = pdm.Attributes(target='age', observables=observables, cells=cells)

observables_list = [{'gender': 'F'}, {'gender': 'M'}]

pdm.cpg_proc_table_z_test_linreg(data=data,
                                 annotations=annotations,
                                 attributes=attributes,
                                 observables_list=observables_list)
예제 #13
0
import pydnameth as pdm
from scripts.develop.routines import *


data = pdm.Data(
    path='',
    base='GSE40279'
)

annotations = pdm.Annotations(
    name='annotations',
    type='450k',
    exclude='bad_cpgs',
    select_dict={
        'CHR': ['-X', '-Y']
    }
)

observables = pdm.Observables(
    name='observables',
    types={}
)

cells = pdm.Cells(
    name='cells_horvath_calculator',
    types='any'
)

target = get_target(data.base)
observables_list = get_observables_list(data.base)
data_params = get_data_params(data.base)
import pydnameth as pdm
from scripts.develop.routines import *
from tqdm import tqdm
import numpy as np
from scipy.stats import pearsonr, pointbiserialr
from statsmodels.stats.multitest import multipletests
from paper.routines.infrastructure.save.table import save_table_dict_xlsx

save_path = 'E:/YandexDisk/Work/pydnameth/unn_epic/comparison'

data_unn_epic = pdm.Data(
    path='',
    base='unn_epic'
)
annotations_unn_epic = pdm.Annotations(
    name='annotations',
    type='850k',
    exclude='bad_cpgs_from_ChAMP',
    select_dict={
        'CHR': ['-X', '-Y']
    }
)
target_unn_epic = 'Age'
observables_unn_epic = pdm.Observables(
    name='observables',
    types={}
)
cells_unn_epic = pdm.Cells(
    name='cell_counts_horvath_filtered_normalized',
    types='any'
)
예제 #15
0
import pydnameth as pdm
from scripts.develop.routines import *


data = pdm.Data(
    path='',
    base='GSE55763'
)

annotations = pdm.Annotations(
    name='annotations',
    type='450k',
    exclude='bad_cpgs',
    select_dict={
        'CHR': ['-X', '-Y']
    }
)

observables = pdm.Observables(
    name='observables',
    types={}
)

cells = pdm.Cells(
    name='cells_horvath_calculator',
    types='any'
)

target = get_target(data.base)
observables_list = get_observables_list(data.base)
data_params = get_data_params(data.base)
import pydnameth as pdm

data = pdm.Data(name='cpg_beta', path='', base='GSE87571')

annotations = pdm.Annotations(name='annotations',
                              exclude='none',
                              cross_reactive='ex',
                              snp='ex',
                              chr='NS',
                              gene_region='yes',
                              geo='any',
                              probe_class='any')

observables = pdm.Observables(name='observables', types={})

cells = pdm.Cells(name='cells', types='any')

attributes = pdm.Attributes(target='age', observables=observables, cells=cells)

observables_list = [{'smoke': 0}, {'smoke': [1, 2, 3, 4]}]

pdm.cpg_proc_table_polygon(data=data,
                           annotations=annotations,
                           attributes=attributes,
                           observables_list=observables_list)
예제 #17
0
import pydnameth as pdm
from scripts.develop.routines import *

data = pdm.Data(
    path='',
    #path='E:/YandexDisk/Work/pydnameth/tissues/brain(DLPFC)',
    base='GSE87571'
    #base='liver'
    #base='GSE74193'
)

annotations = pdm.Annotations(name='annotations',
                              type='450k',
                              exclude='bad_cpgs',
                              select_dict={'CHR': ['-X', '-Y']})

cells = pdm.Cells(name='cells_horvath_calculator', types='any')

target = get_target(data.base)
data_params = get_data_params(data.base)

if data.base == 'GSE55763':
    observables_list = [
        {
            'gender': 'any',
            'is_duplicate': '0',
            'age': (35, 100)
        },
    ]
else:
    # observables_list = [
예제 #18
0
import pydnameth as pdm
from scripts.develop.routines import *

data = pdm.Data(path='', base='liver')

annotations = pdm.Annotations(name='annotations',
                              type='450k',
                              exclude='bad_cpgs',
                              select_dict={'CHR': ['-X', '-Y']})

cells = pdm.Cells(name='cells_horvath_calculator', types='any')

target = 'age'
observables_list = [
    {
        'gender': 'any'
    },
]
data_params = get_data_params(data.base)
data_params['cells'] = ['CD8T', 'CD4T', 'NK', 'Bcell', 'Gran']
data_params['observables'] = ['gender']

for obs in observables_list:

    observables = pdm.Observables(name='observables', types=obs)

    attributes = pdm.Attributes(target=target,
                                observables=observables,
                                cells=cells)

    pdm.residuals_table_oma(data=data,
예제 #19
0
import pydnameth as pdm
from scripts.develop.routines import *

data = pdm.Data(path='', base='GSE87571')

annotations = pdm.Annotations(name='annotations',
                              type='450k',
                              exclude='bad_cpgs',
                              select_dict={'CHR': ['-X', '-Y']})

cells = pdm.Cells(name='cells_horvath_calculator', types='any')

target = get_target(data.base)
data_params = get_data_params(data.base)
data_params['cells'] = ['CD8T', 'CD4T', 'NK', 'Bcell', 'Gran']

if data.base == 'GSE55763':
    observables_list = [
        {
            'gender': 'any',
            'is_duplicate': '0',
            'age': (35, 100)
        },
    ]
else:
    observables_list = [
        {
            'gender': 'any'
        },
    ]
예제 #20
0
            if '(' in filter_list[1] and ')' in filter_list[1]:
                filter_values_str = filter_list[1][1::-1]
                filter_value = filter_values_str.split(',')
            else:
                filter_value = filter_list[1]
            ds_filter[ds][filter_key] = filter_value

ololo = 1

f.close()




data = pdm.Data(
    path='E:/YandexDisk/Work/pydnameth/script_datasets/GPL13534/filtered/airway_epithelial_cells',
    base='GSE85566'
)

annotations = None

cells = None

observables = pdm.Observables(
    name='observables',
    types={}
)

attributes = pdm.Attributes(
    target='age',
    observables=observables,
    cells=cells