Diff of /main.py [000000] .. [2d53aa]

Switch to unified view

a b/main.py
1
import numpy as np
2
import pandas as pd
3
from MultiOmiVAE import MultiOmiVAE
4
from MethyOmiVAE import MethyOmiVAE
5
from ExprOmiVAE import ExprOmiVAE
6
from plot_sactter import plot_scatter
7
from classification import classification
8
9
10
if __name__ == "__main__":
11
    input_path = 'data/OmiVAE/PANCAN/GDC-PANCAN_'
12
13
    expr_path = input_path + 'htseq_fpkm_'
14
    methy_path = input_path + 'methylation450_'
15
16
    # Loading data
17
18
    print('Loading gene expression data...')
19
    expr_df = pd.read_csv(expr_path + 'preprocessed_both.tsv', sep='\t', header=0, index_col=0)
20
21
    print('Loading DNA methylation data...')
22
    methy_chr_df_list = []
23
    chr_id = list(range(1, 23))
24
    chr_id.append('X')
25
    # Loop among different chromosomes
26
    for chrom in chr_id:
27
        print('Loading methylation data on chromosome ' + str(chrom) + '...')
28
        methy_chr_path = methy_path + 'preprocessed_both_chr' + str(chrom) + '.tsv'
29
        # methy_chr_df = pd.read_csv(methy_chr_path, sep='\t', header=0, index_col=0, dtype=all_cols_f32)
30
        methy_chr_df = pd.read_csv(methy_chr_path, sep='\t', header=0, index_col=0)
31
        methy_chr_df_list.append(methy_chr_df)
32
33
    e_num_1 = 50
34
    e_num_2 = 200
35
    l_dim = 128
36
37
    # Example
38
    latent_code, train_acc, val_acc = MultiOmiVAE(input_path=input_path, expr_df=expr_df,
39
                                                  methy_chr_df_list=methy_chr_df_list, p1_epoch_num=e_num_1,
40
                                                  p2_epoch_num=e_num_2, latent_dim=l_dim, early_stopping=False)