Add initial R project file for xMap biomarker analysis
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
.venv/*
|
||||||
Executable
BIN
Binary file not shown.
+11731
File diff suppressed because one or more lines are too long
Executable
+365
File diff suppressed because one or more lines are too long
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
# Let's inspect the files
|
||||||
|
antigen1 = pd.read_excel('xmap_biomarkers/data/02a.AP0211_GLA02_SBA01_Antigen_list.xlsx')
|
||||||
|
antigen2 = pd.read_excel('xmap_biomarkers/data/02b. AP0211 GLA02_SBA02_Antigen_list.xlsx')
|
||||||
|
|
||||||
|
data1 = pd.read_excel('xmap_biomarkers/data/12a. AP0211 GLA02 SBA01_Data Intensity.xlsx')
|
||||||
|
data2 = pd.read_excel('xmap_biomarkers/data/12b. AP0211 GLA02 SBA02_Data_Intensity.xlsx')
|
||||||
|
|
||||||
|
print("Antigen 1:")
|
||||||
|
print(antigen1[['BeadID (Analyte)', 'Antigen name', 'Gene name']].head(5))
|
||||||
|
|
||||||
|
print("\nData 1 columns:")
|
||||||
|
print(data1.columns[:10])
|
||||||
|
print(data1[['Internal LIMS ID', 'Tube label']].head(3))
|
||||||
Executable
+110
@@ -0,0 +1,110 @@
|
|||||||
|
import nbformat as nbf
|
||||||
|
|
||||||
|
nb = nbf.v4.new_notebook()
|
||||||
|
|
||||||
|
text1 = """\
|
||||||
|
# Part 1: Exploratory Data Analysis
|
||||||
|
|
||||||
|
In this notebook, we explore the preprocessed datasets generated from the autoimmunity profiling study on Exfoliative Glaucoma (XFG).
|
||||||
|
|
||||||
|
We will focus primarily on `slice_1_significant_7.csv`, which contains the 7 protein fragments found to be significantly associated with the condition.
|
||||||
|
"""
|
||||||
|
|
||||||
|
code1 = """\
|
||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import seaborn as sns
|
||||||
|
|
||||||
|
# Load the slices
|
||||||
|
slice_1 = pd.read_csv('slice_1_significant_7.csv')
|
||||||
|
slice_2 = pd.read_csv('slice_2_sig7_plus_33_random.csv')
|
||||||
|
slice_3 = pd.read_csv('slice_3_all_proteins.csv')
|
||||||
|
|
||||||
|
print("Slice 1 (Significant 7) shape:", slice_1.shape)
|
||||||
|
print("Slice 2 (Sig 7 + 33 random) shape:", slice_2.shape)
|
||||||
|
print("Slice 3 (All proteins) shape:", slice_3.shape)
|
||||||
|
|
||||||
|
slice_1.head()
|
||||||
|
"""
|
||||||
|
|
||||||
|
text2 = """\
|
||||||
|
### Class Distribution
|
||||||
|
|
||||||
|
Let's check the distribution of our target variable `group`, where `1` represents Exfoliative Glaucoma (XFG) and `0` represents Healthy Controls.
|
||||||
|
"""
|
||||||
|
|
||||||
|
code2 = """\
|
||||||
|
plt.figure(figsize=(6, 4))
|
||||||
|
sns.countplot(x='group', data=slice_1, hue='group', palette='Set2', legend=False)
|
||||||
|
plt.title('Distribution of Target Variable (Group)')
|
||||||
|
plt.xlabel('Group (0 = Healthy, 1 = XFG)')
|
||||||
|
plt.ylabel('Count')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
print(slice_1['group'].value_counts())
|
||||||
|
"""
|
||||||
|
|
||||||
|
text3 = """\
|
||||||
|
### Feature Distributions
|
||||||
|
|
||||||
|
We will examine the distributions of the 7 significant protein fragments across the two groups. This helps us visualize how well individual features might separate the classes.
|
||||||
|
"""
|
||||||
|
|
||||||
|
code3 = """\
|
||||||
|
# Extract the feature columns (excluding identifiers and target)
|
||||||
|
significant_cols = [c for c in slice_1.columns if c not in ['Internal LIMS ID', 'Original ID', 'group']]
|
||||||
|
|
||||||
|
fig, axes = plt.subplots(nrows=2, ncols=4, figsize=(18, 10))
|
||||||
|
axes = axes.flatten()
|
||||||
|
|
||||||
|
for i, col in enumerate(significant_cols):
|
||||||
|
sns.histplot(data=slice_1, x=col, hue='group', kde=True, ax=axes[i], palette='Set2')
|
||||||
|
axes[i].set_title(col)
|
||||||
|
|
||||||
|
# Remove the empty subplot
|
||||||
|
fig.delaxes(axes[7])
|
||||||
|
|
||||||
|
plt.tight_layout()
|
||||||
|
plt.show()
|
||||||
|
"""
|
||||||
|
|
||||||
|
text4 = """\
|
||||||
|
### Correlation Analysis
|
||||||
|
|
||||||
|
Let's look at the correlation matrix to see if these 7 significant protein fragments are highly correlated with each other. If they are highly correlated, they might carry redundant information for our Decision Tree.
|
||||||
|
"""
|
||||||
|
|
||||||
|
code4 = """\
|
||||||
|
plt.figure(figsize=(8, 6))
|
||||||
|
sns.heatmap(slice_1[significant_cols].corr(), annot=True, cmap='coolwarm', fmt=".2f", vmin=-1, vmax=1)
|
||||||
|
plt.title('Correlation Matrix of Significant Features')
|
||||||
|
plt.show()
|
||||||
|
"""
|
||||||
|
|
||||||
|
text5 = """\
|
||||||
|
### Motivating the Data for Classification
|
||||||
|
|
||||||
|
This dataset is highly suitable for a binary classification task for the following reasons:
|
||||||
|
1. **Clear Target Variable:** We have a well-defined, discrete target variable (`group`), which represents the presence or absence of Exfoliative Glaucoma (1 vs 0).
|
||||||
|
2. **Numeric Features:** The autoantibody reactivity levels (median fluorescent intensities transformed via Box-Cox) act as continuous numeric features.
|
||||||
|
3. **Biological Relevance:** The selected features (the 'Significant 7') have demonstrated statistical significance in separating the groups based on a Moderated t-test, providing a solid biological foundation that they contain predictive signal.
|
||||||
|
4. **Iterative Model Building:** The slices provided (7 features, 40 features, and all features) will allow us to experiment with varying degrees of dimensionality and find the optimal representation to avoid underfitting or overfitting our Decision Tree and MLP classifiers.
|
||||||
|
"""
|
||||||
|
|
||||||
|
nb['cells'] = [
|
||||||
|
nbf.v4.new_markdown_cell(text1),
|
||||||
|
nbf.v4.new_code_cell(code1),
|
||||||
|
nbf.v4.new_markdown_cell(text2),
|
||||||
|
nbf.v4.new_code_cell(code2),
|
||||||
|
nbf.v4.new_markdown_cell(text3),
|
||||||
|
nbf.v4.new_code_cell(code3),
|
||||||
|
nbf.v4.new_markdown_cell(text4),
|
||||||
|
nbf.v4.new_code_cell(code4),
|
||||||
|
nbf.v4.new_markdown_cell(text5)
|
||||||
|
]
|
||||||
|
|
||||||
|
with open('EDA.ipynb', 'w') as f:
|
||||||
|
nbf.write(nb, f)
|
||||||
|
|
||||||
|
print("EDA.ipynb created successfully.")
|
||||||
Executable
+192
@@ -0,0 +1,192 @@
|
|||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
import re
|
||||||
|
from sklearn.preprocessing import PowerTransformer
|
||||||
|
|
||||||
|
# 1. Load Data
|
||||||
|
antigen1 = pd.read_excel('../xmap_biomarkers/data/02a.AP0211_GLA02_SBA01_Antigen_list.xlsx')
|
||||||
|
antigen2 = pd.read_excel('../xmap_biomarkers/data/02b. AP0211 GLA02_SBA02_Antigen_list.xlsx')
|
||||||
|
data1 = pd.read_excel('../xmap_biomarkers/data/12a. AP0211 GLA02 SBA01_Data Intensity.xlsx')
|
||||||
|
data2 = pd.read_excel('../xmap_biomarkers/data/12b. AP0211 GLA02 SBA02_Data_Intensity.xlsx')
|
||||||
|
layout = pd.read_excel('../xmap_biomarkers/data/layout.xlsx')
|
||||||
|
|
||||||
|
datasets = [data1, data2]
|
||||||
|
antigens = [antigen1, antigen2]
|
||||||
|
controls = ["Anti-human IgG", "EBNA1", "Bare-bead", "His6ABP"]
|
||||||
|
|
||||||
|
# Helper functions
|
||||||
|
def handle_background(df):
|
||||||
|
# Empty sample is "EMPTY-0001"
|
||||||
|
empty_df = df[df['Internal LIMS ID'] == 'EMPTY-0001']
|
||||||
|
if empty_df.empty:
|
||||||
|
return df
|
||||||
|
|
||||||
|
# Calculate background noise
|
||||||
|
# We only care about Analyte columns
|
||||||
|
analyte_cols = [c for c in df.columns if c.startswith('Analyte')]
|
||||||
|
empty_means = empty_df[analyte_cols].mean()
|
||||||
|
median_mean = empty_means.median()
|
||||||
|
sd_mean = empty_means.std()
|
||||||
|
|
||||||
|
# subset of empty_means < median + sd
|
||||||
|
inset = empty_means[empty_means < (median_mean + sd_mean)]
|
||||||
|
if len(inset) < 0.95 * len(empty_means):
|
||||||
|
calset = empty_means
|
||||||
|
else:
|
||||||
|
calset = inset
|
||||||
|
|
||||||
|
cutoff = calset.max() + calset.std()
|
||||||
|
|
||||||
|
# Keep columns where at least one sample is > cutoff
|
||||||
|
bgmap = df[analyte_cols] > cutoff
|
||||||
|
keep_cols = bgmap.sum() > 0
|
||||||
|
keep_analyte_cols = [c for c in analyte_cols if keep_cols[c]]
|
||||||
|
|
||||||
|
return df[['Internal LIMS ID', 'Original ID'] + keep_analyte_cols]
|
||||||
|
|
||||||
|
def emptyadjust(df):
|
||||||
|
empty_df = df[df['Internal LIMS ID'] == 'EMPTY-0001']
|
||||||
|
if empty_df.empty:
|
||||||
|
return df
|
||||||
|
|
||||||
|
analyte_cols = [c for c in df.columns if c.startswith('Analyte')]
|
||||||
|
emptyvector = empty_df[analyte_cols].mean()
|
||||||
|
|
||||||
|
df = df[(df['Internal LIMS ID'] != 'EMPTY-0001') & (df['Internal LIMS ID'] != 'MIX_2-0029')].copy()
|
||||||
|
|
||||||
|
# Subtract empty vector
|
||||||
|
df[analyte_cols] = df[analyte_cols].sub(emptyvector, axis=1)
|
||||||
|
|
||||||
|
# set <0 to 0, then add 1
|
||||||
|
df[analyte_cols] = df[analyte_cols].clip(lower=0) + 1
|
||||||
|
return df
|
||||||
|
|
||||||
|
def compress_duplicates(df, layout_df):
|
||||||
|
# Layout merges based on Tube label having a hyphen
|
||||||
|
# Find base names before hyphen
|
||||||
|
tube_labels = layout_df['Tube label'].dropna()
|
||||||
|
hyphen_labels = tube_labels[tube_labels.str.contains('-')]
|
||||||
|
|
||||||
|
base_names = []
|
||||||
|
for lbl in hyphen_labels:
|
||||||
|
base = lbl.split('-')[0]
|
||||||
|
if base not in base_names:
|
||||||
|
base_names.append(base)
|
||||||
|
|
||||||
|
analyte_cols = [c for c in df.columns if c.startswith('Analyte')]
|
||||||
|
|
||||||
|
for base in base_names:
|
||||||
|
# Find sample ids in layout matching base$ or base-
|
||||||
|
pattern = f"^{base}$|^{base}-"
|
||||||
|
matching_layout = layout_df[layout_df['Tube label'].str.contains(pattern, regex=True, na=False)]
|
||||||
|
mergerows = matching_layout['Sample id_LIMS'].dropna().tolist()
|
||||||
|
|
||||||
|
if not mergerows:
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Find these sample ids in df
|
||||||
|
regex_pattern = '|'.join(mergerows)
|
||||||
|
matching_idx = df['Internal LIMS ID'].str.contains(regex_pattern, regex=True, na=False)
|
||||||
|
|
||||||
|
if matching_idx.sum() > 0:
|
||||||
|
# calculate mean
|
||||||
|
mean_vals = df.loc[matching_idx, analyte_cols].mean()
|
||||||
|
# replace first occurrence
|
||||||
|
first_idx = df[matching_idx].index[0]
|
||||||
|
df.loc[first_idx, analyte_cols] = mean_vals
|
||||||
|
# drop others
|
||||||
|
drop_idx = df[matching_idx].index[1:]
|
||||||
|
df = df.drop(drop_idx)
|
||||||
|
|
||||||
|
return df
|
||||||
|
|
||||||
|
def set_colname_adapter(df, antigen_df):
|
||||||
|
mapping = {}
|
||||||
|
for col in df.columns:
|
||||||
|
if col.startswith('Analyte'):
|
||||||
|
num = int(col.split(' ')[1])
|
||||||
|
match = antigen_df[antigen_df['BeadID (Analyte)'] == num]
|
||||||
|
if not match.empty:
|
||||||
|
antigen_name = match.iloc[0]['Antigen name']
|
||||||
|
mapping[col] = antigen_name
|
||||||
|
df = df.rename(columns=mapping)
|
||||||
|
# Remove controls
|
||||||
|
drop_cols = [c for c in df.columns if c in controls]
|
||||||
|
df = df.drop(columns=drop_cols)
|
||||||
|
return df
|
||||||
|
|
||||||
|
# Apply stage 1
|
||||||
|
processed_datasets = []
|
||||||
|
for i in range(2):
|
||||||
|
df = datasets[i]
|
||||||
|
df = handle_background(df)
|
||||||
|
df = emptyadjust(df)
|
||||||
|
df = compress_duplicates(df, layout)
|
||||||
|
df = set_colname_adapter(df, antigens[i])
|
||||||
|
# Extract Group based on Original ID (GC -> 1, HD -> 0, else NaN)
|
||||||
|
df['group'] = df['Original ID'].apply(lambda x: 1 if 'GC' in str(x) else (0 if 'HD' in str(x) else np.nan))
|
||||||
|
processed_datasets.append(df)
|
||||||
|
|
||||||
|
# Stage 2: Merge down
|
||||||
|
df1, df2 = processed_datasets
|
||||||
|
# Align columns: Internal LIMS ID, Original ID, group
|
||||||
|
common_keys = ['Internal LIMS ID', 'Original ID', 'group']
|
||||||
|
all_cols = set(df1.columns).union(set(df2.columns))
|
||||||
|
analyte_cols_all = list(all_cols - set(common_keys))
|
||||||
|
|
||||||
|
# Since df1 and df2 have same rows, we can merge on Internal LIMS ID
|
||||||
|
merged = pd.merge(df1, df2, on=['Internal LIMS ID', 'Original ID', 'group'], how='outer', suffixes=('_1', '_2'))
|
||||||
|
|
||||||
|
# Average common columns
|
||||||
|
final_cols = {}
|
||||||
|
for col in analyte_cols_all:
|
||||||
|
if col + '_1' in merged.columns and col + '_2' in merged.columns:
|
||||||
|
merged[col] = merged[[col + '_1', col + '_2']].mean(axis=1)
|
||||||
|
merged = merged.drop(columns=[col + '_1', col + '_2'])
|
||||||
|
elif col + '_1' in merged.columns:
|
||||||
|
merged = merged.rename(columns={col + '_1': col})
|
||||||
|
elif col + '_2' in merged.columns:
|
||||||
|
merged = merged.rename(columns={col + '_2': col})
|
||||||
|
|
||||||
|
# Drop rows with NaN group
|
||||||
|
merged = merged.dropna(subset=['group'])
|
||||||
|
merged = merged.reset_index(drop=True)
|
||||||
|
|
||||||
|
# Separate features and target
|
||||||
|
X = merged.drop(columns=common_keys)
|
||||||
|
y = merged['group']
|
||||||
|
meta = merged[['Internal LIMS ID', 'Original ID']]
|
||||||
|
|
||||||
|
# Box-Cox transformation + Standardization via PowerTransformer
|
||||||
|
pt = PowerTransformer(method='box-cox', standardize=True)
|
||||||
|
# Ensure strictly positive values for Box-Cox
|
||||||
|
min_val = X.min().min()
|
||||||
|
if min_val <= 0:
|
||||||
|
X = X - min_val + 1e-5
|
||||||
|
|
||||||
|
X_transformed = pt.fit_transform(X)
|
||||||
|
X_transformed_df = pd.DataFrame(X_transformed, columns=X.columns)
|
||||||
|
|
||||||
|
# Final dataset
|
||||||
|
final_df = pd.concat([meta, y.astype(int), X_transformed_df], axis=1)
|
||||||
|
|
||||||
|
# Now, create the slices!
|
||||||
|
# 1) Significant 7
|
||||||
|
sig_7 = ['HPRA000767', 'HPRA034083', 'HPRA006876', 'HPRA019035', 'HPRA003490', 'HPRA022019', 'HPRA017192']
|
||||||
|
# Filter out any that might have been dropped during background removal
|
||||||
|
sig_7_present = [c for c in sig_7 if c in final_df.columns]
|
||||||
|
slice_1 = final_df[common_keys + sig_7_present]
|
||||||
|
slice_1.to_csv('slice_1_significant_7.csv', index=False)
|
||||||
|
|
||||||
|
# 2) Significant 7 + 33 random proteins = 40 total
|
||||||
|
np.random.seed(42)
|
||||||
|
other_proteins = [c for c in X.columns if c not in sig_7_present]
|
||||||
|
random_33 = np.random.choice(other_proteins, size=min(33, len(other_proteins)), replace=False).tolist()
|
||||||
|
slice_2_cols = sig_7_present + random_33
|
||||||
|
slice_2 = final_df[common_keys + slice_2_cols]
|
||||||
|
slice_2.to_csv('slice_2_sig7_plus_33_random.csv', index=False)
|
||||||
|
|
||||||
|
# 3) All proteins
|
||||||
|
final_df.to_csv('slice_3_all_proteins.csv', index=False)
|
||||||
|
|
||||||
|
print("Preprocessing complete. Slices saved.")
|
||||||
Executable
+61
@@ -0,0 +1,61 @@
|
|||||||
|
Internal LIMS ID,Original ID,group,HPRA000767,HPRA034083,HPRA006876,HPRA019035,HPRA003490,HPRA022019,HPRA017192
|
||||||
|
GLA_02-0001,HD1,0,0.35232875412743836,-0.07466323693315602,0.44245110715157626,0.2108019944690416,-0.02567836198464133,-0.9237625501741185,0.0282527608663072
|
||||||
|
GLA_02-0002,GC1,1,2.1848650359762796,0.46707545924824756,1.272994791325173,1.8575994781015295,2.7092902566946657,1.367954769004817,0.22004125911044942
|
||||||
|
GLA_02-0003,HD2,0,0.5199692144152579,-0.3586975666356526,0.12417658064200883,1.3830033043092367,1.2274931203578958,-0.12888872297595116,-0.3437917008541735
|
||||||
|
GLA_02-0004,GC2,1,1.1551891187702465,0.46707545924824756,0.630671183129744,0.08084688608241689,-0.02567836198464133,-0.41699532362966957,0.7531636406708422
|
||||||
|
GLA_02-0005,HD3,0,-0.590506967188477,-0.07466323693315602,-1.423605220494033,-1.5912144786342457,-0.3750248736958534,-0.16584910275474768,-1.2920292458737959
|
||||||
|
GLA_02-0006,GC3,1,0.5199692144152579,0.27318288197579516,0.261582721027003,-0.4313446602894372,0.3757493952089582,-0.24366563974217237,0.13856283104764291
|
||||||
|
GLA_02-0007,HD4,0,-0.2902160584137654,-0.9045879980206282,-0.400547912982761,-0.6717769904412173,-0.4381684293524799,-1.1432728016416078,-0.5582503491075028
|
||||||
|
GLA_02-0008,GC4,1,-0.1261809533964279,0.27318288197579516,0.02364907656915124,-0.0848796984566102,0.08086097914728763,0.15566455478357288,-0.042994478034408284
|
||||||
|
GLA_02-0009,HD5,0,-0.2902160584137654,-1.1328513210042335,-1.5778713598477223,-0.7720934214376011,-0.02567836198464133,-1.1432728016416078,1.4401229700242133
|
||||||
|
GLA_02-0010,GC5,1,-0.8599660630370055,-0.5218015293190893,-0.8916775265538579,-0.1295964012824051,-0.5028907123219312,-1.9321891028613036,-0.8089945764162757
|
||||||
|
GLA_02-0011,HD6,0,-0.6551926404916829,-0.21039226897561197,-0.8916775265538579,1.9113176496764868,-0.08067958864585108,-0.46452531580820833,-1.0819534185504869
|
||||||
|
GLA_02-0012,GC6,1,0.8937281328887505,0.6380248624129868,0.34537617346978017,0.3606861862444068,1.3543402748206086,0.7603992566600379,0.3324189683428917
|
||||||
|
GLA_02-0013,HD7,0,-1.006407288521192,1.3191908685330245,0.17166045293859225,0.5758124649356954,-0.5028907123219312,-0.12888872297595116,0.8954656660271288
|
||||||
|
GLA_02-0014,GC7,1,-1.006407288521192,0.27318288197579516,0.34537617346978017,1.0475054765946445,-0.3750248736958534,0.7062338918719954,0.180005962489681
|
||||||
|
GLA_02-0015,HD8,0,-0.1261809533964279,0.16581886941762303,-0.266021181355027,-0.15249457371280856,-0.13689854766454324,-1.3986079992090785,0.25874320530494177
|
||||||
|
GLA_02-0016,GC8,1,0.07669004289574279,3.192803959189013,2.5047016917204554,2.5342421086924634,0.28127508298013165,2.02589469208438,1.9317839274191808
|
||||||
|
GLA_02-0017,HD9,0,-0.46598113040907496,-1.3940213631312095,-0.4361509291649099,-0.7720934214376011,-0.3750248736958534,-1.4932787680904613,-0.523117080076437
|
||||||
|
GLA_02-0018,GC9,1,2.5810825499648566,1.7919674328221287,1.748142257507378,0.9956827535056035,1.0934343198935665,1.2007661538537067,1.7411450057609106
|
||||||
|
GLA_02-0019,HD10,0,-0.07385793134159248,0.16581886941762303,-0.36576173515743865,-0.020369908386339404,-0.6373772221993065,-0.0931399283385384,0.1697801973386287
|
||||||
|
GLA_02-0020,GC10,1,0.5995767331336967,0.27318288197579516,0.5658743084429582,0.1930070355178175,-0.13689854766454324,0.15566455478357288,0.180005962489681
|
||||||
|
GLA_02-0021,HD11,0,-1.5980391294454694,-0.2828461181917133,-1.795129435817047,-1.7025434570017213,-2.060727174739533,2.1043358759870756,-2.3907516085189187
|
||||||
|
GLA_02-0022,GC11,1,0.5995767331336967,-0.21039226897561197,0.5658743084429582,-0.32379579678588893,0.28127508298013165,-0.24366563974217237,-0.3437917008541735
|
||||||
|
GLA_02-0023,HD12,0,-1.006407288521192,-1.5397546569910414,-1.510290738485404,-0.9159731221179215,-1.007203357563949,-0.025041699405784285,-0.9858503394712446
|
||||||
|
GLA_02-0024,GC12,1,0.5995767331336967,0.9275994073371407,0.12417658064200883,0.39168814816225406,0.6392381541215421,0.39634673352251676,0.180005962489681
|
||||||
|
GLA_02-0025,HD13,0,-1.243347128296541,-0.6097587101011761,-0.266021181355027,-1.7025434570017213,-1.8367271410145674,-1.4932787680904613,-1.3201450525991523
|
||||||
|
GLA_02-0026,GC13,1,0.7512180657634696,-0.5218015293190893,0.4236710161738875,0.3288867579513822,-0.6373772221993065,0.35314869286263434,-0.09282017771024566
|
||||||
|
GLA_02-0027,HD14,0,-0.46598113040907496,-1.6975547243729927,-1.0934250036740272,-1.2909445954160785,-0.5028907123219312,-1.3089763203708613,-1.8027560784947065
|
||||||
|
GLA_02-0028,GC14,1,-1.5046542208654317,0.37332947968758695,0.261582721027003,0.2962560552131855,-0.13689854766454324,-0.025041699405784285,0.4345137947460142
|
||||||
|
GLA_02-0029,HD15,0,0.5199692144152579,-0.14107555275683592,-0.4361509291649099,0.17496504456466822,0.9144837834704801,-0.41699532362966957,-0.269266507326344
|
||||||
|
GLA_02-0030,GC15,1,-0.1261809533964279,0.9275994073371407,1.0792208516956157,0.8428554498081914,0.08086097914728763,1.3252603859293541,0.7993475312252929
|
||||||
|
GLA_02-0031,HD16,0,-0.8599660630370055,0.37332947968758695,0.21743085177940483,0.021023534607523015,-0.19438640896761453,0.15566455478357288,-0.6881572939856614
|
||||||
|
GLA_02-0032,GC16,1,-0.1261809533964279,0.46707545924824756,0.3042039810112527,0.5357951513806428,0.7211210490118753,-0.0931399283385384,0.13856283104764291
|
||||||
|
GLA_02-0033,HD17,0,-1.3275117711947564,-1.1328513210042335,-2.1241813705332078,-1.5912144786342457,-0.9289881496989316,-0.7329088093186927,0.9589373345061143
|
||||||
|
GLA_02-0034,GC17,1,0.7512180657634696,1.2700530506263426,1.2244940341633144,0.9595695781717004,0.8770313739570519,1.4413369070037392,0.6920651327796619
|
||||||
|
GLA_02-0035,HD18,0,1.1551891187702465,-0.4382392829641482,-0.4361509291649099,-0.32379579678588893,0.9876795661224924,-0.6188890545809432,-0.8514263976814501
|
||||||
|
GLA_02-0036,GC18,1,-1.6949405450077124,-0.07466323693315602,-0.6275418199065357,-0.9539229932757979,-0.6373772221993065,-1.4932787680904613,-0.4719476113394781
|
||||||
|
GLA_02-0037,HD19,0,-2.3672695908285277,-1.3940213631312095,0.4970123702869271,-1.245225540328053,-1.8367271410145674,-1.0665209157815445,-2.205543008398773
|
||||||
|
GLA_02-0038,GC19,1,0.4376155679100238,0.37332947968758695,0.9286948268745908,1.6488861194603364,0.800332859856034,1.856926729618737,1.5018120406628783
|
||||||
|
GLA_02-0039,HD20,0,-1.0829486070893226,-0.2828461181917133,-0.266021181355027,0.0004828554070358009,-2.3041139445173093,-0.41699532362966957,0.4506335429052696
|
||||||
|
GLA_02-0040,GC20,1,1.7515716229642004,-3.0465169149406215,-0.7110135596806529,-0.8069294112696193,2.5697964024636426,0.6475274561670843,-0.7676687753363817
|
||||||
|
GLA_02-0041,HD21,0,0.5199692144152579,0.32410401273329337,0.02364907656915124,-0.04154251982303697,0.28127508298013165,-0.12888872297595116,0.2682185732104478
|
||||||
|
GLA_02-0042,GC21,1,0.4376155679100238,0.27318288197579516,0.4236710161738875,0.5626259544871942,-0.6373772221993065,1.8493332381788996,2.698755255707267
|
||||||
|
GLA_02-0043,HD22,0,1.36215674964206,1.8239539180061284,2.5388437926248315,0.6270965545567145,1.2917726281142086,1.2067063129145912,1.3665458905577537
|
||||||
|
GLA_02-0044,GC22,1,0.8937281328887505,0.9275994073371407,1.017746059525529,1.2166816763296446,0.8770313739570519,0.47659309362440433,0.36751709734547144
|
||||||
|
GLA_02-0045,HD23,0,0.560105242714116,-0.21039226897561197,-0.3317634072842041,-0.175765283129113,0.7211210490118753,2.151787994821404,-0.3285616093849758
|
||||||
|
GLA_02-0046,GC23,1,0.26390228364577784,0.05026222610752633,0.4236710161738875,0.22835536044088886,0.46675141836634826,-0.16584910275474768,0.5714070318821254
|
||||||
|
GLA_02-0047,HD24,0,-0.7216031003080254,0.16581886941762303,0.46092972891434936,-0.1295964012824051,-1.4366368356194654,-0.7937039255879613,0.039741986560203224
|
||||||
|
GLA_02-0048,GC24,1,0.6766080659700437,0.27318288197579516,0.46092972891434936,0.1930070355178175,1.0934343198935665,0.5495861890333105,0.29618098843361607
|
||||||
|
GLA_02-0049,HD25,0,0.560105242714116,0.22045985255696643,-0.9896812734011824,-0.842503991780491,1.0234547286868367,0.7201793080175072,-1.0332138851324102
|
||||||
|
GLA_02-0050,GC25,1,-1.6949405450077124,-0.5218015293190893,0.4970123702869271,0.1930070355178175,0.08086097914728763,-0.6188890545809432,0.0282527608663072
|
||||||
|
GLA_02-0051,HD26,0,-0.1796485557940177,0.5551111654049726,-0.29852532417263866,0.4219245788493127,0.02815333891078876,0.25975459219072217,0.1594652522755021
|
||||||
|
GLA_02-0052,GC26,1,-0.590506967188477,-0.5218015293190893,-0.400547912982761,-1.1145373129154326,-2.060727174739533,-1.3089763203708613,-0.7274038886185776
|
||||||
|
GLA_02-0053,HD27,0,0.07669004289574279,1.110079118757727,0.38517503618942456,-0.4880953917399898,-0.13689854766454324,0.25975459219072217,0.7108077735168263
|
||||||
|
GLA_02-0054,GC27,1,1.2757048596014828,-0.21039226897561197,0.17166045293859225,1.5318585169924672,0.6392381541215421,0.43744399060968686,1.3937513160288415
|
||||||
|
GLA_02-0055,HD28,0,-1.6949405450077124,-0.702537386518218,-2.6160571348885644,-2.2197774468650264,-1.62942284163079,-1.8122869533371007,-1.4371964600580391
|
||||||
|
GLA_02-0056,GC28,1,0.9618768162110931,0.7904377538444992,0.5658743084429582,0.8832420124050829,0.28127508298013165,0.25975459219072217,1.184169217150501
|
||||||
|
GLA_02-0057,HD29,0,-0.5274624027801623,-2.0573709334455725,-1.4449224824719635,-2.0107497209634073,-0.4381684293524799,-0.7937039255879613,-1.6616588389238645
|
||||||
|
GLA_02-0058,GC29,1,0.6766080659700437,0.27318288197579516,0.3042039810112527,0.2962560552131855,0.08086097914728763,-0.24366563974217237,0.41814837982691927
|
||||||
|
GLA_02-0059,HD30,0,-0.23430959174119342,-1.6975547243729927,-1.3816551731546647,-0.842503991780491,-0.4381684293524799,-0.2040851596041294,-1.1577851731742392
|
||||||
|
GLA_02-0060,GC30,1,0.823548219425645,1.1656529178554447,1.6460076223464033,0.8428554498081914,0.6392381541215421,0.8570987220809919,0.25874320530494177
|
||||||
|
Executable
+61
@@ -0,0 +1,61 @@
|
|||||||
|
Internal LIMS ID,Original ID,group,HPRA000767,HPRA034083,HPRA006876,HPRA019035,HPRA003490,HPRA022019,HPRA017192,HPRA044540,HPRA037260,HPRA045626,HPRA028077,HPRA045461,HPRA042769,HPRA025311,HPRA006652,HPRA013851,HPRA040194,HPRA032197,HPRA016022,HPRA011214,HPRA042780,HPRA045819,HPRA012342,HPRA003849,HPRA003532,HPRA023638,HPRA046228,HPRA043442,HPRA039599,HPRA015924,HPRA029223,HPRA011757,HPRA046120,HPRA030026,HPRA009665,HPRA001250,HPRA026116,HPRA038796,HPRA017982,HPRA001152
|
||||||
|
GLA_02-0001,HD1,0,0.35232875412743836,-0.07466323693315602,0.44245110715157626,0.2108019944690416,-0.02567836198464133,-0.9237625501741185,0.0282527608663072,0.5564716288763646,1.4681106617209108,0.10427103543303969,0.7952581064932147,-0.25098775330364786,0.7687859911994692,0.7408336114639578,0.6718403609269863,0.546294510437939,0.5411392800394312,0.6490540867655324,1.179366912149584,0.5673183410223085,0.8338011497833135,-0.4971545699532762,0.34028523931472193,0.22687360148029007,0.2598634490274557,0.7575138548529734,0.10494924610234146,0.41346779883372836,0.6666916920942604,0.5407037209281146,0.8304355410236985,1.0498013747857042,-0.536089924394853,0.7774447432707751,0.7836109961862248,0.4539350310681437,-0.36840753709902047,-0.07040504788201106,0.5515983201436613,0.9378473659799857
|
||||||
|
GLA_02-0002,GC1,1,2.1848650359762796,0.46707545924824756,1.272994791325173,1.8575994781015295,2.7092902566946657,1.367954769004817,0.22004125911044942,-0.3410100405901833,-0.9050020495878917,0.14443263296756284,-0.20059656392177277,0.7572179084957767,-0.3339385925498883,-0.22366662203608192,2.1381563215675525,0.2677813300747199,-0.4668402052002448,-0.20676649600475158,-0.7640023738748439,1.4462645738333013,-0.35150925449853554,0.3053178430233716,0.11160538273133344,1.4127621922427103,1.4142308127779357,-0.3290575421838133,0.5526303598452786,-0.5699559629067925,1.4974946821768145,-0.6152679092318761,-0.15247217845371486,2.007439742386616,0.9138021938679296,-0.1831631242201648,-0.6200140896225562,-0.5625008003357678,0.6778173706123655,1.4714486693975328,2.555079442256709,-0.26252132975302517
|
||||||
|
GLA_02-0003,HD2,0,0.5199692144152579,-0.3586975666356526,0.12417658064200883,1.3830033043092367,1.2274931203578958,-0.12888872297595116,-0.3437917008541735,1.447047864156585,0.6867247727501313,-0.3188042736523046,1.4007766205734948,0.1200322440948793,1.4563741061553952,1.5196647401202892,1.472679313747626,-0.5892247555949072,1.322833629061405,1.4839352715075167,0.8564330107694208,1.1828324738099278,1.4927942199458981,-0.6445634037053044,1.4297666232217516,2.4046324150191176,0.8622630915397407,1.4594921509566106,1.2351508287266713,1.426888851499491,1.424903997391308,1.5587889884045825,1.5219317304168927,1.387472496274909,-0.8111276420119998,1.4659609929938762,1.2984555541040477,0.8032857717292571,-0.07272577298368539,1.0301764790696815,0.03937055427098884,0.8363736210657216
|
||||||
|
GLA_02-0004,GC2,1,1.1551891187702465,0.46707545924824756,0.630671183129744,0.08084688608241689,-0.02567836198464133,-0.41699532362966957,0.7531636406708422,-1.3675549201140242,-2.288136270528733,-0.9814339999924219,-1.930115433924066,-0.3158061795662826,-1.9714743338526943,-1.2346306453678337,-0.9428163476277718,1.0705679439853755,0.5513055484253004,-1.573918081539598,1.9747376778029988,-0.7888852954704842,-1.6806458788453968,-0.2736805002600986,-0.06150921285930366,-1.1665612765518547,-0.4750046909745107,-1.7368536885406738,0.04996751906624367,-2.3726652475232024,-1.7943487881205777,-0.6517098734528987,-1.7987308864085167,-0.2604605494054062,-1.5791150164690781,-1.7084234185859233,0.1515691848225665,0.6921626046623445,0.651407201562577,-2.1792937485240262,0.6912363880571841,0.1863232626067401
|
||||||
|
GLA_02-0005,HD3,0,-0.590506967188477,-0.07466323693315602,-1.423605220494033,-1.5912144786342457,-0.3750248736958534,-0.16584910275474768,-1.2920292458737959,-0.40247758094717645,0.38516592626581003,0.018241265339592326,-0.17971617082956134,-2.2118268491443187,-0.19293296843963845,0.20852122521654445,-0.3562047616134117,-0.35511952581153433,-0.022451639330979354,-0.14596712078105814,-0.8779358731123433,-0.49025654049261996,-0.008393384638431187,1.1500035851668453,-1.24110536677028,-0.8437618745811616,-0.552865526309935,-0.47099810494083083,-0.9873359768364236,-0.30135809829860954,-0.26693472730496376,-0.3817206196346617,-0.06691291049108646,-0.6241089462578825,-0.4511823439812817,-0.13843876662047636,-0.6200140896225562,-0.9736752166179692,-0.1947778987867037,-0.8074809173329376,-1.0293962821388045,-1.60105241783853
|
||||||
|
GLA_02-0006,GC3,1,0.5199692144152579,0.27318288197579516,0.261582721027003,-0.4313446602894372,0.3757493952089582,-0.24366563974217237,0.13856283104764291,-0.9979998789976604,-1.0132296304895625,0.06225466127036112,-1.1347501466367262,0.3679693880327675,-1.1995421415862708,-1.1944181699724685,-0.8803885046761935,0.4327094977602216,-1.3143168015910043,-1.2980480826020089,1.3690421020698842,-0.5461401613889324,-1.3289854645500718,0.607499898011517,-1.6387356794701637,0.7495808700055073,-0.06796179679193262,-1.215156031498321,-0.20784056125492748,-1.3331909419311647,-1.1598749498556542,-0.4449079277661546,-1.0449897217636819,-0.9746947438306736,1.6307995617767037,-1.0809026404659727,-1.1312161048005664,0.6152478694389958,-1.0427363767445401,-1.3706578472349489,0.03937055427098884,-0.7773859661284945
|
||||||
|
GLA_02-0007,HD4,0,-0.2902160584137654,-0.9045879980206282,-0.400547912982761,-0.6717769904412173,-0.4381684293524799,-1.1432728016416078,-0.5582503491075028,-0.6743677931964706,-0.3289199557768434,-0.2776210732020369,-0.13479767061396938,-0.400672395581368,-0.22563972107826957,-0.42565269412771756,0.17448595671310937,-0.35511952581153433,-0.5788575086341874,-0.44755433109821025,-0.6777100003924587,-0.30765238197568245,-0.25854373140794246,0.7751757509134029,-0.20714686952698386,0.714546406312814,-0.1295229189710097,-0.3290575421838133,0.39124414811826635,-0.48662973583481495,-0.30874901415286293,-0.544853104243677,-0.24049116590234185,-0.034231939099017505,-0.48403022295616627,-0.15424662248295237,-0.9043969350553526,1.1099670059686286,-0.5281096221387157,-0.14707696252909444,-0.5480640666539908,1.2480809965225104
|
||||||
|
GLA_02-0008,GC4,1,-0.1261809533964279,0.27318288197579516,0.02364907656915124,-0.0848796984566102,0.08086097914728763,0.15566455478357288,-0.042994478034408284,-1.9328431135131003,-1.949105417489096,-0.9814339999924219,-1.639326046316461,-1.4688237836019444,-1.4540699374118242,-2.136170693082028,-0.7022126024413317,-0.48506108948818394,-2.1703930791706703,-1.8431710908489316,0.08859460873885107,-0.663454121719428,-1.865607376097135,0.0931198153865401,-1.1310619537848947,-0.6191087818280133,2.287302442645816,-0.8455217315563244,-0.5506302399978762,-1.5364322113988667,-1.886612406246413,-1.5312029145194386,-1.836925869142005,-0.4784839057093459,-0.2926270672855209,-1.7570365354628967,-2.166909318662905,-1.4704647970843507,-1.3156805785852308,1.6651409132717985,-0.7122945325488589,-1.1196759721148615
|
||||||
|
GLA_02-0009,HD5,0,-0.2902160584137654,-1.1328513210042335,-1.5778713598477223,-0.7720934214376011,-0.02567836198464133,-1.1432728016416078,1.4401229700242133,1.2294817638603905,0.2504120412108142,-1.8611525317981155,1.094669635475898,-0.05281470678571324,1.109404095671662,1.3346782209801462,0.45407200176674195,-0.7776267668502056,1.039509329298265,1.5598778564226532,-0.3003106167053953,0.14433308891715832,1.3518235359297204,-0.5251262361275585,-0.4073124340125739,0.2697519311619069,0.5102649756947205,1.2232122108040773,2.0477896823119224,1.0777730667785286,1.182181958304528,1.2374854190212048,1.173885450297278,0.08385791955033531,-0.7864557236784449,1.1756582626186631,0.7628442624406121,0.36918806329194226,-1.3922730645220536,0.48462534908536437,-0.3998169823304835,1.663112495956182
|
||||||
|
GLA_02-0010,GC5,1,-0.8599660630370055,-0.5218015293190893,-0.8916775265538579,-0.1295964012824051,-0.5028907123219312,-1.9321891028613036,-0.8089945764162757,-2.065063736161654,-0.9195863153236872,0.5823520162255882,-1.7969843201087154,-0.7590843644328985,-1.6659430370587713,-1.6175888416382618,-1.4311937686380862,-0.6253508334026147,-1.530824299082093,-0.546103764920144,-0.5556107593412939,-0.6038387156314377,-1.8767707998835808,-0.5832709093848483,-1.3612615481187635,-1.244424057562456,-0.9989060104616736,-1.4534774433104767,-2.152365991068717,-1.4299850723634693,-1.6959497685799612,-1.8834468265503868,-1.52644080576896,-1.186778612526758,-0.8365183406395458,-1.6206657173822963,-1.4352681171189956,-0.8286719196889907,0.1597113437078385,0.19259522559986958,-0.8952913129444399,-0.8649556881687536
|
||||||
|
GLA_02-0011,HD6,0,-0.6551926404916829,-0.21039226897561197,-0.8916775265538579,1.9113176496764868,-0.08067958864585108,-0.46452531580820833,-1.0819534185504869,1.1261911961782645,0.3082921128368779,2.0341435302410753,1.0844697293215486,1.9735977813089902,1.8921341433158947,1.3669638356687241,0.5738718369748997,-0.8588795449337849,1.1687860754113288,1.2413559240508552,0.020914218533952558,0.6761762971098446,1.104657210696114,-1.1909741224794905,2.0555639855928485,0.5690261721347027,-0.29382488419308767,1.1260107957420191,-0.07056686510426899,0.8616316255251086,1.0165659915098246,1.2175540233161628,1.1130741759119918,0.10688087313464197,-0.4196999005409718,1.1760759734108022,1.09643524820417,0.09606196070553309,1.8628108300210924,1.246285645577598,-0.20259587281973612,-0.5514756286723751
|
||||||
|
GLA_02-0012,GC6,1,0.8937281328887505,0.6380248624129868,0.34537617346978017,0.3606861862444068,1.3543402748206086,0.7603992566600379,0.3324189683428917,-0.5115856494444888,-0.5135753577950634,-0.5011062973455879,-0.3794980676052647,-0.9491845379055294,-0.4003516046072674,0.687515161118814,0.9571186674910158,0.08453489312416008,-0.6689139069475536,-0.5250864780815927,1.4961579824246016,0.4184985020801213,-0.5713932303774019,-0.8503440274566663,-0.18485373567466365,1.1043134916605282,0.8290949076776369,-0.6286612102957816,-0.3106337417455545,-0.7227570599541742,-0.45137698141626986,-0.3210477366393006,-0.5128524893255714,1.0822448638739053,-0.7864557236784449,-0.4709284158344901,0.5889083436595804,-1.4704647970843507,0.3290890539076134,-0.4756069311180394,0.7626298844828419,-0.5182890179277823
|
||||||
|
GLA_02-0013,HD7,0,-1.006407288521192,1.3191908685330245,0.17166045293859225,0.5758124649356954,-0.5028907123219312,-0.12888872297595116,0.8954656660271288,-0.7878344828300359,-1.2647890948921099,1.6029127568017103,-0.5814255692852591,1.6469164948577708,-0.30467014645435114,-0.851088079292883,-1.0395702873340902,1.981065253037202,-0.7928366295096319,-0.5855466130590782,0.8714710615067954,2.9561180132775084,-0.7058153616261932,-0.07237431523341695,-0.14183056617066472,-0.744947528096176,-0.719083229692369,-0.09842137713557403,0.10494924610234146,-0.6031534773122429,-0.6353264772627368,-0.19737833335527658,-0.5603589769867421,-0.8745337273594898,-0.6113389852248163,-0.5807745082431972,-0.9942851641667027,0.9097063473752824,-0.04421916775788044,0.6621218081639044,0.9879273646616629,-0.4250439899176554
|
||||||
|
GLA_02-0014,GC7,1,-1.006407288521192,0.27318288197579516,0.34537617346978017,1.0475054765946445,-0.3750248736958534,0.7062338918719954,0.180005962489681,-0.5578169789147225,0.09921222253882345,1.1065592077849404,-0.5218855975110115,-0.7590843644328985,-0.5563404753220698,-0.3950211355207605,-1.1403228596379325,-0.17676570645337186,-0.5722718255788025,-0.546103764920144,-0.17022889074326772,-0.7888852954704842,-0.5713932303774019,1.5065068035282172,1.5052650017356057,-1.1665612765518547,-0.32862238124099485,-0.5451331355364906,0.2820435590425829,1.1788592870523829,-0.3434108219572088,-0.5220759169669045,-0.4446079674751848,-0.6541866235323021,-0.40444134049159197,-0.4729309156417349,-0.14079606191624128,-0.8286719196889907,0.6241128085624323,-0.39604111588620117,0.4619715419558823,-0.6213752071644593
|
||||||
|
GLA_02-0015,HD8,0,-0.1261809533964279,0.16581886941762303,-0.266021181355027,-0.15249457371280856,-0.13689854766454324,-1.3986079992090785,0.25874320530494177,-0.34602654196951227,-0.8836169203171303,-0.12744989108852653,0.06038298734772399,-0.25098775330364786,-0.023406650069388184,-0.15700171355094916,-0.81952699093191,-0.06737520870381827,-0.2233228962765469,-0.0929051243751799,-0.8545804265117349,-0.8549497970968124,-0.018474437483791337,-0.5538215052224097,-1.1849080103701624,-1.1285322101715003,-0.7630174958535096,-0.05851536327982086,-0.7698552859624502,-0.16778894326499616,-0.20056369268989263,-0.17922248891475634,0.035672012904037306,-0.8745337273594898,1.280568942323304,-0.025152371836071045,-0.8212388260793033,-0.2662750224630259,-0.2611528282665971,-0.5589817028293563,-0.04842606349785754,-1.5202486690745127
|
||||||
|
GLA_02-0016,GC8,1,0.07669004289574279,3.192803959189013,2.5047016917204554,2.5342421086924634,0.28127508298013165,2.02589469208438,1.9317839274191808,0.5564716288763646,-0.6800112699075432,1.8716875436168718,-0.25554653468635874,1.0227631972454247,-0.5385322530453018,0.04123516340562397,0.7193072839933353,1.4808010140841485,0.46011289966681823,0.4254550293506951,1.769675677340279,0.28759226263800086,-0.0929175608129561,1.8013660661223823,1.6177159211772156,1.4903228539971671,2.7315734267823477,0.2802559313853764,1.5157941579535001,2.5626815932112064,0.5195432268025869,0.4731422625257974,-0.4371347476106245,0.3899200435227941,0.8737016055252547,-0.4434530914743424,0.11650282977271756,1.0449589007472935,2.3777223058095456,0.013940606263056262,1.8748218326327666,0.841250056644349
|
||||||
|
GLA_02-0017,HD9,0,-0.46598113040907496,-1.3940213631312095,-0.4361509291649099,-0.7720934214376011,-0.3750248736958534,-1.4932787680904613,-0.523117080076437,-0.1986161540069594,0.35558144147922155,-0.16297688040924121,-1.1496688278878613,1.4153304008719194,-0.8976951821456571,-0.8963392083812082,-0.7601579596297684,0.15563603063377637,-1.0197799079354863,-1.2017184923084265,0.3545272227238437,-0.5179775538778523,-0.8989534436571192,1.8106999977529505,-0.6228255774631842,0.4928024571183214,-1.1016807457215796,-1.215156031498321,-1.0355054689126155,-1.1433130851969004,-0.9353371570770502,-1.1623124492657446,-0.9562359440751484,-0.5649269507686698,-0.6517795515224456,-0.9373286675028611,-1.2650677179154706,-0.21111769414256376,-0.22748478278983142,2.1887719499197344,-0.8012484675245353,1.385805526548513
|
||||||
|
GLA_02-0018,GC9,1,2.5810825499648566,1.7919674328221287,1.748142257507378,0.9956827535056035,1.0934343198935665,1.2007661538537067,1.7411450057609106,-0.0376044308712974,-1.5182766981015057,0.14443263296756284,-1.120118655003595,2.0268411316662496,-1.3672029031805661,-0.5716883574115313,0.9571186674910158,1.3776599048604286,-0.8011372465807156,-0.2013618740124383,-0.949804284248086,0.5953265136736399,-0.3186806445443683,1.1803189748542509,0.14226989926132727,0.9496045148010781,1.0168742143773137,-0.8455217315563244,0.929451336199965,-0.5170386360387905,-1.0904045852872435,0.04641534385365296,-1.3926205044747377,1.299356572968808,0.09007070872876548,-1.469305992902334,-1.2428060761357647,1.9269561819198908,1.1024103648224546,0.5768750638963803,1.1421950675767,-0.26252132975302517
|
||||||
|
GLA_02-0019,HD10,0,-0.07385793134159248,0.16581886941762303,-0.36576173515743865,-0.020369908386339404,-0.6373772221993065,-0.0931399283385384,0.1697801973386287,0.3020179794762978,-0.7048911377276555,0.6337264374240882,0.09513149433972651,0.003427356093505313,0.17944316197961277,0.10059799697640284,-0.23541011772259102,0.9899357687655397,1.0979413655885921,0.3671536119567846,0.7207442069648017,-0.3835630829366795,0.3068419888314555,-0.22996468602680858,2.2455937966240422,0.3532797541879783,0.2598634490274557,0.06686664278051851,0.10494924610234146,-0.04490068041804927,0.09806077089274308,0.26553626767514577,0.14826539384880044,-0.535808615703419,-0.6727742771922212,0.1821735179462651,0.4620789360751061,1.5777110044117566,-0.331562525833998,-0.12409708090262175,0.33793552306156244,-0.12516155775404036
|
||||||
|
GLA_02-0020,GC10,1,0.5995767331336967,0.27318288197579516,0.5658743084429582,0.1930070355178175,-0.13689854766454324,0.15566455478357288,0.180005962489681,0.8746580148988098,1.0570178363712013,0.6947055395368776,0.9671437848796604,0.9523234962854777,1.0132634508286793,0.9082515003100406,0.48893684759283224,-0.35511952581153433,1.3272655623093974,0.9220062423769013,0.1148450991618686,0.21762760885747984,1.0372621124709807,0.8149233039365624,0.4958601707957397,0.33266853651522205,-0.32862238124099485,1.0185142381578116,0.22167063623876795,0.688432049802936,0.9015364571438518,0.7777827420519747,0.955230552115814,0.5507156009990702,-0.24267286494945617,1.0510588535671896,0.6928527190860114,-0.10439770067976284,2.0668864763113515,0.14636499385386673,-1.1005298933211312,0.48263809274352415
|
||||||
|
GLA_02-0021,HD11,0,-1.5980391294454694,-0.2828461181917133,-1.795129435817047,-1.7025434570017213,-2.060727174739533,2.1043358759870756,-2.3907516085189187,1.5992540650464422,0.5527080080495358,-1.6169677081139942,-1.0575569701629215,-1.4287653104105655,-0.9711258332532924,-1.2612212093595545,-1.6321110086680193,-1.8152289445356071,-1.3570461776999745,-1.2550535738563497,-0.1546781091758166,-2.6909304308405253,-1.217730761017909,-1.9340883443970107,-0.8495037627051834,-2.315449419925471,-2.0063559953770853,-1.6684886387730429,-1.1372745567004454,-1.19268760105922,-0.7050721347600444,-1.5312029145194386,-0.9790720273937764,-2.2539303852346864,-1.2936462195309,-1.1035160852568497,-1.011983806669838,-1.4704647970843507,-1.3156805785852308,1.1638799036174956,-2.253855818866781,1.3347122968257117
|
||||||
|
GLA_02-0022,GC11,1,0.5995767331336967,-0.21039226897561197,0.5658743084429582,-0.32379579678588893,0.28127508298013165,-0.24366563974217237,-0.3437917008541735,-0.2918479900671726,0.2798662124274328,-1.1360500508158278,0.17663353926741776,-0.6758489411468777,0.0014652922498197955,-0.030747111711146833,-0.81952699093191,-1.9582430204558345,0.04837336356996991,-0.12803002039837763,-1.3259786010926455,-1.0682692068021955,-0.048120480778987104,0.6800042116940893,-0.9362633921077823,-0.5585385631682547,0.3085305467677316,0.014820566302402603,-0.4242401758480185,-0.189363688699232,0.062104662704808106,-0.34100423684123626,0.29479930865878073,-0.3673084103286406,-1.4752894804483292,0.18738470745664274,-0.38603477215899845,-0.5625008003357678,0.36711169410064565,0.5714407843907114,-0.35355063872041426,-1.1780723313253698
|
||||||
|
GLA_02-0023,HD12,0,-1.006407288521192,-1.5397546569910414,-1.510290738485404,-0.9159731221179215,-1.007203357563949,-0.025041699405784285,-0.9858503394712446,-0.7133472358035731,0.9793538431925102,-0.7179883085342994,-1.1237502000351824,-0.6367279574557585,-1.217349625593172,0.06494551299657868,-0.8497666957413321,-0.12119504157251663,-1.5481590908111789,-1.5815829053720196,-0.9743824035684611,-1.0682692068021955,-1.5247327962356458,-0.9274510463946953,0.18616325156261282,-1.4505360617230345,-1.1016807457215796,-1.5862586173036204,-0.8959271416207768,0.1938214837792396,-1.2011283314996861,-0.6702554820634143,-1.1813036989476162,-1.4980081588307963,-0.27980056274538895,-1.1484781881505204,-1.2801672520256728,-0.21111769414256376,-0.6628237064133133,0.8247458037687543,-0.30873366580275663,-0.7361440124817958
|
||||||
|
GLA_02-0024,GC12,1,0.5995767331336967,0.9275994073371407,0.12417658064200883,0.39168814816225406,0.6392381541215421,0.39634673352251676,0.180005962489681,-0.5229965013506668,1.4153596491408797,0.03314368458977475,-0.665702992688993,-0.005658810622547033,-0.568697014997889,-0.5953140421073836,0.23314524670189735,0.5093123431314791,-0.7059508944591519,-0.5746696165030172,1.6536433660606262,0.10635182305066915,-0.5974179813871096,-0.4698776513003767,-0.27741089261022,0.11621186543741169,0.44595774822373024,-0.6000596866887571,-0.028698472786191916,-0.6259323274995721,-0.5090376238205158,-0.34100423684123626,-0.5365539034389545,0.3482180272183643,0.9815288003329535,-0.506788572422722,1.1004449656281163,-0.10439770067976284,0.40362858850838845,-0.4170295156898173,0.7096116360866976,0.40459321430889245
|
||||||
|
GLA_02-0025,HD13,0,-1.243347128296541,-0.6097587101011761,-0.266021181355027,-1.7025434570017213,-1.8367271410145674,-1.4932787680904613,-1.3201450525991523,-0.700229928927303,-1.1194793426526877,0.03314368458977475,-0.6140040698122224,-0.9491845379055294,0.03135708730715078,-0.622903166139059,-1.1403228596379325,-1.6819478705813558,-0.5788575086341874,-0.5390599079119138,-2.234737372461654,-0.663454121719428,-0.6011847467247197,-0.1880926195929319,-0.6228255774631842,-1.2842956630156417,-0.5135233415728663,-0.9988895560072,-1.1910999984241537,-0.6853189839823174,-0.5432594549945589,-1.0959299454949283,-0.5684541895573051,-1.3770816195365085,0.9300415422678344,-0.5099457170512296,-0.867249639965141,-1.2091206434086044,-0.7610425463420423,-1.3208220959514136,-1.5045234600913526,2.0199103536965723
|
||||||
|
GLA_02-0026,GC13,1,0.7512180657634696,-0.5218015293190893,0.4236710161738875,0.3288867579513822,-0.6373772221993065,0.35314869286263434,-0.09282017771024566,-0.9192010704309863,-1.5026778911253433,-0.2776210732020369,-1.3862414848736975,-0.9491845379055294,-1.3500547077691556,-1.2884221909317473,-0.18875972896747228,-0.7776267668502056,-1.432452313150482,-1.5587157554778535,-0.10891268683080127,0.14433308891715832,-1.3289854645500718,-0.8503440274566663,-0.32731497062590137,-0.44173113679025766,-0.06796179679193262,-1.2406512959712623,-0.5506302399978762,-1.7522990566294236,-1.2717139791006666,-1.7336536785875192,-1.4035210288745168,-0.15761172716944302,1.6547958050754212,-1.3455754323666542,-1.6272485085911912,-0.5625008003357678,-0.6163338316222631,-1.6841250100583833,-0.3998169823304835,1.4698269552883028
|
||||||
|
GLA_02-0027,HD14,0,-0.46598113040907496,-1.6975547243729927,-1.0934250036740272,-1.2909445954160785,-0.5028907123219312,-1.3089763203708613,-1.8027560784947065,-0.48347220942250857,-0.02673452775084557,-0.9814339999924219,-0.08429060964446441,1.579087634628402,-0.16504291144317582,-0.29561579335980864,-0.07599885179814983,-0.8177976001677245,-0.31313928331815943,-0.1720426319655931,0.08859460873885107,-0.14273759569369454,-0.0785760083310988,-1.8566090649726137,0.7878535141997958,-0.1721177223068019,-0.06796179679193262,-0.26620636342738635,-0.11428676093752554,-0.4620053503933424,-0.2216832478762016,-0.6152679092318761,-0.030636462785381197,-0.31336497870194857,-0.9460282686128229,0.019893129962228515,0.028836281473914427,0.09606196070553309,-0.6628237064133133,-1.1856855134355664,-0.9948803641027245,-0.4861927767302111
|
||||||
|
GLA_02-0028,GC14,1,-1.5046542208654317,0.37332947968758695,0.261582721027003,0.2962560552131855,-0.13689854766454324,-0.025041699405784285,0.4345137947460142,-0.6179128664035848,0.014409843958889373,0.7911561944513701,-0.4154433065313171,-0.2892787341764529,-0.27515952412967226,-0.37503011114786916,-0.4317330274801305,0.7518641717395149,-0.2577268860417296,-0.25085478530544447,-1.447911569482772,-0.8549497970968124,0.12291836929818065,-0.4698776513003767,-0.18485373567466365,-0.6191087818280133,0.04877717405045232,0.14338925779502143,0.18984389033316937,-0.2730674120763367,-0.16855787017135745,-0.3210477366393006,-0.21545617302784836,-0.5943580967235023,1.8373575613244972,-0.2037777376923668,-0.39977135000278874,-0.4396479057292209,0.5364135575174922,1.4662526235089757,-0.18231912731888722,-0.6213752071644593
|
||||||
|
GLA_02-0029,HD15,0,0.5199692144152579,-0.14107555275683592,-0.4361509291649099,0.17496504456466822,0.9144837834704801,-0.41699532362966957,-0.269266507326344,1.9234806894589356,0.7657407627969374,-1.2203829074575645,1.9994424158605777,0.1044891786732752,1.698452372107971,1.706091198995043,1.2973966152192582,0.7193948249711831,1.4639531303505215,1.9506036753181684,1.1736006286809177,0.9696612292663485,1.770485354003109,1.2011181011652197,0.9020112500886011,1.0589517442186733,0.7777947771274766,1.8725829134174483,1.7675814121653037,1.4507506876007759,1.803737486327926,1.9325750621732032,1.7734220219953398,1.4728952983862427,1.844039833745679,1.7441109877504852,1.5114219915819727,1.0449589007472935,-0.04421916775788044,1.827639423650954,0.5408182159264456,0.8579530742156494
|
||||||
|
GLA_02-0030,GC15,1,-0.1261809533964279,0.9275994073371407,1.0792208516956157,0.8428554498081914,0.08086097914728763,1.3252603859293541,0.7993475312252929,-0.1986161540069594,-0.05495867029954364,1.1194325913787628,-0.17356596461773338,-0.21438077958082666,-0.17345032812646075,-0.10060176771134327,0.3462252028568739,1.3121507630446925,-0.3357696521234797,-0.20676649600475158,0.2866728728375546,0.18141316388792367,-0.2810761513510592,0.15147474504955444,0.07973505704996164,0.678989513640724,0.6116023854712218,-0.08988443374674418,-0.11428676093752554,-0.3650139194289666,-0.39407293542003996,0.061836208007844916,-0.27063365406025786,0.8816587998051937,1.790488239461156,-0.20308133782721077,-0.801382378165444,0.19049210261071226,2.2368289998423507,-0.7487947189310671,2.3002215702708857,-0.3676141798572302
|
||||||
|
GLA_02-0031,HD16,0,-0.8599660630370055,0.37332947968758695,0.21743085177940483,0.021023534607523015,-0.19438640896761453,0.15566455478357288,-0.6881572939856614,0.4886887629902458,0.005188178471202952,0.4935134255224782,0.8258137910513154,1.52958188044093,0.7693553401136618,0.6213224038981409,0.23314524670189735,-0.6253508334026147,0.635058190906828,1.0069187605585024,-0.2668078924946147,-0.18822116503668035,0.8124218016330242,0.9550849606651493,1.692892984832148,-0.2236984795220254,0.13120899418679768,0.7531751792778367,2.42812676352858,1.037482635085527,0.818815486177138,1.0967415028384007,0.8920371879081962,-0.20855531614089798,-0.3894900081068787,0.8561010149594054,1.1173466874956868,1.7830262036549036,0.6647198858175639,0.14086215317823567,-0.3998169823304835,-0.5858151420724829
|
||||||
|
GLA_02-0032,GC16,1,-0.1261809533964279,0.46707545924824756,0.3042039810112527,0.5357951513806428,0.7211210490118753,-0.0931399283385384,0.13856283104764291,-1.0989120485476902,-0.6273560349985636,1.34443906512661,-1.1882981210987194,0.14272039443983964,-1.1516529182636275,-1.252291227080373,0.19420275030677658,-0.17676570645337186,-1.0250024614576778,-1.079633562730632,1.3881862341622222,-0.14273759569369454,-1.1161408032621112,-0.6445634037053044,1.2830466525280817,0.07048396767263895,0.40150749742933856,-0.9683965841022011,-0.6923079116984099,-1.2028504492586038,-1.2356710957498818,-1.0088932525625158,-1.0291012221644298,0.47148478228020535,0.013906382467400804,-1.1243879882815293,-1.1580604992424104,-0.322706751324,0.1597113437078385,-1.360473769352476,0.33793552306156244,-0.16855640597634336
|
||||||
|
GLA_02-0033,HD17,0,-1.3275117711947564,-1.1328513210042335,-2.1241813705332078,-1.5912144786342457,-0.9289881496989316,-0.7329088093186927,0.9589373345061143,-0.9979998789976604,-0.9611357888487634,-1.0184642807152646,-0.331179348223694,-0.38594253691196984,-0.4689084768100027,-0.7913064145889886,-0.38111633947868573,-1.1268770587261567,-0.3589714137679564,-0.7196773865265942,-1.1288671787876465,-0.7888852954704842,-0.5640654010266616,-1.7826363500673568,-1.4931414788009179,-1.017844184739743,-1.2098972150108882,-0.5252698552442304,-0.8959271416207768,-0.7749921408034566,-0.6076953538532842,-0.9633342246035553,-0.41048269846942814,-0.715352178943439,1.7543478776516075,-0.4040767018161726,1.3660998057160563,0.19049210261071226,-0.16298839345214072,1.192254281556578,-1.596583714656277,-1.14851807936016
|
||||||
|
GLA_02-0034,GC17,1,0.7512180657634696,1.2700530506263426,1.2244940341633144,0.9595695781717004,0.8770313739570519,1.4413369070037392,0.6920651327796619,1.0626720139720642,0.7716554066048248,1.1257513277849347,1.188030851003397,0.4562120631432236,1.161262070173118,1.131827683589581,0.9571186674910158,1.3561417755593306,1.0157586230423672,1.0729433063564353,1.3786578496098127,0.8250088422601132,1.2152620645361683,0.6519698343434239,0.9635618153423643,0.8847815294039896,1.2314305591282817,1.2267799956741052,0.46451834457227525,0.9266633197398592,1.0921022069742083,1.120357697714928,1.1601705608468393,0.9837581698537504,-0.1116047922716173,1.183144638903194,1.4849648514560592,1.412183102855638,0.9396563149071955,0.7185689785502626,1.7052259719072134,-0.08389936794693759
|
||||||
|
GLA_02-0035,HD18,0,1.1551891187702465,-0.4382392829641482,-0.4361509291649099,-0.32379579678588893,0.9876795661224924,-0.6188890545809432,-0.8514263976814501,0.9665864020226121,0.26905010162860055,-1.4055651556349185,1.1151439890686115,-0.19085246855200166,1.0950176073938107,1.0698796078099648,1.4950504418704393,-1.1755853312702755,0.9543749151763996,1.1443375806920557,0.7291403641494275,1.1648717086473521,1.2738733843800458,-1.9340883443970107,0.18616325156261282,1.2495298141333904,1.0599398250627616,1.1557813991518233,0.18984389033316937,0.9335723506729606,1.186906496857847,1.0539095463011083,1.1144216696594496,1.500799501562157,-0.23072568027972581,1.1413439406789974,0.9131060534815687,0.9782373814595192,-1.0427363767445401,1.2099596874957181,-0.6009064087628614,-0.08389936794693759
|
||||||
|
GLA_02-0036,GC18,1,-1.6949405450077124,-0.07466323693315602,-0.6275418199065357,-0.9539229932757979,-0.6373772221993065,-1.4932787680904613,-0.4719476113394781,-1.030825201263503,-0.8978093671174708,1.0588508221820376,-0.3026612303295373,-1.315849430489139,-0.32323915701926703,-0.8239163813751288,-1.6743243528156635,0.617800794595792,-0.49060241792948744,-0.7196773865265942,-0.6777100003924587,-1.3947328825887044,-0.6434605845606772,-1.1909741224794905,-0.32731497062590137,-0.877605180984305,-0.9989060104616736,-0.4313615096152958,-0.7698552859624502,-0.45715562107919755,-0.32515320702020256,-1.0400011326430763,-0.27845624999195656,-1.4980081588307963,-1.3805545756106254,-0.1845198781599856,0.03837475262341484,-1.1280294391614734,-1.6467755170541765,-0.7644205477010919,-0.9610372897408649,-1.3721340366380137
|
||||||
|
GLA_02-0037,HD19,0,-2.3672695908285277,-1.3940213631312095,0.4970123702869271,-1.245225540328053,-1.8367271410145674,-1.0665209157815445,-2.205543008398773,-1.2077597550394537,0.15793821561627425,-0.012287655859115218,-0.6817340285474606,-1.4688237836019444,-0.783559058678592,-0.973472019858726,-1.4311937686380862,-1.0331376585258722,-1.1415117674721662,-1.1392838773680563,-1.0500775491474332,-1.8928420185037065,-0.7938641173334571,0.2060487938148412,-1.24110536677028,-1.7712838394182633,-2.4412149259977025,-1.095952962291323,-1.6362800209512454,-1.0423454596321202,-0.7810536708599538,-1.4586342502968155,-0.7076105232962243,-2.147031030583348,0.013906382467400804,-0.6816209834537038,-1.1050151400881136,-1.2930744752113825,-1.5574684300403028,-1.2921612952864803,-0.44760534645814093,1.8545090347573838
|
||||||
|
GLA_02-0038,GC19,1,0.4376155679100238,0.37332947968758695,0.9286948268745908,1.6488861194603364,0.800332859856034,1.856926729618737,1.5018120406628783,0.25488264016394124,-0.7601173903690736,1.2762111976955541,-0.24422365251768582,-0.2635580703844288,-0.2710233101870866,-0.2565309994468004,-0.23541011772259102,2.432309263145311,-0.4266599137168707,-0.002244494132299685,0.6155119184221989,1.980217290774648,-0.2041117475049885,0.37231584926208117,-0.10076273342264126,-0.07213823646390208,-0.552865526309935,0.34195049748164286,0.12257455421129206,0.0688184562164385,-0.33728201018898635,0.44988500812896337,-0.34770453582216254,0.21919971431286994,-0.536089924394853,-0.26699961759778096,-0.7626952481380429,-0.10439770067976284,0.9927022853503591,-0.2129594491994856,1.6406664722728301,-0.6964565397152715
|
||||||
|
GLA_02-0039,HD20,0,-1.0829486070893226,-0.2828461181917133,-0.266021181355027,0.0004828554070358009,-2.3041139445173093,-0.41699532362966957,0.4506335429052696,-1.4548729391456166,0.9912523489776549,-0.2980136767540262,-1.20027977802747,-0.8034400074229127,-1.1812533544098982,-0.9388231323550364,-2.3550200205438463,0.7836793508169135,-1.4169247619496699,-1.3817167487894724,-1.1832170135833056,-2.464384974839268,-1.211315848636866,-0.16780951113342224,-2.5496879225158526,-1.8710617096341342,-2.171066759246284,-1.2536259074810072,-1.2470532414884028,-0.6914605318964875,-1.1639094942015984,-1.0959299454949283,-1.1731397671944261,-1.7123645995418504,0.6608688607790562,-1.1523591208652686,-0.6200140896225562,-1.7643935214445043,0.11238443276732263,-0.6937417360987554,-0.012573269281295344,-2.4194563612927005
|
||||||
|
GLA_02-0040,GC20,1,1.7515716229642004,-3.0465169149406215,-0.7110135596806529,-0.8069294112696193,2.5697964024636426,0.6475274561670843,-0.7676687753363817,-1.9328431135131003,0.20729853439859802,-1.9982421109718478,-1.031326659489292,-1.4688237836019444,-1.1701335116329246,-1.7012147088701066,2.121438507587676,-2.1123942635974062,-1.565784920881638,-1.8618706498776112,-1.9404034756039539,1.4462645738333013,-1.4716719013043285,-1.1909741224794905,1.3384074216604411,2.317104665439634,0.8946435855632612,-1.568773314301495,-3.1953511953095206,-1.5938747749813755,-1.4920540477194353,-1.8320414837808883,-1.2789035596115002,2.1651828581797985,1.574636675076785,-1.2407720802144668,-1.1855820897296494,-1.4704647970843507,-2.591491190805267,-1.3111692957106786,-2.523440675284451,-0.3401797288771638
|
||||||
|
GLA_02-0041,HD21,0,0.5199692144152579,0.32410401273329337,0.02364907656915124,-0.04154251982303697,0.28127508298013165,-0.12888872297595116,0.2682185732104478,0.9628850019321453,0.47452289082281096,-0.5011062973455879,1.1561430317929284,1.987470057773364,1.1376877826945646,1.071562730974822,0.5571322302032111,0.22382896413943534,0.9773595902073374,1.1009239661113719,0.4192853504642605,0.35447499154445233,1.1158159148592268,-0.417300334856881,-0.32731497062590137,0.29090771136998855,0.7951068375160608,1.2051482293699745,0.20590058651179852,0.9004631431039346,1.1469684211544147,1.0670908952765983,1.1962550362583486,0.17481906377649245,1.1014220041212088,1.1854480462840375,0.6747200494795682,0.09606196070553309,0.010618682803013499,0.19086374315147323,0.7186642662198495,-0.4250439899176554
|
||||||
|
GLA_02-0042,GC21,1,0.4376155679100238,0.27318288197579516,0.4236710161738875,0.5626259544871942,-0.6373772221993065,1.8493332381788996,2.698755255707267,0.16210681634338064,2.6196310197084114,0.5188122027386375,0.5478845833281183,1.4653685370083913,0.3859534620313639,0.43378387877359315,-0.38111633947868573,-0.015206708788977247,0.38505943461827663,0.2433655074845253,-1.0500775491474332,0.027532850420686705,0.3496039819870821,-0.10940356884094689,-0.7687640225588419,-0.276399924464793,-0.2597005344545521,0.6549814064279991,-0.4242401758480185,0.2149768106515084,0.39728987134722593,0.08466798842316334,0.5262283315767161,-0.3673084103286406,1.273605932841584,0.49178224511884694,0.004648919271581272,-0.8286719196889907,-0.16298839345214072,1.1241729314432478,0.10541085301949493,1.3652768073067998
|
||||||
|
GLA_02-0043,HD22,0,1.36215674964206,1.8239539180061284,2.5388437926248315,0.6270965545567145,1.2917726281142086,1.2067063129145912,1.3665458905577537,0.6891632525056033,-1.6747773512403412,0.7263757906864305,-1.4789022097136864,1.5068954851204979,-1.9952901169627713,-1.6095423011146783,1.472679313747626,1.5297855222223522,-0.7484147576061606,-0.5746696165030172,0.4608493199359234,0.9048491441514257,-1.0011362472292211,0.5346762334508579,0.5050784982192187,1.3325585520657235,1.2314305591282817,-0.7557642619833524,0.7274814610026625,-0.02644553844348113,-1.703708821730039,-0.012895616524017555,-1.8635341976683664,1.636294856214113,0.24002277303590416,-1.928782672847019,0.5934187507237251,2.2138525581820634,1.398972197936908,-1.4452577228467025,1.1036896781118668,-0.3401797288771638
|
||||||
|
GLA_02-0044,GC22,1,0.8937281328887505,0.9275994073371407,1.017746059525529,1.2166816763296446,0.8770313739570519,0.47659309362440433,0.36751709734547144,1.1773231047268964,1.894742453408152,0.28893205351436446,1.222029671701279,0.9556549079001485,1.2060541107920006,1.3800276834742784,1.2232806134008924,0.617800794595792,0.9243689331745659,1.2048692920033008,0.7374819630972895,1.000903641965812,1.0872889518074829,1.4067733777492046,0.11160538273133344,0.9496045148010781,0.7602648182666649,1.1480161065801113,0.531535378597154,0.8140104370967581,1.2085498757398108,1.2986825592344162,1.2677604275466534,1.2083695135220907,1.3665841658194056,1.293133139065911,0.9698414202997362,0.9097063473752824,1.708808665325347,0.304109753345416,0.07283473313866418,0.3277166221993385
|
||||||
|
GLA_02-0045,HD23,0,0.560105242714116,-0.21039226897561197,-0.3317634072842041,-0.175765283129113,0.7211210490118753,2.151787994821404,-0.3285616093849758,1.355260292550223,0.5359672937427571,-0.40620896063877054,1.20179952282258,0.775002693145066,1.3350396655671355,1.2826168579350923,1.1852915067266983,-1.0794137272330726,1.1139132295171759,1.301001611957011,0.08859460873885107,0.5673183410223085,1.3722292006179544,2.0753773944352876,0.012052011830022476,0.8847815294039896,1.4861135260573484,1.2904795954181627,0.4164218211375259,1.0383435715812497,1.3277918284853025,1.5626445093941863,1.3449613532445173,1.0334368286983198,-0.1960856179321398,1.3834155721026975,1.3660998057160563,0.729752720127972,0.08786685076120955,0.2550527276580175,-0.14265965942750267,1.7263487276024305
|
||||||
|
GLA_02-0046,GC23,1,0.26390228364577784,0.05026222610752633,0.4236710161738875,0.22835536044088886,0.46675141836634826,-0.16584910275474768,0.5714070318821254,0.9702771173231515,0.31860272823149866,-0.6599562497741419,1.056276752600254,-0.3431830857992619,1.0385607464366484,1.0239524326184506,0.3827323249798125,0.47146346796981675,0.8556528203945386,1.08794999035078,-0.5167251665374158,0.25301003975721237,1.0226495056507101,-0.3671928183456217,0.17180134421978446,0.16108851973328195,0.40150749742933856,1.2020131900757252,0.04996751906624367,0.9691245590086225,1.1139628279521492,0.9476392510205054,1.1704963973674019,0.5894973555159195,-0.536089924394853,1.2276900824631072,0.9406581969051145,0.09606196070553309,0.24810242736078084,0.11469232353285388,0.5077685181222216,1.6445564068352039
|
||||||
|
GLA_02-0047,HD24,0,-0.7216031003080254,0.16581886941762303,0.46092972891434936,-0.1295964012824051,-1.4366368356194654,-0.7937039255879613,0.039741986560203224,-0.44506974171599145,1.6610895918256143,-0.23798175107309036,-0.2941959607282676,-0.371455348142685,0.4261285437794831,-0.6800821849017455,-1.1748515832030841,1.231914057041089,-0.5368500557111429,-0.40255433398543683,1.6892972064086322,-1.307976781353767,-0.32457889968080333,-0.10940356884094689,-1.24110536677028,-1.4938992969707605,-0.9494204428219399,-0.40771659136922545,-0.028698472786191916,0.7609759319262946,-0.21768404647978645,0.054146004953257776,-0.3146212610469653,-1.1142341982766468,0.5252115848214524,-0.31841801061519814,2.1494154592025736,0.36918806329194226,-0.6628237064133133,-1.0283235202685108,0.7276286821589106,-0.25020893122693805
|
||||||
|
GLA_02-0048,GC24,1,0.6766080659700437,0.27318288197579516,0.46092972891434936,0.1930070355178175,1.0934343198935665,0.5495861890333105,0.29618098843361607,1.6919874990551138,0.5987363863005848,0.09047839104775345,1.4551079653483334,-0.2892787341764529,1.4553390644103434,1.666362293188586,1.272960410652211,0.4327094977602216,1.382896081141639,1.4333156882982774,0.03469191919954844,0.6761762971098446,1.6090699132068744,0.030545018479662258,0.17180134421978446,0.8181411219749727,1.07398333208645,1.564744527434963,0.12257455421129206,1.3772719815668317,1.6754953570413882,1.5314699661469404,1.4928811873965198,1.299356572968808,-0.34637903885785537,1.573814784763989,1.3862821226070856,0.28144941463658707,0.4387342433996907,0.5138259419173667,0.1981557876248922,-0.12516155775404036
|
||||||
|
GLA_02-0049,HD25,0,0.560105242714116,0.22045985255696643,-0.9896812734011824,-0.842503991780491,1.0234547286868367,0.7201793080175072,-1.0332138851324102,-0.6552882156084894,1.6575034906944983,0.09047839104775345,-0.4698013009315257,-0.05281470678571324,-0.6554974626230655,-0.8239163813751288,1.2106882705036166,-0.7776267668502056,2.4768271006179834,-0.33788904795734265,-1.0759868214687502,0.04760721263565867,-0.7739498847432605,1.90386332776225,1.0996081018452022,0.5877084928944571,0.3085305467677316,-0.9338902834888331,-0.48569522614640254,-0.41922041533333854,-0.5259777827136648,-1.047873080404195,-0.527583464310953,0.17481906377649245,-1.0061656272267938,-0.5422916441536503,-0.7025388179530093,-0.5002969755081552,0.4213522379507559,-0.11407940728226644,0.5622633974998078,-0.016328058704419533
|
||||||
|
GLA_02-0050,GC25,1,-1.6949405450077124,-0.5218015293190893,0.4970123702869271,0.1930070355178175,0.08086097914728763,-0.6188890545809432,0.0282527608663072,-0.9659374946025318,-1.443221242207417,1.9236539876864571,-0.9754339156689057,-0.4621584163924482,-0.6830206426970957,-0.9687932713045196,-0.81952699093191,-0.48506108948818394,-0.8011372465807156,-1.0585872018842717,-0.049877613969400894,-0.7250965481246565,-0.7245728738288001,-0.002481667146382562,1.7701959094136952,-0.877605180984305,-1.4446942896961903,-0.6731030209836625,-0.5506302399978762,-0.9829149192603456,-0.8759216924827835,-0.9190375382297259,-0.7680113707809397,-0.10759431784215787,-0.7391360188888579,-0.8115878694929087,-1.1996081340050153,-1.1280294391614734,0.40362858850838845,-1.7585302598340546,-0.2652979981819427,-1.60105241783853
|
||||||
|
GLA_02-0051,HD26,0,-0.1796485557940177,0.5551111654049726,-0.29852532417263866,0.4219245788493127,0.02815333891078876,0.25975459219072217,0.1594652522755021,0.9271770308607683,0.18531740646188963,0.7741148048780528,0.7580035689919714,-0.10307533136685838,0.707433884281621,0.8670508152613808,0.1546019087965667,0.9337401885961847,0.6367149084943966,0.847767499903056,1.4658261422962733,0.32140439743860466,1.041522051144919,-0.25158405772247266,0.1571729494831636,0.2697519311619069,-0.09846311885250371,0.8234336769149866,0.08698037007172763,0.8431397152716454,0.6388193300126325,1.0252204727218361,0.8415479888017754,-0.20855531614089798,1.5993168092824308,0.7437171776365381,0.3574910713632597,0.9782373814595192,-0.01644778510542401,-0.2722652130173367,0.8902260181268958,0.6360280469023475
|
||||||
|
GLA_02-0052,GC26,1,-0.590506967188477,-0.5218015293190893,-0.400547912982761,-1.1145373129154326,-2.060727174739533,-1.3089763203708613,-0.7274038886185776,-0.22591123520495915,-0.37588862546046203,-0.9814339999924219,1.5644465395376177,0.33547182569232314,0.3034034784216208,0.025161718206790674,-1.0068899054569147,-0.48506108948818394,0.4743469019092082,-0.08796646691635424,-0.8545804265117349,-0.3835630829366795,0.110965589761981,0.5919832787567457,-0.7687640225588419,-0.33027069784469193,0.2598634490274557,0.3792104510042434,-0.7698552859624502,-0.1749246438310977,0.23677095984805654,-0.510812167098342,0.32228064317278704,-0.4223330897797644,-1.1393695186346136,0.3894270937945709,-0.08676659840168104,0.09606196070553309,-0.5281096221387157,-0.8762314624759271,-1.0293962821388045,0.028681141827447548
|
||||||
|
GLA_02-0053,HD27,0,0.07669004289574279,1.110079118757727,0.38517503618942456,-0.4880953917399898,-0.13689854766454324,0.25975459219072217,0.7108077735168263,-0.8666096850744631,-1.4576669558271143,-0.45265748878163464,-1.1765020728938325,1.638533244237729,-0.9961971463870494,-0.4925137574759292,-0.4834444473047464,0.2677813300747199,-0.8974514320419141,-0.6112873194378992,-0.5360594263089761,1.5021554028298876,-0.48132128612851965,-0.4698776513003767,-0.9362633921077823,-0.44173113679025766,-1.1550793175996343,-1.1841042516468774,1.9721107456144191,-0.95045116162566,-0.8903875602613898,-0.2867435753491769,-1.0392778421178035,-0.6541866235323021,-0.7391360188888579,-1.0344565363684413,-1.4178454813393264,0.6540004215826872,0.010618682803013499,-1.3016163570344563,0.18319373997535957,-1.2394370087625444
|
||||||
|
GLA_02-0054,GC27,1,1.2757048596014828,-0.21039226897561197,0.17166045293859225,1.5318585169924672,0.6392381541215421,0.43744399060968686,1.3937513160288415,1.2939376851559965,0.41930766348209964,2.1368691733020064,1.1132762741167102,-0.02416907277164911,1.2506347123326054,1.2453939581058713,0.5232854240178646,0.9048599051660546,1.2254226679430134,1.1896039833259964,0.669188039848516,0.5096064027956847,1.2755789570055227,1.8868609069741245,1.4537754568399175,0.3737154961150679,0.3085305467677316,1.1946535109375713,0.6125573155660222,0.8733740445936302,1.09578192546399,1.2473393357577633,1.299039841729422,0.7756673704136077,1.4327674900757925,1.2502331941537694,1.0659522511903106,1.0449589007472935,0.06274971359860493,0.5044057299339352,0.5299211837985601,-0.31354415736491487
|
||||||
|
GLA_02-0055,HD28,0,-1.6949405450077124,-0.702537386518218,-2.6160571348885644,-2.2197774468650264,-1.62942284163079,-1.8122869533371007,-1.4371964600580391,-0.5519511269410029,0.3114785263785977,-1.5613351645390676,0.008931337093388465,-1.9563279797197666,-0.014081740751252958,-0.25397046868103934,-1.5096150356354563,-1.9582430204558345,-0.20328976018823433,-0.27920931413694916,-1.4795567464808688,-1.307976781353767,-0.11846678186926933,-0.7092866074622012,-0.5249573105437517,-1.1665612765518547,-1.7080934037402482,-0.2919174532815509,-0.07056686510426899,-0.4620053503933424,-0.14011651675268147,-0.4395414939375159,0.040718420020116344,-1.2613095115788637,-1.6936024721133565,0.05651662003332205,-0.1547012106977008,-2.4940562979173575,-2.591491190805267,-0.4134960573787364,-2.0121665894207283,1.4264640148536882
|
||||||
|
GLA_02-0056,GC28,1,0.9618768162110931,0.7904377538444992,0.5658743084429582,0.8832420124050829,0.28127508298013165,0.25975459219072217,1.184169217150501,1.0557975763583096,1.0697564992908148,1.0065266049025232,1.061054864561634,0.7623670322204071,1.007205566247937,1.2952362653939362,0.7811109812026608,1.1220595770170216,0.7886559331205922,1.1027656334626332,0.1148450991618686,0.7771695915667832,1.0286907612671157,0.030545018479662258,0.11160538273133344,0.851694708974259,0.2598634490274557,1.2587310867404407,2.2422151397390198,1.0477518547351057,1.031785283323502,1.0764274345759646,1.1964850980633865,0.8467754971765854,0.07559764372861631,1.1367872457358572,0.7337122364241971,-0.322706751324,0.06274971359860493,1.7073771198636762,0.438292811956535,0.3727242522443907
|
||||||
|
GLA_02-0057,HD29,0,-0.5274624027801623,-2.0573709334455725,-1.4449224824719635,-2.0107497209634073,-0.4381684293524799,-0.7937039255879613,-1.6616588389238645,0.9554499051053501,0.657041551189222,-1.8611525317981155,1.1023097894649616,-0.5453766590593818,1.0908097179555905,0.8902785836470176,0.27145012156097,-0.7776267668502056,0.8619262650487881,1.182754133857147,-0.6156079381264394,-0.05537311288216067,1.1650045601138181,-1.579392412403888,-1.079410732090638,-0.4133837231212322,-0.719083229692369,1.0230255258713816,1.1457895346530351,0.8797072513800346,1.1238112560372164,0.9679603081202234,1.1640768083618518,-0.20855531614089798,-0.7391360188888579,1.1075381154667994,0.8027705553768306,-0.8286719196889907,-0.16298839345214072,-0.04707843975859108,-0.683702277742871,-0.5514756286723751
|
||||||
|
GLA_02-0058,GC29,1,0.6766080659700437,0.27318288197579516,0.3042039810112527,0.2962560552131855,0.08086097914728763,-0.24366563974217237,0.41814837982691927,0.5716245606328533,0.03924076930523174,-0.23798175107309036,0.8813470452609546,-0.3431830857992619,0.9398544989083025,0.9226280501397488,-0.010836256529546163,-0.35511952581153433,0.7579188576192019,0.9068752636896564,1.032216749369271,0.21762760885747984,0.9510605559071331,-0.2736805002600986,0.04657954075203109,0.07048396767263895,0.04877717405045232,0.8878461393617016,0.2523832559804415,1.4868162781825864,0.7889100592323406,0.7591097551295407,0.9136858781013606,-0.058469558417049775,-1.0061656272267938,0.8496104957609291,0.40041116372556085,-0.10439770067976284,0.010618682803013499,0.026687554923344056,-0.30873366580275663,-0.5182890179277823
|
||||||
|
GLA_02-0059,HD30,0,-0.23430959174119342,-1.6975547243729927,-1.3816551731546647,-0.842503991780491,-0.4381684293524799,-0.2040851596041294,-1.1577851731742392,1.5902658062188963,0.47777204312043287,-0.7179883085342994,1.401901547848754,-0.16798713955486919,1.4266906755908475,1.5124173168029473,0.6718403609269863,-0.5892247555949072,1.2722496608259997,1.4612671061214506,-0.9992826360424722,0.5096064027956847,1.5582949501191117,-0.7092866074622012,-0.6933909157679454,0.6246406153035265,0.1041924564522517,1.5134151281099857,0.26734127069207203,1.1824392810933793,1.4414834989576149,1.619120945835128,1.4485329006279244,0.5311193087767917,-0.8896024846315773,1.4618347091906685,1.0782333581157566,-0.8286719196889907,-0.8129900541426701,0.35753270761267736,-0.30873366580275663,1.3931699995212232
|
||||||
|
GLA_02-0060,GC30,1,0.823548219425645,1.1656529178554447,1.6460076223464033,0.8428554498081914,0.6392381541215421,0.8570987220809919,0.25874320530494177,0.31124539487846764,-0.07008512856530705,-0.3188042736523046,0.5861140417150958,-0.400672395581368,0.659366160591133,0.7206943542055513,-0.28299488250277116,-0.015206708788977247,0.5439243639005383,0.8511933921981084,-0.021172619224429885,0.10635182305066915,0.6446484813288347,1.3039772393903968,0.4576693490014662,-0.07213823646390208,0.1041924564522517,0.7258013131967627,-0.028698472786191916,0.3442604327592226,0.5819646376541093,0.6260167821541491,0.6565360805832392,0.037227274221001916,-0.21898257189563278,0.6428876781998117,0.07116869368375706,1.6305956325816826,0.651407201562577,0.48523186435247434,0.3113318233952894,-0.12516155775404036
|
||||||
|
Executable
+61
File diff suppressed because one or more lines are too long
Executable
+32
@@ -0,0 +1,32 @@
|
|||||||
|
This assignment consists of a small project. The task is to classify data. What you need is a dataset that is suitable for classification. You can use your own dataset (from your studies, interests, hobbies, etc.) or a publicly available dataset, e.g. form scikit-learn.org, uci Links to an external site. or Kaggle Links to an external site..
|
||||||
|
In the first part of the assignment you will explore and describe the dataset and build a decision tree classifier and analyze its performance. In the second part of the assignment you will build an MLP classifier for the same task, analyze its performance and compare the performances and other pros and cons of the decision tree classifier and the MLP classifier.
|
||||||
|
Part 1: Exploratory Data Analysis and Decision Tree Classifier
|
||||||
|
|
||||||
|
Find the right dataset for your task
|
||||||
|
Identify and motivate your objective
|
||||||
|
Do an exploratory data analysis with jupyter notebook and report your findings.
|
||||||
|
Motivate why the data in the dataset is the right data for your task (classification task)
|
||||||
|
Iteratively find the best decision tree classifier for the task.
|
||||||
|
Steps to consider include but are not limited to
|
||||||
|
Restricting the depth of the tree using different options to ovoid overfitting and underfitting
|
||||||
|
Preprocessing the data in different ways
|
||||||
|
|
||||||
|
Always motivate what you do, why and how.
|
||||||
|
|
||||||
|
Present your best decision tree model and motivate why you think this is the best model for your task and show and describe how you evaluated this.
|
||||||
|
Your report in Jupyter notebook should report your step by step investigation of the problem and the iterative development of the decision tree classifier and its evaluation.
|
||||||
|
|
||||||
|
Part 2: MPL Classifier and comparison of Decision Tree and MLP classifier
|
||||||
|
|
||||||
|
Iteratively find the best MLP classifier for the task
|
||||||
|
Steps to consider include, but are not limited to
|
||||||
|
Data preprocessing
|
||||||
|
MLP hyperparameter tuning
|
||||||
|
|
||||||
|
Compare the performance of the Decision Tree Classifier from part 1 with the performance of the MLP classifier from part 2.
|
||||||
|
Investigate
|
||||||
|
The performance of the model
|
||||||
|
The difficulty of building the model
|
||||||
|
The transparency of the model
|
||||||
|
|
||||||
|
You need to hand in your notebook as an HTML. To create HTML file, you go to File/Save and export notebook as… and choose HTML. Check the created HTML before you upload it on CANVAS
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
.archive/
|
||||||
|
plots/
|
||||||
|
reports/
|
||||||
|
to_do/
|
||||||
|
data/
|
||||||
|
.Rproj.user
|
||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
import pandas as pd
|
||||||
|
antigen_list = pd.read_excel("data/02a.AP0211_GLA02_SBA01_Antigen_list.xlsx")
|
||||||
|
gene_names = antigen_list["Gene name"].tolist()
|
||||||
|
#remove nans
|
||||||
|
gene_names = [gene for gene in gene_names if pd.notna(gene)]
|
||||||
|
gene_names_split = [gene.split(",") for gene in gene_names]
|
||||||
|
gene_names = [gene for sublist in gene_names_split for gene in sublist]
|
||||||
|
len(set(gene_names))
|
||||||
+118
@@ -0,0 +1,118 @@
|
|||||||
|
#fill out useful info
|
||||||
|
fill_analyte_info <- function(df, antigens=I00_Antigens){
|
||||||
|
lookup_df <- bind_rows(antigens)[-1]
|
||||||
|
# Remove duplicates from lookup_df based on Antigen.name
|
||||||
|
lookup_df <- lookup_df %>%
|
||||||
|
distinct(Antigen.name, .keep_all = TRUE)
|
||||||
|
# Create a new column with the row names in main_df
|
||||||
|
main_df <- df %>%
|
||||||
|
rownames_to_column(var = "RowName")
|
||||||
|
# Check if most RowName values are not found in Antigen.name
|
||||||
|
rowname_matches <- main_df$RowName %in% lookup_df$Antigen.name
|
||||||
|
proportion_matches <- sum(rowname_matches) / length(main_df$RowName)
|
||||||
|
|
||||||
|
if (proportion_matches < 0.5) {
|
||||||
|
warning("Most RowName values are not found in Antigen.name")
|
||||||
|
} else {
|
||||||
|
message("Most RowName values are found in Antigen.name")
|
||||||
|
}
|
||||||
|
# Merge the main dataframe with the lookup dataframe based on the Antigen.name column
|
||||||
|
result_df <- main_df %>%
|
||||||
|
left_join(lookup_df, by = c("RowName" = "Antigen.name"))
|
||||||
|
return(result_df)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to subset the dataframe based on the lowest (n) values
|
||||||
|
subset_top_n <- function(df, n) {
|
||||||
|
if ("Q.Value" %in% colnames(df)) {
|
||||||
|
subset_df <- df %>% top_n(-n, Q.Value)
|
||||||
|
} else if ("adj.P.Val" %in% colnames(df)) {
|
||||||
|
subset_df <- df %>% top_n(-n, adj.P.Val)
|
||||||
|
} else {
|
||||||
|
return(df)
|
||||||
|
}
|
||||||
|
#subset_df <- rownames_to_column(subset_df, var = "RowName")
|
||||||
|
return(subset_df)
|
||||||
|
}
|
||||||
|
|
||||||
|
excel_subset_export <- function(dflist, n=15){
|
||||||
|
# Apply the function to the dflist
|
||||||
|
subsetted_dflist <- lapply(dflist, subset_top_n, n)
|
||||||
|
subsetted_dflist <- lapply(subsetted_dflist,fill_analyte_info)
|
||||||
|
# Get the name of the dflist
|
||||||
|
dflist_name <- deparse(substitute(dflist))
|
||||||
|
# Write the list of subsetted dataframes to an Excel file
|
||||||
|
excel_file_name <- paste0(dflist_name, "_Top_", n, ".xlsx")
|
||||||
|
# Create a new workbook
|
||||||
|
wb <- createWorkbook()
|
||||||
|
# Add worksheets for each subsetted dataframe and write data
|
||||||
|
for (i in seq_along(subsetted_dflist)) {
|
||||||
|
sheet_name <- names(dflist)[i]
|
||||||
|
addWorksheet(wb, sheet_name)
|
||||||
|
writeData(wb, sheet_name, subsetted_dflist[[i]])
|
||||||
|
}
|
||||||
|
|
||||||
|
# Save the workbook
|
||||||
|
saveWorkbook(wb, file = file.path("stats", excel_file_name), overwrite = TRUE)
|
||||||
|
}
|
||||||
|
|
||||||
|
#Final Modifications
|
||||||
|
full_analyte_info <- function(df, antigens=I00_Antigens){
|
||||||
|
lookup_df <- bind_rows(antigens)[-1]
|
||||||
|
# Remove duplicates from lookup_df based on Antigen.name
|
||||||
|
lookup_df <- lookup_df %>%
|
||||||
|
distinct(Antigen.name, .keep_all = TRUE)
|
||||||
|
# Create a new column with the row names in main_df
|
||||||
|
main_df <- df %>%
|
||||||
|
rownames_to_column(var = "RowName")
|
||||||
|
# Check if most RowName values are not found in Antigen.name
|
||||||
|
rowname_matches <- main_df$RowName %in% lookup_df$Antigen.name
|
||||||
|
proportion_matches <- sum(rowname_matches) / length(main_df$RowName)
|
||||||
|
|
||||||
|
if (proportion_matches < 0.5) {
|
||||||
|
warning("Most RowName values are not found in Antigen.name")
|
||||||
|
}
|
||||||
|
# else {
|
||||||
|
# message("Most RowName values are found in Antigen.name")
|
||||||
|
# }
|
||||||
|
# Merge the main dataframe with the lookup dataframe based on the Antigen.name column
|
||||||
|
result_df <- main_df %>%
|
||||||
|
left_join(lookup_df, by = c("RowName" = "Antigen.name"))
|
||||||
|
return(result_df)
|
||||||
|
}
|
||||||
|
|
||||||
|
excel_export <- function(dflist, name = deparse(substitute(dflist))) {
|
||||||
|
file_path <- file.path(getwd(), "reports", paste0(name, ".xlsx"))
|
||||||
|
|
||||||
|
# Create a new workbook
|
||||||
|
wb <- createWorkbook()
|
||||||
|
|
||||||
|
# Iterate through the list of dataframes and add worksheets
|
||||||
|
for (setid in seq_along(dflist)) {
|
||||||
|
sheet_name <- paste0("Dataset_", setid)
|
||||||
|
addWorksheet(wb, sheet_name)
|
||||||
|
writeData(wb, sheet_name, dflist[[setid]])
|
||||||
|
}
|
||||||
|
|
||||||
|
# Save the workbook
|
||||||
|
saveWorkbook(wb, file = file_path, overwrite = TRUE)
|
||||||
|
}
|
||||||
|
|
||||||
|
replace_antigen_names<- function(vector, antigens=I00_Antigens, replacement_col = "Gene.name"){
|
||||||
|
lookup_df <- bind_rows(antigens)[-1]
|
||||||
|
# Remove duplicates from lookup_df based on Antigen.name
|
||||||
|
lookup_df <- lookup_df %>%
|
||||||
|
distinct(Antigen.name, .keep_all = TRUE)
|
||||||
|
|
||||||
|
# Create a lookup dictionary with Antigen.name as the key and the specified column as the value
|
||||||
|
lookup_dict <- setNames(lookup_df[[replacement_col]], lookup_df$Antigen.name)
|
||||||
|
replaced_vector <- lookup_dict[vector]
|
||||||
|
return(replaced_vector)
|
||||||
|
}
|
||||||
|
|
||||||
|
untransform_subset <- function(restriction_df, df, subset_method = limma_subset, ...){
|
||||||
|
subset <- do.call(subset_method, c(list(restriction_df), list(...)))
|
||||||
|
df_subset <- df[,colnames(df) %in% colnames(subset)]
|
||||||
|
colnames(df_subset)[-1:-2]=replace_antigen_names(colnames(df_subset[-1:-2]))
|
||||||
|
return(df_subset)
|
||||||
|
}
|
||||||
+148
@@ -0,0 +1,148 @@
|
|||||||
|
#Takes a list of package names and automates the process of checking, installing, and loading them.
|
||||||
|
#Handles both CRAN and Bioconductor packages, ensuring that the necessary packages are available in the user's R environment.
|
||||||
|
load_dependencies <- function(pkg_list) {
|
||||||
|
# Load or install packages from list
|
||||||
|
for (pkg in pkg_list) {
|
||||||
|
if (substr(pkg, 1, 11) == "BiocManager") {
|
||||||
|
pkg = substr(pkg, 14, nchar(pkg))
|
||||||
|
if (!requireNamespace("BiocManager", quietly = TRUE)) {
|
||||||
|
install.packages("BiocManager")
|
||||||
|
}
|
||||||
|
if (!require(pkg, character.only = TRUE)) {
|
||||||
|
BiocManager::install(pkg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if (!require(pkg, character.only = TRUE)) {
|
||||||
|
install.packages(pkg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
library(pkg, character.only = TRUE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# This function checks the integrity of a set of dataset files in a specified directory, filtering them by keyword,
|
||||||
|
# and ensures that each Data Intensity file has a corresponding Antigen List file.
|
||||||
|
# If any files are found to be missing an Antigen List, the function returns a list of these files, otherwise it returns TRUE.
|
||||||
|
dataset_file_integrity_check <- function(keyword) {
|
||||||
|
# Get the list of files in the "sample_data" subdirectory
|
||||||
|
file_list <- list.files("data", pattern = "\\.xlsx", full.names = TRUE)
|
||||||
|
|
||||||
|
# Filter the file list to include only files containing the specified keyword
|
||||||
|
keyword_files <- grep(keyword, file_list, value = TRUE, ignore.case = TRUE)
|
||||||
|
|
||||||
|
# Replace any space or hyphen in each of the names in keyword files with an underscore
|
||||||
|
keyword_files <- gsub(" |-", "_", keyword_files)
|
||||||
|
|
||||||
|
# Remove characters in the file names up to one after the dataset keyword
|
||||||
|
keyword_files <- gsub(paste0(".*", keyword, "[ _-](.*)\\.xlsx$"), "\\1.xlsx", keyword_files)
|
||||||
|
|
||||||
|
# Find the non-dictionary tags present in the names of several files
|
||||||
|
non_dict_tags <- unique(gsub("(_Antigen_list.xlsx|_Data_Intensity.xlsx)", "", keyword_files))
|
||||||
|
|
||||||
|
# Identify Data Intensity files that don't have a corresponding Antigen List file
|
||||||
|
missing_antigen_list_files <- character()
|
||||||
|
for (tag in non_dict_tags) {
|
||||||
|
antigen_file <- paste0(tag, "_Antigen_list.xlsx")
|
||||||
|
intensity_file <- paste0(tag, "_Data_Intensity.xlsx")
|
||||||
|
if (intensity_file %in% keyword_files && !(antigen_file %in% keyword_files)) {
|
||||||
|
missing_antigen_list_files <- c(missing_antigen_list_files, intensity_file)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if the list of data files with no antigen file is empty
|
||||||
|
if (length(missing_antigen_list_files) == 0) {
|
||||||
|
return(TRUE)
|
||||||
|
} else {
|
||||||
|
#print(paste("Some files are missing antigen lists:", missing_antigen_list_files))
|
||||||
|
return(missing_antigen_list_files)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Function to filter out data frames with a given keyword in their name
|
||||||
|
# keyword: the keyword to search for in the data frame names
|
||||||
|
# e: the environment to search in (default is parent frame)
|
||||||
|
filterclean <- function(keyword, e = parent.frame()) {
|
||||||
|
|
||||||
|
# Get list of data frames in the specified environment
|
||||||
|
dflist = Filter(function(x) is (x, "data.frame"),
|
||||||
|
mget(ls(e),envir= e))
|
||||||
|
# print(dflist)
|
||||||
|
# Filter out data frames without the specified keyword
|
||||||
|
dflist = dflist[grepl(keyword,ls(dflist))]
|
||||||
|
# print(dflist)
|
||||||
|
# Return filtered list of data frames
|
||||||
|
return (dflist)
|
||||||
|
}
|
||||||
|
## This import function first brings all excel documents in the sample_data directory which include the dataset string and imports them as dataframes
|
||||||
|
# The dataframes are then grouped according to _Data and _Antigen keywords in the file naming convention (filterclean function)
|
||||||
|
import <- function(dataset){
|
||||||
|
## Import all libraries needed for downstream
|
||||||
|
pkg_list = c("rlang",
|
||||||
|
"gridExtra",
|
||||||
|
"ggplot2",
|
||||||
|
"ggfortify",
|
||||||
|
"MASS",
|
||||||
|
"BiocManager::lumi",
|
||||||
|
"BiocManager::limma",
|
||||||
|
"readxl",
|
||||||
|
"dplyr",
|
||||||
|
"broom",
|
||||||
|
"BiocManager::qvalue",
|
||||||
|
"openxlsx",
|
||||||
|
"tibble",
|
||||||
|
"pheatmap",
|
||||||
|
"pROC",
|
||||||
|
"tidyverse",
|
||||||
|
"msigdbr",
|
||||||
|
"BiocManager::clusterProfiler")
|
||||||
|
load_dependencies(pkg_list)
|
||||||
|
# set path to sample data directory
|
||||||
|
sample_data=paste(getwd(),"/data/", sep="")
|
||||||
|
# get names of all files with .xlsx extension in sample_data directory
|
||||||
|
names = list.files(path=sample_data, pattern = ".xlsx", recursive=TRUE)
|
||||||
|
|
||||||
|
# check if any required files are missing
|
||||||
|
no_missing_files <- dataset_file_integrity_check(dataset)
|
||||||
|
|
||||||
|
# if files are missing
|
||||||
|
if (no_missing_files != TRUE) {
|
||||||
|
# if files are missing
|
||||||
|
# ask user if they want to halt the function or continue without missing files
|
||||||
|
stop_message <- paste0("Some files are missing antigen lists: ", no_missing_files, "\n")
|
||||||
|
cat(stop_message)
|
||||||
|
choice <- readline("Do you want to halt the function? (y/n) ")
|
||||||
|
# if user chooses to halt the function, stop and print error message
|
||||||
|
if (choice == "y") {
|
||||||
|
stop(stop_message)
|
||||||
|
}}
|
||||||
|
# read all files in sample_data directory and assign to variables with shortened names
|
||||||
|
for (file in names){
|
||||||
|
shortindex = gregexpr(pattern=dataset,file)[[1]][1]
|
||||||
|
shortname = substring(file,shortindex+6)
|
||||||
|
shortname = gsub(" |-", "_", shortname)
|
||||||
|
assign(paste0(shortname), read_xlsx(paste(sample_data,file,sep="")))
|
||||||
|
}
|
||||||
|
# assign cleaned data and antigen data to variables with dataset name and appropriate suffixes
|
||||||
|
assign(paste(dataset, "_A00", sep=""),filterclean("_Data"))
|
||||||
|
assign(paste(dataset, "_Antigens", sep=""), filterclean("_Antigen"))
|
||||||
|
# clean and format data
|
||||||
|
A01_Input = lapply(get(paste(dataset, "_A00", sep="")),function(df){
|
||||||
|
df = data.frame(df)
|
||||||
|
names(df)[2] = "group"
|
||||||
|
# assign group value of 1 if it contains "GC", 0 if it contains "HD", and "NA" if neither
|
||||||
|
df$group =ifelse(grepl("GC",df$group), 1,
|
||||||
|
ifelse(grepl("HD",df$group), 0, "NA"))
|
||||||
|
df
|
||||||
|
})
|
||||||
|
# format antigen data
|
||||||
|
AA_Antigens = lapply(get(paste(dataset, "_Antigens", sep="")),function(df){
|
||||||
|
df = data.frame(df)
|
||||||
|
names(df)[1] = "analyte"
|
||||||
|
df
|
||||||
|
})
|
||||||
|
# assign cleaned and formatted data to global environment variables
|
||||||
|
assign("I01_Import", A01_Input, env=globalenv())
|
||||||
|
assign("I00_Antigens", AA_Antigens, env=globalenv())
|
||||||
|
}
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
# These functions are used to calculate the optimal number of columns and rows for a display of n items.
|
||||||
|
# The display_division function takes an argument n
|
||||||
|
# which represents the total number of items to be displayed.
|
||||||
|
# It then calls two other functions h_display_division and v_display_division
|
||||||
|
# to calculate the optimal number of columns (h) and rows (v) for displaying the items.
|
||||||
|
|
||||||
|
h_display_division <- function(n, max_div = 5){
|
||||||
|
divisors = 4:max_div
|
||||||
|
if (n>max_div){
|
||||||
|
valid_divisors = divisors[n %% divisors ==0]
|
||||||
|
if (length(valid_divisors) > 0){
|
||||||
|
return(max(valid_divisors))
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
remains = list()
|
||||||
|
for(i in seq_along(divisors)){
|
||||||
|
remains[i] = n %% divisors[i]}
|
||||||
|
return(divisors[length(divisors)-which.max(rev(remains))+1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return(n)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
v_display_division <- function(n, h, max_div = 4){
|
||||||
|
divisors = 3:max_div
|
||||||
|
if (n/h< max_div){
|
||||||
|
return(ceiling(n/h))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
valid_divisors = divisors[n %% divisors*h ==0]
|
||||||
|
if (length(valid_divisors) > 0){
|
||||||
|
return(max(valid_divisors))
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
remains = list()
|
||||||
|
for(i in seq_along(divisors)){
|
||||||
|
remains[i] = n %% divisors[i]*h}
|
||||||
|
return(divisors[length(divisors)-which.max(rev(remains))+1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
display_division <- function(n){
|
||||||
|
h = h_display_division(n)
|
||||||
|
v = v_display_division(n,h)
|
||||||
|
d = ceiling(n/(h*v))
|
||||||
|
return(c(h,v,d))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Executable
+81
@@ -0,0 +1,81 @@
|
|||||||
|
fancy_roc <- function(df, report, P.Val = 0.05, validation = "none") {
|
||||||
|
library(pROC)
|
||||||
|
library(ggplot2)
|
||||||
|
lrep_sigs <- report[report$adj.P.Val < P.Val,]
|
||||||
|
analytes <- row.names(lrep_sigs)
|
||||||
|
df_selected <- df[, c("group", analytes)]
|
||||||
|
df_selected$group = as.numeric(df_selected$group)
|
||||||
|
logistic_model <- glm(group ~ ., data = df_selected, family = "binomial")
|
||||||
|
|
||||||
|
logistic_model_stepwise <- NULL
|
||||||
|
auc_stepwise <- NULL
|
||||||
|
predicted_probabilities_stepwise <- NULL
|
||||||
|
if (length(analytes) > 1) {
|
||||||
|
logistic_model_stepwise <- step(logistic_model, direction = "backward")
|
||||||
|
predicted_probabilities_stepwise <- predict(logistic_model_stepwise, type = "response")
|
||||||
|
roc_obj_stepwise <- roc(df_selected$group, predicted_probabilities_stepwise)
|
||||||
|
auc_stepwise <- auc(roc_obj_stepwise)
|
||||||
|
}
|
||||||
|
|
||||||
|
predicted_probabilities <- predict(logistic_model, type = "response")
|
||||||
|
roc_obj <- roc(df_selected$group, predicted_probabilities)
|
||||||
|
auc <- auc(roc_obj)
|
||||||
|
|
||||||
|
roc_data <- data.frame(
|
||||||
|
FPR = roc_obj$specificities,
|
||||||
|
TPR = roc_obj$sensitivities,
|
||||||
|
Model = "Logistic Regression"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!is.null(logistic_model_stepwise)) {
|
||||||
|
roc_data_stepwise <- data.frame(
|
||||||
|
FPR = roc_obj_stepwise$specificities,
|
||||||
|
TPR = roc_obj_stepwise$sensitivities,
|
||||||
|
Model = "Logistic Regression (Backwards Step)"
|
||||||
|
)
|
||||||
|
roc_data <- rbind(roc_data, roc_data_stepwise)
|
||||||
|
}
|
||||||
|
|
||||||
|
plot <- ggplot(data = roc_data, aes(x = FPR, y = TPR, color = Model)) +
|
||||||
|
geom_line(size = 1) +
|
||||||
|
labs(
|
||||||
|
x = "1 - Specificity",
|
||||||
|
y = "Sensitivity",
|
||||||
|
title = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
+
|
||||||
|
theme(
|
||||||
|
panel.background = element_rect("white"),
|
||||||
|
legend.position = c(0.75,0.15), # Change legend location
|
||||||
|
#legend.justification = "bottom",
|
||||||
|
plot.title = element_text(hjust = 0.5),
|
||||||
|
legend.text = element_text(size=14), # Change legend text size
|
||||||
|
legend.background = element_rect(color="black"),
|
||||||
|
axis.text = element_text(size = 14) # Change axis tick text size
|
||||||
|
) +
|
||||||
|
coord_cartesian(xlim = c(1, 0), ylim = c(0, 1)) +
|
||||||
|
scale_color_manual(values = c("red", "blue")) +
|
||||||
|
annotate(
|
||||||
|
"text",
|
||||||
|
x = 0.4,
|
||||||
|
y = 0.3,
|
||||||
|
label = paste("AUC: ", paste0(round(auc, 3))),
|
||||||
|
color = "red",
|
||||||
|
size = 6 #AUC text size
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!is.null(logistic_model_stepwise)) {
|
||||||
|
plot <- plot +
|
||||||
|
annotate(
|
||||||
|
"text",
|
||||||
|
x = 0.4,
|
||||||
|
y = 0.25,
|
||||||
|
label = paste("AUC: ", paste0(round(auc_stepwise, 3))),
|
||||||
|
color = "blue",
|
||||||
|
size = 6 #AUC text size
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
print(plot)
|
||||||
|
}
|
||||||
Executable
+33
@@ -0,0 +1,33 @@
|
|||||||
|
msigdb_workflow <- function(signif.genes, category = "C2") {
|
||||||
|
library(msigdbr)
|
||||||
|
library(ggplot2)
|
||||||
|
|
||||||
|
msigdb_data <- msigdbr(species = "Homo sapiens", category = category)
|
||||||
|
# signif.genes <- reports_P03_Transformed_bcrsn$Set_3_limma
|
||||||
|
# top_genes <- head(signif.genes[order(signif.genes$adj.P.Val),], 25)
|
||||||
|
top_genes <- signif.genes[order(signif.genes$adj.P.Val), ]
|
||||||
|
top_genes <- fill_analyte_info(top_genes)
|
||||||
|
top_genes <- top_genes$Gene.name
|
||||||
|
|
||||||
|
msigdb_genes <- select(msigdb_data, gs_name, gene_symbol)
|
||||||
|
enrich_msigdb <- enricher(top_genes, TERM2GENE = msigdb_genes)
|
||||||
|
|
||||||
|
enrich_msigdb_df <- enrich_msigdb@result %>%
|
||||||
|
separate(BgRatio, into = c("size.term", "size.category"), sep = "/") %>%
|
||||||
|
separate(GeneRatio, into = c("size.overlap.term", "size.overlap.category"), sep = "/") %>%
|
||||||
|
mutate_at(vars("size.term", "size.category", "size.overlap.term", "size.overlap.category"), as.numeric) %>%
|
||||||
|
mutate("k.K" = size.overlap.term / size.term)
|
||||||
|
|
||||||
|
enrich_plot <- enrich_msigdb_df %>%
|
||||||
|
filter(p.adjust <= 0.05) %>%
|
||||||
|
ggplot(aes(x = reorder(Description, k.K), y = k.K)) +
|
||||||
|
geom_col() +
|
||||||
|
theme_classic() +
|
||||||
|
coord_flip() +
|
||||||
|
labs(
|
||||||
|
y = "Significant genes in set / Total genes in set \nk/K", x = "Gene set",
|
||||||
|
title = paste("Differentially expressed genes enriched in", category, "Gene sets (P<0.05)")
|
||||||
|
)
|
||||||
|
|
||||||
|
return(list(data = enrich_msigdb_df, plot = enrich_plot))
|
||||||
|
}
|
||||||
Executable
+95
@@ -0,0 +1,95 @@
|
|||||||
|
loocv_validation <- function(df, logistic_model) {
|
||||||
|
n_samples <- nrow(df)
|
||||||
|
predicted_probabilities <- numeric(n_samples)
|
||||||
|
|
||||||
|
for (i in 1:n_samples) {
|
||||||
|
test_set <- df[i,]
|
||||||
|
test_prob <- predict(logistic_model, newdata = test_set[-1], type = "response")
|
||||||
|
predicted_probabilities[i] <- test_prob
|
||||||
|
}
|
||||||
|
|
||||||
|
return(predicted_probabilities)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
roc_curve <- function(df, report, P.Val = 0.05, stepwise = FALSE, validation = "none") {
|
||||||
|
lrep_sigs <- report[report$adj.P.Val < P.Val,]
|
||||||
|
analytes <- row.names(lrep_sigs)
|
||||||
|
df_selected <- df[, c("group", analytes)]
|
||||||
|
df_selected$group = as.numeric(df_selected$group)
|
||||||
|
logistic_model <- glm(group ~ ., data = df_selected, family = "binomial")
|
||||||
|
|
||||||
|
if (stepwise) {
|
||||||
|
logistic_model <- step(logistic_model, direction = "backward")
|
||||||
|
}
|
||||||
|
|
||||||
|
model_summary <- summary(logistic_model)
|
||||||
|
accuracy <- NULL
|
||||||
|
if (validation == "LOOCV") {
|
||||||
|
predicted_probabilities <- loocv_validation(df, logistic_model)
|
||||||
|
true_labels <- as.numeric(df$group)
|
||||||
|
threshold <- 0.5
|
||||||
|
predicted_labels <- ifelse(predicted_probabilities >= threshold, 1, 0)
|
||||||
|
correct_predictions <- predicted_labels == true_labels
|
||||||
|
accuracy <- mean(correct_predictions)
|
||||||
|
roc_obj <- roc(true_labels, predicted_probabilities)
|
||||||
|
} else {
|
||||||
|
predicted_probabilities <- predict(logistic_model, type = "response")
|
||||||
|
roc_obj <- roc(df_selected$group, predicted_probabilities)
|
||||||
|
}
|
||||||
|
|
||||||
|
auc <- auc(roc_obj)
|
||||||
|
plot(roc_obj, main = paste("ROC Curve (AUC =", round(auc, 3), ")"),asp=1)
|
||||||
|
roc_plot <- recordPlot()
|
||||||
|
|
||||||
|
logistic_regression <- list(model_summary = model_summary, logistic_model = logistic_model)
|
||||||
|
validation_results <- list(validation_method = validation, predicted_probabilities = predicted_probabilities, accuracy = accuracy)
|
||||||
|
roc_results <- list(roc_obj = roc_obj, auc = auc, plot = roc_plot)
|
||||||
|
|
||||||
|
if (validation == "none") {
|
||||||
|
results <- list(logistic_regression = logistic_regression, roc = roc_results)
|
||||||
|
} else {
|
||||||
|
results <- list(logistic_regression = logistic_regression, validation = validation_results, roc = roc_results)
|
||||||
|
}
|
||||||
|
|
||||||
|
return(results)
|
||||||
|
}
|
||||||
|
|
||||||
|
fancy_roc <- function(df, report, P.Val = 0.05, validation = "none") {
|
||||||
|
library(pROC)
|
||||||
|
lrep_sigs <- report[report$adj.P.Val < P.Val,]
|
||||||
|
analytes <- row.names(lrep_sigs)
|
||||||
|
df_selected <- df[, c("group", analytes)]
|
||||||
|
df_selected$group = as.numeric(df_selected$group)
|
||||||
|
logistic_model <- glm(group ~ ., data = df_selected, family = "binomial")
|
||||||
|
|
||||||
|
logistic_model_stepwise <- NULL
|
||||||
|
auc_stepwise <- NULL
|
||||||
|
predicted_probabilities_stepwise <- NULL
|
||||||
|
if (length(analytes) > 1) {
|
||||||
|
logistic_model_stepwise <- step(logistic_model, direction = "backward")
|
||||||
|
predicted_probabilities_stepwise <- predict(logistic_model_stepwise, type = "response")
|
||||||
|
roc_obj_stepwise <- roc(df_selected$group, predicted_probabilities_stepwise)
|
||||||
|
auc_stepwise <- auc(roc_obj_stepwise)
|
||||||
|
}
|
||||||
|
|
||||||
|
predicted_probabilities <- predict(logistic_model, type = "response")
|
||||||
|
roc_obj <- roc(df_selected$group, predicted_probabilities)
|
||||||
|
auc <- auc(roc_obj)
|
||||||
|
|
||||||
|
par(cex.axis = 1.5)
|
||||||
|
plot(roc_obj, col="red", main = "", xlim=c(1,0), ylim=c(0,1))
|
||||||
|
|
||||||
|
if (!is.null(logistic_model_stepwise)) {
|
||||||
|
predicted_probabilities_stepwise <- predict(logistic_model_stepwise, type = "response")
|
||||||
|
roc_obj_stepwise <- roc(df_selected$group, predicted_probabilities_stepwise)
|
||||||
|
auc_stepwise <- auc(roc_obj_stepwise)
|
||||||
|
lines(roc_obj_stepwise, col="blue")
|
||||||
|
legend("bottomright", legend=c("Logistic Regression", "Logistic Regression (Backwards Step)"), col=c("red", "blue"), lty=1, cex=0.8)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
legend("bottomright", legend="Logistic Regression", col="red", lty=1, cex=0.8)
|
||||||
|
}
|
||||||
|
text(x=0.4, y=0.4, labels=paste("AUC: ", paste0(round(auc, 3))), pos=1, cex=1, col="red")
|
||||||
|
text(x=0.4, y=0.35, labels=paste("AUC: ", paste0(round(auc_stepwise, 3))), pos=1, cex=1, col="blue")}
|
||||||
|
|
||||||
+144
@@ -0,0 +1,144 @@
|
|||||||
|
|
||||||
|
detect_background_noise <- function(set, empty_id = NULL){
|
||||||
|
# Get list of unique Internal.LIMS.ID values containing the word "empty"
|
||||||
|
empty_ids <- unique(grep("empty", set$Internal.LIMS.ID, value = TRUE, ignore.case = TRUE))
|
||||||
|
|
||||||
|
# If empty_id is not specified by the user, prompt the user to choose from the available options
|
||||||
|
if (is.null(empty_id)){
|
||||||
|
if (length(empty_ids) == 0){
|
||||||
|
stop("No empty samples found in dataset")
|
||||||
|
} else if (length(empty_ids) == 1){
|
||||||
|
empty_id <- empty_ids
|
||||||
|
message(paste0("Using empty ID: ", empty_id))
|
||||||
|
} else {
|
||||||
|
message("Multiple empty IDs found in dataset:")
|
||||||
|
for (i in seq_along(empty_ids)){
|
||||||
|
message(paste0(i, ": ", empty_ids[i]))
|
||||||
|
}
|
||||||
|
empty_id <- readline(prompt = "Enter the number corresponding to the desired empty ID: ")
|
||||||
|
if (!as.numeric(empty_id) %in% seq_along(empty_ids)){
|
||||||
|
stop("Invalid input. Aborting.")
|
||||||
|
} else {
|
||||||
|
empty_id <- empty_ids[as.numeric(empty_id)]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Filter the data frame to include only the chosen empty ID
|
||||||
|
emptyset <- set[set$Internal.LIMS.ID == empty_id, ]
|
||||||
|
|
||||||
|
# Calculate the background noise
|
||||||
|
inset = emptyset[-1:-2][colMeans(emptyset[-1:-2])<(median(colMeans(emptyset[-1:-2]))+(1*sd(colMeans(emptyset[-1:-2]))))]
|
||||||
|
if (length(inset) < 0.95*length(emptyset)){
|
||||||
|
calset = emptyset[-1:-2]
|
||||||
|
}else{
|
||||||
|
calset = inset
|
||||||
|
}
|
||||||
|
return(max(colMeans(calset))+sd(colMeans(calset)))
|
||||||
|
}
|
||||||
|
|
||||||
|
purge_background <- function(set, cutoff){
|
||||||
|
bgmap = set[-1:-2]> cutoff
|
||||||
|
above_cutoff = set[-1:-2][,colSums(bgmap)>0]
|
||||||
|
below_cutoff = set[-1:-2][,colSums(bgmap)==0]
|
||||||
|
keep_set = cbind(set[1:2],above_cutoff)
|
||||||
|
remove_set = cbind(set[1:2],below_cutoff)
|
||||||
|
return(list(keep_set, remove_set))
|
||||||
|
}
|
||||||
|
|
||||||
|
# The handle_background function takes a list of dataframes dflist,
|
||||||
|
# applies the purge_background function to each dataframe using detect_background_noise to determine the cutoff,
|
||||||
|
# and replaces the original dataframe with the keep_set.
|
||||||
|
# The remove_set is added to a new dflist in the global environment called X01_bg_purge.
|
||||||
|
# The function returns the new dflist.
|
||||||
|
handle_background <- function(dflist) {
|
||||||
|
new_dflist <- list()
|
||||||
|
scrap_dflist <-list()
|
||||||
|
for (i in seq_along(dflist)) {
|
||||||
|
df <- dflist[[i]]
|
||||||
|
cutoff <- detect_background_noise(df)
|
||||||
|
keep_set <- purge_background(df, cutoff)[[1]]
|
||||||
|
remove_set <- purge_background(df, cutoff)[[2]]
|
||||||
|
new_dflist[[i]] <- keep_set
|
||||||
|
scrap_dflist[[i]] <- remove_set
|
||||||
|
}
|
||||||
|
names(new_dflist) <- names(dflist)
|
||||||
|
names(scrap_dflist) <- names(dflist)
|
||||||
|
assign("X01_bg_purge", scrap_dflist, envir = .GlobalEnv)
|
||||||
|
return(new_dflist)
|
||||||
|
}
|
||||||
|
|
||||||
|
# This function takes a dataframe "set" and adjusts it by subtracting the average value of an "EMPTY-0001" sample from all other samples.
|
||||||
|
# It then sets any values less than 0 to 0, and adds 1 to all values to avoid breaking the log() function. The adjusted dataframe is returned.
|
||||||
|
emptyadjust <- function(set){
|
||||||
|
emptyset = set[set$Internal.LIMS.ID=="EMPTY-0001",]
|
||||||
|
emptyvector = colMeans(emptyset[-1:-2])
|
||||||
|
set = set[set$Internal.LIMS.ID!="EMPTY-0001" & set$Internal.LIMS.ID!="MIX_2-0029",]
|
||||||
|
labels = set[1:2]
|
||||||
|
set = cbind(set[1:2],sweep(set[-1:-2],2,FUN="-",emptyvector))
|
||||||
|
### This sets anything with less read than the empty to 0, then adds one to everything, so that it doesn't break the log()
|
||||||
|
set[-1:-2][set[-1:-2]<0] <- 0
|
||||||
|
set[-1:-2] = set[-1:-2]+1
|
||||||
|
return(set)
|
||||||
|
}
|
||||||
|
|
||||||
|
# The compress_duplicates function takes a dataframe "set" and an excel file "layout" as input
|
||||||
|
# and combines rows in the dataframe based on a shared identifier in the "layout" file.
|
||||||
|
# It identifies matching rows, averages their values, and keeps the first row while removing the rest.
|
||||||
|
# If any technical replicates have a deviation greater than either item, it prints notifications.
|
||||||
|
compress_duplicates <- function(set, layout){
|
||||||
|
outlist = c()
|
||||||
|
### Reads the layout from excel file
|
||||||
|
slayout <- read_excel(layout)
|
||||||
|
## Looks through the column named Tube Label for any items containing a hyphen, then uses any name preceding a hyphen as the for item
|
||||||
|
for (n in strsplit(slayout$`Tube label`[grepl("-",slayout$`Tube label`)],"-")){
|
||||||
|
# Filters the layout to only hold items either ending in or containing the for item immediately before the hyphen
|
||||||
|
mergerows = ((slayout %>% filter(grepl(paste0(n[1],"$|",n[1],"-"),`Tube label`)))$`Sample id_LIMS`)
|
||||||
|
# Returns the sample id for those samples, which is present in the main data set
|
||||||
|
mergeset = set[grepl(paste(mergerows, collapse = "|"), set$Internal.LIMS.ID),]
|
||||||
|
# Checks that both technical replicates are close enough together that their deviation is not greater than either item (like if one was 1000 and one was 10, this would print notifications)
|
||||||
|
outlierflag = colSums(sweep(mergeset[-1:-2],2,apply(mergeset[-1:-2], 2, sd ), '-')<0)
|
||||||
|
if (sum(outlierflag)>0){
|
||||||
|
#print(mergerows)
|
||||||
|
#print(outlierflag[outlierflag>0])
|
||||||
|
#tupsum = c(mergerows, colnames(outlierflag[outlierflag>0]))
|
||||||
|
#print(tupsum)
|
||||||
|
}
|
||||||
|
# Reassigns the first row in the set of matches so that it is equal to the mean of all matching sets, for each variable
|
||||||
|
set[grepl(paste(mergerows, collapse = "|"), set$Internal.LIMS.ID),][1,][-1:-2] = colMeans(set[grepl(paste(mergerows, collapse = "|"), set$Internal.LIMS.ID),][-1:-2])
|
||||||
|
# Eliminates all matching samples except the first (which is now the average of all matching) from the dataset
|
||||||
|
for (i in 2:length(mergerows)){
|
||||||
|
set = set[row.names(set) != row.names(set[grepl(paste(mergerows, collapse = "|"), set$Internal.LIMS.ID),][i,]),]
|
||||||
|
}}
|
||||||
|
return(set)
|
||||||
|
}
|
||||||
|
|
||||||
|
# This function takes a list of data frames dflist and a list of antigen names antigens.
|
||||||
|
# It loops over each data frame in dflist and renames the column names of the data frames according to the antigen list.
|
||||||
|
# If mode=1, the column names are set to the Antigen name
|
||||||
|
# If mode=2, the column names are set to the Gene name.
|
||||||
|
# The function then returns a list of data frames with updated column names.
|
||||||
|
set_colname_adapter <- function (dflist, antigens = I00_Antigens, mode=1, controls=get("controls", globalenv())){
|
||||||
|
lapply(1:length(dflist), function(setid){
|
||||||
|
set = dflist[[setid]]
|
||||||
|
antigens = antigens [[setid]]
|
||||||
|
for (i in 3:length(set)){
|
||||||
|
analytenum = as.numeric(strsplit(colnames(set[i]), split='.', fixed = TRUE)[[1]][2])
|
||||||
|
if (mode == 1){
|
||||||
|
colnames(set)[i] = antigens[antigens$analyte == analytenum,]$Antigen.name
|
||||||
|
} else if (mode == 2){
|
||||||
|
colnames(set)[i] = antigens[antigens$analyte == analytenum,]$Gene.name
|
||||||
|
}}
|
||||||
|
set = set[,!(names(set) %in% controls)]
|
||||||
|
return(set)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
### Automatic Processing
|
||||||
|
stage_1 <- function(dflist, name){
|
||||||
|
T01 = handle_background(dflist)
|
||||||
|
T02 = lapply(T01,emptyadjust)
|
||||||
|
T03 = lapply(T02,compress_duplicates, layout="data/layout.xlsx")
|
||||||
|
T04 = set_colname_adapter(T03)
|
||||||
|
assign(name, T04, envir = .GlobalEnv)
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
# The function adds a prefix "Set_" to the index of each data frame to create the name for that data frame.
|
||||||
|
# The function returns a list of these generated names.
|
||||||
|
simple_names <- function (dflist){
|
||||||
|
namelist = list()
|
||||||
|
for (i in 1:length(dflist)){
|
||||||
|
namelist[i] = paste0("Set_", i)
|
||||||
|
}
|
||||||
|
return(namelist)
|
||||||
|
}
|
||||||
|
|
||||||
|
# The function mergedown takes a list of data frames dflist and merges them into a single data frame by
|
||||||
|
# taking the row mean of columns with the same name in each data frame. It returns the merged data frame.
|
||||||
|
# If there are columns in a data frame that are not present in any other data frame, they are included in the merged data frame as is.
|
||||||
|
mergedown <- function (dflist){
|
||||||
|
outputdf = dflist[[1]]
|
||||||
|
for (setid in 2:length(dflist)){
|
||||||
|
originlist = colnames(dflist[[1]])[-1:-2]
|
||||||
|
mergelist = colnames(dflist[[setid]])[-1:-2]
|
||||||
|
uniquelist = mergelist[!(mergelist %in% originlist)]
|
||||||
|
mergelist = mergelist[mergelist %in% originlist]}
|
||||||
|
for (name in mergelist) {
|
||||||
|
#print(name)
|
||||||
|
outputdf[,name] = rowMeans(data.frame(dflist[[1]][,name], dflist[[setid]][,name]), na.rm = TRUE)
|
||||||
|
}
|
||||||
|
if (length(uniquelist) != 0){
|
||||||
|
for (name in uniquelist) {
|
||||||
|
#print(name)
|
||||||
|
outputdf[name] = dflist[[setid]][,name]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(outputdf)
|
||||||
|
}
|
||||||
|
|
||||||
|
#Automatic Processing
|
||||||
|
stage_2 <- function(dflist, name){
|
||||||
|
set3 <- mergedown(dflist)
|
||||||
|
dflist <- c(dflist, list(set3))
|
||||||
|
names(dflist) <- simple_names(dflist)
|
||||||
|
assign(name, dflist, envir = .GlobalEnv)
|
||||||
|
}
|
||||||
+158
@@ -0,0 +1,158 @@
|
|||||||
|
pp_dflist_wrapper <- function(dflist, pp_function){
|
||||||
|
dflist_name = deparse(substitute(dflist))
|
||||||
|
plot_name = paste(strsplit(deparse(substitute(pp_function)), "_")[[1]][-1], collapse = "")
|
||||||
|
dir_path = file.path(getwd(),"plots",dflist_name,plot_name)
|
||||||
|
dir.create(dir_path, recursive=TRUE, showWarnings = FALSE)
|
||||||
|
for (setid in seq_along(dflist)){
|
||||||
|
set_name = paste("Set",setid,sep="_")
|
||||||
|
name = (file.path(dir_path,set_name))
|
||||||
|
pp_function(dflist[[setid]], name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pca_plot <- function(data, show_ellipse = TRUE) {
|
||||||
|
library(ggplot2)
|
||||||
|
library(ggfortify)
|
||||||
|
|
||||||
|
data$group <- factor(data$group, levels = c(0, 1), labels = c("Healthy", "Diseased"))
|
||||||
|
pca_data <- prcomp(data[-1:-2], center = TRUE, scale = TRUE)
|
||||||
|
|
||||||
|
# Extract PCA scores
|
||||||
|
pca_scores <- as.data.frame(pca_data$x)
|
||||||
|
pca_scores$group <- data$group
|
||||||
|
# Calculate percentage of variance explained by each PC
|
||||||
|
var_exp <- round(pca_data$sdev^2 / sum(pca_data$sdev^2) * 100, 2)
|
||||||
|
|
||||||
|
# Update axis labels with percentage of variance explained
|
||||||
|
x_label <- paste0("PC1 (", var_exp[1], "%)")
|
||||||
|
y_label <- paste0("PC2 (", var_exp[2], "%)")
|
||||||
|
|
||||||
|
plot <- ggplot(pca_scores, aes(x = PC1, y = PC2, color = group)) +
|
||||||
|
geom_point() +
|
||||||
|
theme_classic() +
|
||||||
|
labs(x = x_label, y = y_label, title = "PCA Plot") +
|
||||||
|
scale_color_manual(values = c("Healthy" = "blue", "Diseased"="red"))
|
||||||
|
|
||||||
|
if (show_ellipse) {
|
||||||
|
plot <- plot + stat_ellipse(aes(fill = group), geom = "polygon", level = 0.95, alpha = 0.2) +
|
||||||
|
labs(title = "") +
|
||||||
|
scale_fill_manual(values = c("Healthy" = "palegreen", "Diseased"="palegoldenrod"))
|
||||||
|
}
|
||||||
|
|
||||||
|
return(plot)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
pp_box_plot_multi <- function(data, name){
|
||||||
|
# Set up plot area and device
|
||||||
|
dim = display_division(ncol(data)-2)
|
||||||
|
if ((ncol(data)-2)<=(dim[1]*dim[2])){
|
||||||
|
filename = name
|
||||||
|
col_range = 3:ncol(data)
|
||||||
|
png(filename = paste0(filename,".png"), width = 1200+300*dim[1], height = 900+100*dim[2], res=250)
|
||||||
|
par(mfrow = c(dim[2],dim[1]))
|
||||||
|
for (i in col_range) {
|
||||||
|
plot = boxplot(data[,i] ~ data$group, main = colnames(data)[i], xlab = "Group", ylab="")
|
||||||
|
}
|
||||||
|
dev.off()
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
modifier = dim[1]*dim[2]
|
||||||
|
for (d in seq(dim[3])){
|
||||||
|
filename = paste(name,d,sep="_")
|
||||||
|
png(filename = paste0(filename,".png"), width = 1200+300*dim[1], height = 900+300*dim[2], res=250)
|
||||||
|
col_range = 3:(modifier+2)+(modifier*(d-1))
|
||||||
|
col_range = col_range[col_range<=ncol(data)]
|
||||||
|
par(mfrow = c(dim[2],dim[1]))
|
||||||
|
print(col_range)
|
||||||
|
for (i in col_range) {
|
||||||
|
plot = boxplot(data[,i] ~ data$group, main = colnames(data)[i], xlab = "Group", ylab="")
|
||||||
|
}
|
||||||
|
dev.off()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
library(ggplot2)
|
||||||
|
#library(ggbreak)
|
||||||
|
|
||||||
|
pp_gg_box_plot_multi <- function(data, name){
|
||||||
|
|
||||||
|
data <- data[,-1]
|
||||||
|
# Transform data to long format
|
||||||
|
data_long <- tidyr::pivot_longer(data, -group, names_to="Variable", values_to="Value")
|
||||||
|
|
||||||
|
# Calculate upper limit for normal scale before break
|
||||||
|
upper_limit <- quantile(data_long$Value, 0.95)
|
||||||
|
|
||||||
|
# Create the plot
|
||||||
|
p <- ggplot(data_long, aes(x=group, y=Value)) +
|
||||||
|
geom_boxplot(aes(group=group, fill=factor(group)), outlier.shape = NA, color="black") + # Set the boxes to neutral color and outline them in black
|
||||||
|
geom_point(aes(color=factor(group)), position = position_jitter(width = 0.3), alpha=0.7) + # Keep the points colored
|
||||||
|
facet_wrap(~Variable, scales="free_y") +
|
||||||
|
coord_trans(y="log10") + # Implement log transform
|
||||||
|
theme_bw() +
|
||||||
|
scale_fill_manual(values = c("white", "white"), guide=FALSE) + # Use white color for box fill and disable its legend
|
||||||
|
scale_color_manual(values = c("#E57373", "#4DB6AC"),
|
||||||
|
labels = c("Healthy Controls", "XFG Patients"),
|
||||||
|
name = "") + # Return to the preferred colors
|
||||||
|
theme(strip.background = element_blank(),
|
||||||
|
strip.text = element_text(size=12, face="bold"),
|
||||||
|
axis.title.x = element_blank(),
|
||||||
|
axis.title.y = element_blank(),
|
||||||
|
axis.ticks.x = element_blank(),
|
||||||
|
axis.text.x = element_blank(),
|
||||||
|
legend.position = c(0.9, 0.1),
|
||||||
|
legend.justification = c(1, 0),
|
||||||
|
legend.background = element_blank(),
|
||||||
|
legend.key = element_blank())
|
||||||
|
|
||||||
|
# Save the plot to a file
|
||||||
|
ggsave(filename = paste0(name, ".png"), plot = p, width = 10, height = 6)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
pp_heatmap <- function(df, subset = "full", show_row_names = TRUE, show_col_names = TRUE){
|
||||||
|
# Apply the appropriate subset function based on the 'subset' parameter
|
||||||
|
if(subset == "limma"){
|
||||||
|
df = limma_subset(df)
|
||||||
|
} else if(subset == "compstat"){
|
||||||
|
df = compstat_subset(df)
|
||||||
|
}
|
||||||
|
# Remove the first two columns to create the 'subset' dataframe
|
||||||
|
subset = df[-1:-2]
|
||||||
|
# Standardize the columns of the 'subset' dataframe
|
||||||
|
subset = apply(subset, 2, function(x) (x - mean(x)) / sd(x))
|
||||||
|
# Create row names for the 'subset' dataframe based on the 'group' and 'Internal.LIMS.ID' columns
|
||||||
|
rownames(subset) = paste0(ifelse(df$group == 0, "Healthy", "Diseased"), "-", substr(df$Internal.LIMS.ID, start = nchar(df$Internal.LIMS.ID)-3, stop = nchar(df$Internal.LIMS.ID)))
|
||||||
|
# Order the columns of the 'subset' dataframe by decreasing column means
|
||||||
|
subset = subset[, order(colMeans(subset), decreasing = TRUE)]
|
||||||
|
# Transpose the 'subset' dataframe
|
||||||
|
subset = t(subset)
|
||||||
|
|
||||||
|
pheatmap(subset,
|
||||||
|
scale = "none",
|
||||||
|
cluster_rows = TRUE,
|
||||||
|
cluster_cols = TRUE,
|
||||||
|
show_rownames = show_row_names,
|
||||||
|
show_colnames = show_col_names,
|
||||||
|
treeheight_row = 0,
|
||||||
|
clustering_distance_cols = "euclidean",
|
||||||
|
clustering_distance_rows = "euclidean",
|
||||||
|
clustering_method = "complete")
|
||||||
|
}
|
||||||
|
|
||||||
|
pp_multipca <- function(df, name){
|
||||||
|
datalist <- list(base_data=df,limma_data=limma_subset(df),compstat_data = compstat_subset(df))
|
||||||
|
plots <- lapply(names(datalist), function(name) {
|
||||||
|
plot <- pca_plot(datalist[[name]])
|
||||||
|
plot + ggtitle(name)
|
||||||
|
})
|
||||||
|
combined_plot <- do.call(grid.arrange, c(plots, ncol = 3))
|
||||||
|
ggsave(paste(name, "multipca.png", sep="_"), combined_plot, width = 12, height = 4, dpi = 300)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+171
@@ -0,0 +1,171 @@
|
|||||||
|
##Basic-ish Maths
|
||||||
|
geometric_mean <- function(numbers){
|
||||||
|
gm = prod(numbers)^(1/length(numbers))
|
||||||
|
return(gm)
|
||||||
|
}
|
||||||
|
##Diff Analysis
|
||||||
|
limma_funct <- function(data) {
|
||||||
|
t_set=t(data[-1:-2])
|
||||||
|
design <- model.matrix(~0 + group, data=data)
|
||||||
|
colnames(design) <- c("case", "control")
|
||||||
|
contrasts = makeContrasts(Diff= control - case, levels=design)
|
||||||
|
fit<-lmFit(t_set, design, method="robust", maxit=1000)
|
||||||
|
contrast_fit <- contrasts.fit(fit,contrasts)
|
||||||
|
ebay_fit <- eBayes(contrast_fit)
|
||||||
|
DE_results <- topTable(ebay_fit, n=ncol(data), adjust.method = "fdr", confint = TRUE)
|
||||||
|
print(summary(decideTests(ebay_fit)))
|
||||||
|
return(DE_results)
|
||||||
|
}
|
||||||
|
sig_test <- function(data){
|
||||||
|
sigtestlist = data.frame()
|
||||||
|
for (name in colnames(data[-1:-2])){
|
||||||
|
#print(name)
|
||||||
|
# print(head(data))
|
||||||
|
setC = data[data$group==0,][[name]]
|
||||||
|
setE = data[data$group==1,][[name]]
|
||||||
|
ShapE = shapiro.test(setE)
|
||||||
|
ShapC = shapiro.test(setC)
|
||||||
|
if (ShapE$p.value >0.05 & ShapC$p.value >0.05){
|
||||||
|
testrow = cbind(tidy(t.test(setC, setE))[c("statistic", "p.value", "method")],ShapC$p.value, ShapE$p.value)
|
||||||
|
} else {
|
||||||
|
testrow = cbind(tidy(wilcox.test(setC, setE))[c("statistic", "p.value", "method")],ShapC$p.value, ShapE$p.value)
|
||||||
|
}
|
||||||
|
testrow$analyte = name
|
||||||
|
sigtestlist = rbind(sigtestlist, testrow)
|
||||||
|
}
|
||||||
|
return(sigtestlist)
|
||||||
|
}
|
||||||
|
comparative_statistics <- function(df) {
|
||||||
|
sigtest <- sig_test(df)
|
||||||
|
sigtest$bh_p.value <- p.adjust(sigtest$p.value, method = "BH")
|
||||||
|
qobj <- qvalue(p = sigtest$p.value)
|
||||||
|
sigtest$q.value <- qobj$qvalues
|
||||||
|
setC <- df[df$group == 0, ]
|
||||||
|
setE <- df[df$group == 1, ]
|
||||||
|
FC <- apply(setE[, -c(1:2)], 2, function(x) mean(x, na.rm = TRUE)) /
|
||||||
|
apply(setC[, -c(1:2)], 2, function(x) mean(x, na.rm = TRUE))
|
||||||
|
log2FC <- log2(FC)
|
||||||
|
P.Value <- sigtest$p.value
|
||||||
|
Method <- sigtest$method
|
||||||
|
BH_P.Value <- sigtest$bh_p.value
|
||||||
|
Q.Value <- sigtest$q.value
|
||||||
|
ShapE <- sigtest$'ShapE$p.value'
|
||||||
|
ShapC <- sigtest$'ShapC$p.value'
|
||||||
|
comp <- data.frame(FC, log2FC, P.Value, Method, BH_P.Value, Q.Value, ShapE, ShapC)
|
||||||
|
row.names(comp) <- colnames(df)[-c(1:2)]
|
||||||
|
return(comp)
|
||||||
|
}
|
||||||
|
## Wrappers
|
||||||
|
differential_reports <- function(dflist){
|
||||||
|
output <- list()
|
||||||
|
for (i in seq_along(dflist)) {
|
||||||
|
#print(head(dflist[[i]]))
|
||||||
|
df_name = paste0("Set_", i)
|
||||||
|
limma_output <- limma_funct(dflist[[i]])
|
||||||
|
limma_name <- paste0(df_name, "_limma")
|
||||||
|
output[[limma_name]] <- limma_output
|
||||||
|
comp_output <- comparative_statistics(dflist[[i]])
|
||||||
|
comp_name <- paste0(df_name, "_comparative_stats")
|
||||||
|
output[[comp_name]] <- comp_output
|
||||||
|
}
|
||||||
|
return(output)
|
||||||
|
}
|
||||||
|
limma_subset <- function(df, mode = "default", n=15, P=0.05){
|
||||||
|
lim <- limma_funct(df)
|
||||||
|
|
||||||
|
if (mode == "default"){
|
||||||
|
lim_sigs <- row.names(lim[lim$adj.P.Val<P,])
|
||||||
|
lim_data <- cbind(df[1:2],df[lim_sigs])
|
||||||
|
}
|
||||||
|
else if (mode == "raw"){
|
||||||
|
lim_sigs <- row.names(lim[lim$P.Val<P,])
|
||||||
|
lim_data <- cbind(df[1:2],df[lim_sigs])
|
||||||
|
}
|
||||||
|
else if (mode == "top"){
|
||||||
|
lim_sigs <- lim %>% arrange(adj.P.Val) %>% head(n) %>% row.names
|
||||||
|
lim_data <- cbind(df[1:2], df[lim_sigs])
|
||||||
|
}
|
||||||
|
return(lim_data)
|
||||||
|
}
|
||||||
|
compstat_subset <- function(df){
|
||||||
|
comp <- comparative_statistics(df)
|
||||||
|
comp_sigs <- row.names(comp[comp$Q.Value<0.05,])
|
||||||
|
comp_data <- cbind(df[1:2],df[comp_sigs])
|
||||||
|
return(comp_data)
|
||||||
|
}
|
||||||
|
clustering_dflist_wrapper<- function(dflist, clust_function){
|
||||||
|
dflist_name = deparse(substitute(dflist))
|
||||||
|
plot_name = deparse(substitute(clust_function))
|
||||||
|
dir_path = file.path(getwd(),"plots",dflist_name,plot_name)
|
||||||
|
dir.create(dir_path, recursive=TRUE, showWarnings = FALSE)
|
||||||
|
for (setid in seq_along(dflist)){
|
||||||
|
set_name = paste("Set",setid,sep="_")
|
||||||
|
name = (file.path(dir_path,set_name))
|
||||||
|
clust_function(dflist[[setid]], name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
##Transformers
|
||||||
|
#BoxCox
|
||||||
|
transformer_boxcox <- function(df, weighted = TRUE){
|
||||||
|
t_df = df
|
||||||
|
for (colname in colnames(df)[-1:-2]){
|
||||||
|
#print(colname)
|
||||||
|
lambda = determine_lambda(colname, df)
|
||||||
|
if (weighted == TRUE){
|
||||||
|
t_df[[colname]]=bc_weighted_transform(df[[colname]],lambda)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
t_df[[colname]]=bc_transform(df[[colname]],lambda)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
rm(dataf,column,envir=globalenv())
|
||||||
|
return(t_df)
|
||||||
|
}
|
||||||
|
##Boxcox Modules
|
||||||
|
determine_lambda <- function(colname, df) {
|
||||||
|
dataf <<- as.data.frame(df)
|
||||||
|
column <<- df[,colname]
|
||||||
|
# column <<- column
|
||||||
|
model <- lm(column ~ group, data = dataf)
|
||||||
|
bc <- boxcox(model, lambda = seq(-5, 5))
|
||||||
|
lambda <- bc$x[which(bc$y==max(bc$y))]
|
||||||
|
return(lambda)
|
||||||
|
}
|
||||||
|
bc_transform <- function(y, lambda=0) {
|
||||||
|
if (lambda == 0L) { log(y) }
|
||||||
|
else { (y^lambda - 1) / lambda }
|
||||||
|
}
|
||||||
|
bc_weighted_transform <- function(y, lambda=0) {
|
||||||
|
geom = geometric_mean(y)
|
||||||
|
if (lambda == 0L) { log(y) }
|
||||||
|
else { (y^lambda - 1) / lambda*geom^(lambda-1)}
|
||||||
|
}
|
||||||
|
#RSN
|
||||||
|
transformer_rsn <- function(df){
|
||||||
|
subset = as.matrix(df[-1:-2])
|
||||||
|
sink(nullfile <- tempfile())
|
||||||
|
rsn_transform = lumiN(subset, method= "rsn")
|
||||||
|
sink(NULL)
|
||||||
|
na_cols <- which(colSums(is.na(rsn_transform)) > 0)
|
||||||
|
if (length(na_cols) > 0) {
|
||||||
|
cat("Columns with NAs:", colnames(rsn_transform)[na_cols], "\n")
|
||||||
|
rsn_transform <- rsn_transform[, -na_cols]
|
||||||
|
}
|
||||||
|
return(cbind(df[1:2],rsn_transform))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##Automatic Processing
|
||||||
|
stage_3 <- function (dflist, name){
|
||||||
|
trans_list <- lapply(dflist, transformer_boxcox)
|
||||||
|
trans_list_rsn <- lapply(trans_list, transformer_rsn)
|
||||||
|
bc_report_name <- paste0("reports_",name,"_bc")
|
||||||
|
bcrsn_report_name <- paste0("reports_",name,"_bcrsn")
|
||||||
|
assign(bc_report_name, differential_reports(trans_list), envir = .GlobalEnv)
|
||||||
|
assign(bcrsn_report_name, differential_reports(trans_list_rsn), envir = .GlobalEnv)
|
||||||
|
assign(name, trans_list_rsn, envir = .GlobalEnv)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
import_libs <- function() {
|
||||||
|
function_files <- list.files(file.path("scripts", "backend"), full.names = TRUE)
|
||||||
|
|
||||||
|
for (file in function_files) {
|
||||||
|
import_env <- new.env()
|
||||||
|
source(file, local = import_env)
|
||||||
|
function_names <- ls(import_env)
|
||||||
|
function_list <- mget(function_names, import_env)
|
||||||
|
assign(basename(file), function_list, envir = .GlobalEnv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
worklib = import_libs()
|
||||||
Executable
+61
@@ -0,0 +1,61 @@
|
|||||||
|
dataset <- "GLA02"
|
||||||
|
controls <- c("Anti-human IgG", "EBNA1", "Bare-bead", "His6ABP")
|
||||||
|
for (file in list.files(file.path("scripts", "backend"))) {
|
||||||
|
print(file)
|
||||||
|
source(file.path("scripts", "backend", file))
|
||||||
|
}
|
||||||
|
source(file.path("scripts", "importer.R"))
|
||||||
|
|
||||||
|
|
||||||
|
### Pipeline
|
||||||
|
import(dataset)
|
||||||
|
stage_1(I01_Import, "P01_Preprocessed")
|
||||||
|
stage_2(P01_Preprocessed, "P02_Merged")
|
||||||
|
stage_3(P02_Merged, "P03_Transformed")
|
||||||
|
|
||||||
|
|
||||||
|
# export_excel(P03_Transformed)
|
||||||
|
# Report with good names
|
||||||
|
report <- reports_P03_Transformed_bcrsn$Set_3_limma
|
||||||
|
anti_names <- row.names((report))
|
||||||
|
gene_names <- unname(replace_antigen_names(anti_names))
|
||||||
|
report["Gene_Names"] <- gene_names
|
||||||
|
|
||||||
|
# ROC with P.Value 0.1
|
||||||
|
fancy_roc(P03_Transformed$Set_3, report = reports_P03_Transformed_bcrsn$Set_3_limma, validation = "LOOCV")
|
||||||
|
roc_breakdown <- roc_curve(P03_Transformed$Set_3, report = reports_P03_Transformed_bcrsn$Set_3_limma, validation = "LOOCV", stepwise = TRUE)
|
||||||
|
roc_breakdown$roc
|
||||||
|
roc_breakdown$validation$accuracy
|
||||||
|
roc_breakdown$validation
|
||||||
|
|
||||||
|
|
||||||
|
# Heatmap
|
||||||
|
lim <- limma_subset(P03_Transformed$Set_3, mode = "raw")
|
||||||
|
names <- replace_antigen_names(colnames(lim[-1:-2]))
|
||||||
|
colnames(lim)[-1:-2] <- unname(names)
|
||||||
|
pp_heatmap(lim)
|
||||||
|
# Boxplots
|
||||||
|
pp_box_plot_multi(lim, "Boxplots")
|
||||||
|
|
||||||
|
#PCA
|
||||||
|
pca_plot(P03_Transformed$Set_3)
|
||||||
|
|
||||||
|
# GSEA
|
||||||
|
sig_adj <- reports_P03_Transformed_bcrsn$Set_3_limma %>%
|
||||||
|
filter(adj.P.Val < 0.05)
|
||||||
|
sig_raw <- reports_P03_Transformed_bcrsn$Set_3_limma %>%
|
||||||
|
filter(P.Value < 0.05)
|
||||||
|
# C2 = msigdb_workflow(reports_P03_Transformed_bcrsn$Set_3_limma, category = "C2")
|
||||||
|
C2 <- msigdb_workflow(sig_adj, category = "C2")
|
||||||
|
C2 <- msigdb_workflow(sig_raw, category = "C2")
|
||||||
|
C3 <- msigdb_workflow(sig_adj, category = "C3")
|
||||||
|
C3 <- msigdb_workflow(sig_raw, category = "C3")
|
||||||
|
C2$plot
|
||||||
|
C3$plot
|
||||||
|
|
||||||
|
# OTHER
|
||||||
|
#pp_box_plot_multi(limma_subset(P03_Transformed$Set_3), "Limma_Subset")
|
||||||
|
untrans <- untransform_subset(P03_Transformed$Set_3, P02_Merged$Set_3, subset_method = limma_subset, P = 0.05, mode = "default")
|
||||||
|
limma_funct(untrans)
|
||||||
|
#pp_box_plot_multi(untrans, "untrans_limma")
|
||||||
|
pp_gg_box_plot_multi(untrans, "untrans_limma")
|
||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
+1414
File diff suppressed because one or more lines are too long
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
Version: 1.0
|
||||||
|
|
||||||
|
RestoreWorkspace: Default
|
||||||
|
SaveWorkspace: Default
|
||||||
|
AlwaysSaveHistory: Default
|
||||||
|
|
||||||
|
EnableCodeIndexing: Yes
|
||||||
|
UseSpacesForTab: Yes
|
||||||
|
NumSpacesForTab: 2
|
||||||
|
Encoding: UTF-8
|
||||||
|
|
||||||
|
RnwWeave: Sweave
|
||||||
|
LaTeX: pdfLaTeX
|
||||||
Reference in New Issue
Block a user