The complexity and volume of data associated with population-based cohorts means that generating health-related outcomes can be challenging. Using one such cohort, the UK Biobank—a major open access resource—we present a protocol to efficiently integrate the main dataset and record-level data files, to harmonize and process the data using an R package named “ukbpheno”. We describe how to use the package to generate binary phenotypes in a standardized and machine-actionable manner.For complete details on the use and execution of this protocol, please refer to   •A protocol to efficiently process UK Biobank phenotypic data•Reproducible and semi-automatic generation of binary health-related phenotypes•Utilities with visualization to aid data exploration and phenotype definition•Example analyses common among genetic epidemiological studies Publisher’s note: Undertaking any experimental protocol requires adherence to local institutional guidelines for laboratory safety and ethics. The complexity and volume of data associated with population-based cohorts means that generating health-related outcomes can be challenging. Using one such cohort, the UK Biobank—a major open access resource—we present a protocol to efficiently integrate the main dataset and record-level data files, to harmonize and process the data using an R package named “ukbpheno”. We describe how to use the package to generate binary phenotypes in a standardized and machine-actionable manner. The UK Biobank is a large-scale population cohort with in-depth collection of phenotypic and genetic data . While ihttps://github.com/niekverw/ukbpheno). The package contains functionalities to harmonize data of various sources in a consistent manner accompanied by structured metadata. To allow interactive exploration, the package contains multiple functionalities to visualize the data and it can be run on typical workstations (high-performance computing cluster is not required). In line with the FAIR principle , it is aIn this protocol, we show how to download and process the data from the UK Biobank as well as to generate health related phenotypes with the use of ukbpheno. More specifically, we utilize the ukbpheno package to first harmonize various data into single episode format and then generate the phenotypes . We thenTiming: 4–12 hNote: The UK Biobank data are an open access resource to any bona-fide researchers. The data analyzed in this protocol were obtained through application number 74395. Please refer to the following link to request access to UK Biobank data: https://www.ukbiobank.ac.uk/enable-your-research/apply-for-access.1.a.https://biobank.ctsu.ox.ac.uk/∼bbdatan/Accessing_UKB_data_v2.3.pdf) to obtain and decrypt the main dataset from the UK Biobank Data Showcase (Showcase) . Files needed in this step include:i.An MD5 Checksum to verify download .ii.A key file for decryption .iii.Utilities software “ukbmd5” and “ukbunpack” available on Showcase.Follow the steps in section b.ukbconv ukbxxxxx.enc_ukb docGenerate a metadata file (.html) of the decrypted main dataset (.enc_ukb) using utility “ukbconv” (available on Showcase).c.ukbconv ukbxxxxx.enc_ukb rCRITICAL: Do not run the accompanied ukbxxxxx.R script generated at this step. Only the tab separated file (.tab) is required.Generate a tab-separated file (.tab) of the decrypted main dataset (.enc_ukb) using utility “ukbconv”Download and decrypt the main dataset.2.https://biobank.ndph.ox.ac.uk/showcase/).a.Click the “Login” on the top of the webpage which redirects users to the Access Management System.b.Once logged in, select “Projects” on the left panel of the Access Management System and view the relevant project (“View/Update”).c.i.Once in the Showcase, move to “Downloads” tab on the top of the webpage.ii.In the “Downloads” page, researchers with access to record-level data will see a tab “Data Portal” next to the tab “Datasets”.iii.Connect to the record repository in the “Data Portal” tab.Inside the project, select the “Data” tab to connect the Showcase in “logged-in” mode.d.i.Request access to record-level hospital inpatient data via Field 41259.ii.Request access to record-level primary care data via Field 42038, 42039 and 42040.iii.Request access to record-level death register via Field 40023.Download the complete data tables (.txt) through the “Table Download” tab.Obtain the record-level data from Data Portal on Showcase  inside an R session.install.packages("data.table")install.packages("dplyr")install.packages("ggplot2")install.packages("ggforce")install.packages("tableone")install.packages("survminer")install.packages("MatchIt")install.packages("devtools")devtools::install_github("niekverw/ukbpheno")library(data.table)library(dplyr)library(ukbpheno)library(ggplot2)library(ggforce)library(tableone)library(survminer)library("MatchIt")There is no hard requirement on R versions for ukbpheno. Results presented in this protocol were produced running with R version 4.0.3 with RStudio version 1.3.959 in a Unix system.Timing: 2–8 h1.https://github.com/niekverw/ukbpheno/tree/master/inst/extdata/data.settings.tsv.Download data setting file (data.settings.tsv) to the project directory from 2.https://github.com/niekverw/ukbpheno/tree/master/inst/extdata/definitions_DmRxT2.tsv.Download definition table template to the project directory from 3.a.i.Each code should be separated by a comma.ii.For code systems with hierarchical system (refer to data setting file), it is possible to fill in only the parent codes instead of specifying all codes.iii.Annotations of the codes can be made using curly bracket “”.Optional: We included a shiny app to cross-reference codes between systems using the mapping file provided by UK Biobank. (https://github.com/niekverw/ukbpheno/blob/master/inst/util/shiny.lookup_codes.R). Download the code map file (Excel workbook) provided by the UK Biobank (https://biobank.ndph.ox.ac.uk/showcase/refer.cgi?id=592): (1) locate the shiny app script and run the shiny app, and (2) visit the address returned  in a web browser and use the app. A screenshot of the shiny app can be found in For each of code systems e.g., diagnosis codes ICD10 or operation codes OPCS4 as well as codes used in the self-report fields, fill in the corresponding codes in the table.b.i.Fill in field number as Showcase followed by the condition e.g., “6177=3(insulin)”ii.iii.Add the corresponding age of diagnosis using “” following the condition e.g., “4041=1[2976]”Fill in fields with conditions in the “TS” (touchscreen) column.Fill in one phenotype (such as DmT2) per row. The column “TRAIT” contains the unique identifier of each phenotype which is case sensitive.4.a.“Study_population” can be used to restrict definition on a subgroup of participants with specific phenotype.b.Participants with phenotypes in “Include_definition” will be considered to be a case for the composite phenotype.c.Users may use the “Exclude_from_cases” and “Exclude_from_controls” column to exclude participants with certain phenotype(s) from cases and controls respectively.It is possible to create a composite phenotype, which involves other phenotypes. Composite phenotypes are constructed using four columns in the definition table .a.“StudyNote: For example, a composite phenotype “diabetes mellitus” may include two phenotypes “type 1 diabetes” and “type 2 diabetes”. Alternatively, for the phenotype “type 2 diabetes” we may want to exclude any cases with also a “type 1 diabetes” diagnosis.5.a.Trait “DmT2”, “DmT1” and “DmG” contain specific codes for diabetes type 2, type 1 and gestational diabetes respectively;b.“RxDm” defines the antidiabetic medication which is further divided into “RxDmIns” (Insulin) and “RxDmOr” ;c.“Dm” captures general codes for diabetes and the remaining definitions are used to differentiate between type 1 and type 2 diabetes within this group.The definition table template “definitions_DmRxT2.tsv” contains definitions constructed for the definition of type 2 diabetes in the UK Biobank.Health outcome information from various data sources / data fields within the main dataset is encoded differently. These relationships have been curated and recorded in the data setting file included in the ukbpheno package. For a target phenotype, survey the various data sources/ data fields on the Showcase and determine the definitions for the target phenotype in UK Biobank. An example definition table to define type 2 diabetes is included in the package. This example table can be used as a template for users to define their target health outcomes.Timing: 15 min6.Specify data file paths in R.# The directory with data filespheno_dir <-"mydata/ukb99999/"# Main datasetfukbtab <- paste# Metadata filefhtml <- paste# Hospital inpatient datafhesin <- pastefhesin_diag <- pastefhesin_oper <- paste# GP datafgp_clinical <- pastefgp_scripts <- paste# Death registryfdeath_portal <- pastefdeath_cause_portal <- paste# Participant withdrawal listf_withdrawal<-paste7.Specify files paths for the data setting file, the definition table and code maps which are included in the package (extdata/). Alternatively download the files from code repository of ukbpheno hosted at GitHub.# Or download the files fromhttps://github.com/niekverw/ukbpheno/tree/master/inst/extdata/#extdata_dir<-paste0,"/")fdefinitions <- paste0fdata_setting <- paste08.Read data setting file. The pre-curated data setting file specifies the characteristics of each data source which are taken into account in the data harmonization process.dfData.settings <- fread(fdata_setting)9.a.i.Code maps include all available codes.The function “read_definition_table” expands parent codes using the code maps and sort out codes relevant for inclusion and exclusion accordingly.b.i.A specific ICD10 code may not exist in the UK Biobank ICD10 code map as this code is not present in the data.ii.There may be typos.The function will also cross-check codes entered in the definition with the code maps and warn users of any non-matching codes e.g.,Run the “read_definition_table” function to process the definition table.dfDefinitions_processed_expanded<-read_defnition_tableOptional: Alternatively download the code maps from the UK Biobank Showcase or create them manually by extracting all unique codes from your data using “get_all_exisiting_codes” which generates flat-form  code maps. Adjust the data setting file accordingly.# First input: file path to GP clinical table# Second input: corresponding column names from the .txt file# Third input: output file-pathget_all_exsiting_codes,c)Input files required by the package include data files from UK Biobank including the main dataset, the metadata file and optionally data tables from Data Portal; the completed definition table and data setting file.Timing: 15–45 minAt the harmonization step, we combine all the available data files from various sources and transform them to the format of clinical events to facilitate downstream analyses . For ind10.a.The “allow_missing_fields” flag specifies whether field(s) required on the definition table but missing in the main dataset is allowed and ignored. If this flag is set to “FALSE”, the harmonization step will halt in case of any missing field.b.If the participant withdrawal list is provided, records of these individuals will be removed.Load, process and harmonize all data files using harmonized_ukb_data.Note: The function harmonized_ukb_data harmonizes all available data . Additionally, the function will check if all fields required on the definition table are present in the main dataset and inform the user if any field is missing.lst.harmonized.data<-harmonize_ukb_dataNote: Time required to harmonize the data is dependent on size of the files. Factors that should be taken into considerations include number of fields approved for the particular project, number of participants included as well as if record-level primary care data are present.11.View(lst.harmonized.data)a.i.View(lst.harmonized.data$lst.data)Diagnosis codes without associated actual event date will have date of visit to assessment center (such as self-report diabetes) in the “eventdate” column and “0” in the “event” indicating that the date does not reflect a true event .View definition, the harmonized data tables, the data settings and the individuals to be included (either specified by a vector of participant identifiers or a data-frame containing identifier in the first column and reference dates in the second column).# 1) definition of the target trait “Type 2 diabetes”trait<-"DmRxT2"# 2) harmonized data table - lst.harmonized.data# 3) data setting data-frame - dfData.settings# 4) individuals specified via df_reference_date# Here the dates of baseline visit (f.53.0.0) are taken as referencedf_reference_dt_v0<-lst.harmonized.data$dfukb13.lst.DmRxT2.case_control <- get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT==trait), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)View(lst.DmRxT2.case_control)a.“df.casecontrol” is a data.table object of 16 columns providing summary of the diagnosis per participant . Includeb.“all_event_dt.Include_in_cases” is data.table object including all event episodes supporting the diagnosis for the cases included .Table 5Cc.“all_event_dt.Include_in_cases.summary” is a data.table object with the same format with “df.casecontrol” but includes only cases (both included and excluded case).Use “get_cases_controls” function to obtain the case/control status. The function returns a list of three data.table objects: “df.casecontrol”, “all_event_dt.Include_in_cases” and “all_event_dt.Include_in_cases.summary” .lst.DmRx14.Generate timeline plot to check the relative contribution by various data sources over time . Events DmRxT2_timeline<-plot_disease_timeline_by_source(definition=dfDefinitions_processed_expanded%>%filter(TRAIT==trait),lst.harmonized.data$lst.data,dfData.settings, df_reference_dt_v0$identifiers)DmRxT2_timeline15.Use “make_upsetplot” to examine the overlaps between the data sources at baseline to gain insight on their relationships .Figure 9upset_plot<-make_upsetplot(definition=dfDefinitions_processed_expanded%>%filter(TRAIT==trait),lst.harmonized.data.gp$lst.data,dfData.settings,df.reference.dates = df_reference_dt_v0)upset_plot16.Generate summary descriptions on the events with “get_stats_for_events”. For example, generation of a frequency plot of codes among all events from secondary care may help verify or refine the definition .Figure 1# Extract all hospital admission recordsall_DmRxT2_evnt<-lst.DmRxT2.case_control$all_event_dt.Include_in_casesDmRxT2_hesin_rec<-all_DmRxT2_evnt[grepl ]# Get some descriptive statistics on the records on a code levelhesin_stats<-get_stats_for_events(DmRxT2_hesin_rec)hesin_stats$stats.codes.summary.phesin_stats$stats.codes.summary.p17.Explore secondary care code count by individual .Figure 1# Get some summary statistics on the records on individual levelDmRxT2_rec_cnt<-DmRxT2_hesin_recmax(DmRxT2_rec_cnt$count)median(DmRxT2_rec_cnt$count)mean(DmRxT2_rec_cnt$count)quantile(DmRxT2_rec_cnt$count)# Visualize count with barplot with a zoom-in on count between 0-50ggplot2::ggplot) + ggplot2::geom_bar(fill="#0073C2FF") + ggplot2::xlab("Number fo secondary care record per person") + ggplot2::ylab("Frequency") + #theme with white background ggplot2::theme_bw + ggplot2::theme(text = ggplot2::element_text(size=22),panel.grid.minor =ggplot2::element_blank,panel.grid.major =ggplot2::element_blank) + ggforce::facet_zoom)18.Generate a timeline of the codes contributing to diagnosis for a particular individual (please replace the identifier if copied from the cell below) .Figure 1# Plot individual time lineplot_individual_timeline19.First identify participants with specific diabetes codes  as well as general diabetes code.# Identify individuals with specific DmT2 codeslst.DmT2.case_control<-get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="DmT2"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)# Identify individuals with specific DmT1 codeslst.DmT1.case_control<-get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="DmT1"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)# Identify individuals with DmGlst.DmG.case_control <- get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="DmG"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)# Identify individuals with general diabetes diagnosis codes excl. medicationlst.Dm.case_control <- get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="Dm"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)20.Identify use of different anti-diabetic medications. Find individuals on metformin likely due to diseases other than diabetes by cross checking with the list of individuals with diabetes diagnoses.# Identify individuals with metformin uselst.RxMet.case_control <- get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="RxMet"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)#Identify use of insulin/oral diabetic med. excl. metforminlst.RxDmNoMet.case_control <- get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="RxDmNoMet"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)#Identify individuals that are on metformin but no diabetes codes#nor medication other than metforminRxMet_DmUnlikely<-setdiff)21.a.We identify these individuals via set operations of the relevant diagnoses.b.Inspect the records of these individuals for evidence of type 2 diabetes.Cross-examine various diagnoses. For example we want to get individuals with young onset diabetes but did not have records supporting a diagnosis of non-type 2 diabetes. Namely these individuals did not have evidence of type 1 diabetes nor gestational diabetes.# Identify individuals with self-report insulin <12 months post-diagnosislst.RxDmInsFirstYear.case_control<-get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="RxDmInsFirstYear"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)# Identify young onset self reported diabetes (European origin)lst.SrDmYEw.case_control <- get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="SrDmYEw"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)# identify young onset self reported diabetes (Caribbean African origin)lst.SrDmYSaCa.case_control <- get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT=="SrDmYSaCa"), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0)# Individuals of young onset diabetesind_young_onset<- union# Individuals with evidence of other types of diabetes reportedind_RxInsFirstYear_DmT1_DmG<- union,lst.DmG.case_control$df.casecontrol[Hx==2]$identifier)# Young onset but no DM type 1/ gestational diabetes specific codes nor self report of insulin within first year of diagnosisinds_young_onset_possible_DmT2 <-setdiff# Check the records of these individualslst.DmRxT2.case_control$all_event_dt.Include_in_cases[identifier %in% inds_young_onset_probable_DmT2]To make the definition of the type 2 diabetes more precise, we may screen and exclude individuals with evidence of other types of diabetes as well as the use of metformin not due to diabetes.Timing: 15–30 min22.Read and process the definition file.# Read the definitions tablefdefinitions <- paste0dfDefinitions_processed_expanded<-read_defnition_table23.a.The metadata provides information such as data type of these fields.b.Extract age at assessment center visit (Field 21003), sex (Field 31), body mass index (Field 21001), glycated hemoglobin level (Field 30750), glucose level (Field 30740), self-report insulin use within the first year of diabetes diagnosis (Field 2986), UK Biobank assessment center visited (Field 54) and Date of attending assessment center (Field 53).Extract only the required fields from the main dataset using read_ukb_tabdata.# Extract clinical variables from the main dataset using read_ukb_tabdata# We need the metadata (.html) file for read_ukb_tabdatadfhtml <- read_ukb_metadata(fhtml)# Rename the identifier column in the metadatadfhtml$field.tab<-"identifier"# Age at assessment center visit, sex, BMI, HbA1c, glucose,insulin within 1 year of diagnosis,UK Biobank assessment center location, date of visitbaseline_fields<-c# Extract these variables from main datasetdfukb_baseline <- read_ukb_tabdatagc24.Generate the phenotypes for atrial fibrillation, coronary artery disease, type 2 diabetes, hypertrophic cardiomyopathy, heart failure, hypertension and hyperlipidemia with a loop and merge the phenotype information into one table “dfukb_baseline_pheno”.# The target disease traits we will generate in batchdiseases<-c# Make an output folder to store the resultout_folder<-paste0if(!dir.exists(file.path(out_folder))){dir.create(file.path(out_folder))}df_withdrawal<-fread# remove withdrawn participantsdfukb_baseline_pheno<-dfukb_baseline[! identifier %in% df_withdrawal$V1]# Loop through the traits, including family history of related diseases and the diabetes medication usefor ){print(disease)lst.case_control <- get_cases_controls(definitions=dfDefinitions_processed_expanded %>% filter(TRAIT==disease), lst.harmonized.data$lst.data,dfData.settings, df_reference_date=df_reference_dt_v0) # Add the trait to the column namescolnames(lst.case_control$df.casecontrol) <- paste, sep = "_") # Except for participant identifiernames(lst.case_control$df.casecontrol)[names(lst.case_control$df.casecontrol) == paste]<-"identifier"# Merge these columns with dfukb_baseline_phenodfukb_baseline_pheno<-merge}This session demonstrates how to generate multiple phenotypes and make a clinical characteristics table with these phenotypes, stratified by type 2 diabetes status. An example definition table with the selected cardiometabolic diseases, family history of these diseases and diabetes medication usage is provided in the package. We additionally extract demographic information namely age and sex as well as biomarkers BMI, blood glucose, glycated hemoglobin and self-report insulin use within one year of diabetes diagnosis from the main dataset.Timing: 10 min25.Select variables to be reported in the clinical characteristics table. Rename the variables in the table to improve readability. Create the clinical characteristics table stratified by type 2 diabetes. Write the clinical characteristic table to a file.# Keep only the variables needed for the tabledfukb_baseline_pheno_fortable1<-dfukb_baseline_pheno# Negative first diagnosis day indicates history while positive indicates follow-up casesdfukb_baseline_pheno_fortable1$DmT2_0_first_diagnosis_years<-(-1∗dfukb_baseline_pheno_fortable1$DmT2_0_first_diagnosis_days)/365.25# Rename for readabilitycolnames(dfukb_baseline_pheno_fortable1)<-c# Below the parameters for CreateTableOne# The full variable listvars<-c# The categorical variables on the clinical characteristics tablefactorVars<-setdiff)# Create the clinical characteristic table stratified by type 2 diabetestableOne <- CreateTableOnehist(dfukb_baseline_pheno_fortable1$`Years since type 2 diabetes diagnosis`)tableOnetab1Mat <- print)# Save the table to a CSV filewrite.csv)In the following example analyses, we investigate the characteristics of participants with type 2 diabetes specific codes. We exclude the cases with type 1 diabetes diagnosis codes and we exclude any controls with non-specific diabetes codes .25.SelecTiming: 5 min26.a.The start time is the date when the participant visited the assessment center;b.Observed time is up to date of event or earliest among date of death and censoring date of hospital inpatient records (last follow up).With time-to-event data as well as the censoring dates for different data sources for different regions, compute the observed time for each participant.# Get death dates from datadeathdt<-unique])# Rename the column and mergecolnames(deathdt)<-cdfukb_baseline_pheno<-merge# HESIN censoring date are different by regions# Use the UK Biobank assessment center location attended by the participantsengland<-cscotland<-cwales<-c# Corresponding censoring datesdfukb_baseline_pheno<-as.Date("2021-03-31")dfukb_baseline_pheno<-as.Date("2021-03-31")dfukb_baseline_pheno<-as.Date("2018-02-28")# Time-to-event/observed time is determined at earliest of date of event, date of death and censoring date of HESIN data (last follow up)# This is already calculated for those who have eventsrange# non-event but died before HESIN censoring datedfukb_baseline_pheno# People censored at last fu# non-event but died after censoring date (HESIN),dfukb_baseline_pheno# non-event and alive by censoring datedfukb_baseline_pheno27.Create the survival object and Kaplan-Meier plot for new onset heart failure stratified by type 2 diabetes status at baseline.#Estimate risk of new onset heart failure by presence/absence of type 2 diabetes at baselinefit<-survival::survfit ∼ DmT2_0_Hx, data = dfukb_baseline_pheno[DmT2_0_Hx>0])# summary(fit)# Make Kaplan-Meier plotggsurvplot", censor.size=2, palette = c, conf.int = TRUE, # Add confidence interval pval = TRUE, # Add p-value risk.table = TRUE, # Add risk table risk.table.col = "strata", # Risk table color by groups legend.labs = c, risk.table.height = 0.2)Timing: 5 min28.To match type 2 diabetes case to control by age, sex and body mass index. We extract those variables and remove individuals with missing values in either the target phenotype or any covariates.######################################### 1:2 case control matching with MatchIt#########################################library(“MatchIt”)# Remove individuals with either missing or excluded phenotype for target phenotype (type 2 diabetes at baseline)df_to_matchit<-dfukb_baseline_pheno[!is.na(DmT2_0_Hx) & DmT2_0_Hx>0]# Pick three covariates age at assessment center visit, sex and BMI for matchingdf_to_matchit<-na.omit])29.Format the coding of the phenotype and name the rows by participant identifier in preparation for the matchit function. Run the matchit function to match 2 controls to each case. Examine the result.# Format the data for the matchit function# Control/case: 1/2 to 0/1df_to_matchit$DmT2_0_Hx<-df_to_matchit$DmT2_0_Hx-1# Name the rowsrownames(df_to_matchit)<-df_to_matchit$identifiercolnames(df_to_matchit)<-c# Run matchitm.dm2<-matchit#Check resultsummary(m.dm2)# Each row in the match.matrix shows identifier of one case with 2 matched controlsm.dm2$match.matrixSometimes it may be desirable to match cases and controls by characteristics such as age and sex in certain studies. Here we demonstrate how to further process phenotypes created in ukbpheno to generate matched case-control pairs. We utilize an R package MatchIt for the matching task.After the harmonization step, the user should have in the R workspace the data from both Data Portal (record level data) as well as a subset of the main dataset relevant for the target phenotypes (as specified in the definition table). Users can perform further analyses in R as they see fit .Using our machine with 64 GB RAM (DDR4 2667 MHz) and 10-core processor (Intel Skylake) under an Ubuntu 16 system, it took 12 min to load and process the main dataset and all record level files. Of which the most time-consuming step was loading the main dataset (six minutes with file size 35.5 GB) followed by the primary care data . The harmonization step was additionally tested on an Ubuntu 16 machine with 16 GB RAM (DDR4 2667 MHz) and 6-core processor (AMD Ryzen 5). It took approximately 45 minutes to complete on this machine.The “get_cases_controls” function from ukbpheno determines the case/control status for a target phenotype following the inclusion/exclusion criteria outlined in the definition table. Users can extract prevalent as well as incident cases with a specific reference time point. Results presented in this protocol are produced using data downloaded in June 2021, with primary care data for around 45% of the UK Biobank cohort available and data censoring dates shown in Following the example definition of “DmRxT2”, users should expect a prevalence of 4.7% at the baseline visit, an estimate close to . AdditioExamining the diabetes diagnoses captured in secondary care system, user should be able to obtain similar frequency plots as shown in With the plot_individual_timeline function, user should expect visualization of diagnosis codes of a selected participant over time. Lastly in the cross-examinations with other types of diabetes and medication, users should expect similar numbers as reported in the prevalence algorithms by Eastwood and colleagues . Users cIn this part users should be able to generate the cardiometabolic phenotypes namely, atrial fibrillation or flutter, coronary artery disease, hypertrophic cardiomyopathy, heart failure, type 2 diabetes, hypertension and hyperlipidemia. Users should also obtain the related phenotypes including family history of diabetes, family history of heart disease, family history of hypertension and the use of diabetes medications. Using our machine with 64 GB RAM (DDR4 2667 MHz) and 10-core processor (Skylake), it took three minutes to process all 12 phenotypes.In this part users should obtain a clinical characteristics table stratified by type 2 diabetes status . The diap<0.0001 in the data analyzed.In the survival analysis on new-onset heart failure (outcome of interest) between participants with or without type 2 diabetes at baseline, user would obtain a Kaplan-Meier plot similar to Following up with the type 2 diabetes phenotype we created, it can be seen that case-control ratio is unbalanced. It can also be seen that the controls were younger, more likely to be female and had lower body mass indices compared to the cases . We usedPhenotyping of a heterogenous resource such as UK Biobank can be challenging due to multiple data origins compounded with varying coverage both in terms of time and individuals. In the current protocol we demonstrate how to use the ukbpheno package to define health-related outcomes and we presented possible analyses with regard to the phenotyping process.With the ukbpheno package, the case/control status is determined by presence of diagnosis records. In the case of contradictory records, an individual might be classified with theoretically mutually exclusive diagnoses. Ad-hoc analyses would be needed to refine the phenotypes of these individuals should such precision be required.It is also of note that, while the users can assign different weights to different data sources by adjusting minimum instance filter in the setting, it is not possible to directly weight on individual codes which could be important for a certain phenotype. The limitation could be circumvented by an implementation on the definition level (separating the codes in various definitions). It is important to recognize that there is no gold-standard for many of the health-related outcomes. Users should decide on their definitions based on the study questions at hand.Unable to download/decrypt the main dataset (step1).Ensure the most updated project key which is valid for one year after initiation.Unable to download data from Data Portal (step 2).Request the relevant fields listed in step 2 via the UK Biobank Access Management System .Error: Failed to install ‘ukbpheno’ from GitHub: installation of package “xx” had non-zero exit status (step 5).Installation of the dependent package “xx” was not successful. Find the error message on console, resolve the error and restart the installation. Possible reason of error includes “dependency “xx” is not available (for R version x.x.x) “, which may be solved by specifying the version of package compatible for the corresponding R version.Certain codes are missing after reading in the definition table (step 9).The package drops codes that are not available in data. If a certain code is dropped not due to this reason, check for special characters (accented characters are not recognized) and make sure codes are comma separated.Data processing step fails (step 10).Run “get_all_varnames” with the processed definition table and meta-data file to check if but some required fields are missing in the main dataset. Either remove the missing fields from definition table or allow missing fields  in the “harmonized_ukb_data”.m.w.yeung@umcg.nl).Further information and requests for resources should be directed to the lead contact, Ming Wai Yeung (This study did not generate new unique reagents.


We announce the coding-complete genome sequences of 23 severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) Omicron strains obtained from Bangladeshi individuals. The Oxford Nanopore Technologies sequencing platform was utilized to generate the genomic data, deploying ARTIC Network-based amplicon sequencing. Coronaviridae, genus Betacoronavirus) variant, known as the Omicron variant (B.1.1.529), was initially reported to the World Health Organization (WHO) on 24 November 2021 (A novel severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) . To summarize, 3,723,478 reads were generated . A nearly complete genome was obtained for each sample, and the genomic information is provided in https://github.com/cov-lineages/pangolin), followed by visual inspection using CLC Genomics Workbench v21.0 (Qiagen). In comparison with the reference genome (Wuhan Hu-1 [GenBank accession number NC_045512.2]), the spike protein-based signature amino acid variations assigned 22 of the sequences as sublineage BA.5 and 1 as BA.2.75. Genome sequencing has been playing a critical role in COVID-19 responses, because new variants are constantly evolving. Therefore, rapid sequencing and data sharing can contribute to the implementation of quick and informed public health decisions to mitigate COVID-19 consequences.As part of a nationwide coronavirus disease 2019 (COVID-19) surveillance program , nasopharyngeal swab specimens were obtained from routine diagnostic samples from patients across Bangladesh. Reverse transcription -PCR was performed using a commercially available novel coronavirus (2019-nCoV) nucleic acid diagnostic kit . A total of 48 SARS-CoV-2 RT-PCR-positive samples were subjected to sequencing. Viral RNA was extracted from nasopharyngeal swab samples using the QIAamp viral RNA minikit (Qiagen). ARTIC v3 primer-based multiplex PCR amplicons were generated and used as the sequencing libraries . LibrariThe data from this study can be found under GISAID accession numbers EPI_ISL_13439470, EPI_ISL_13439471, EPI_ISL_13439472, EPI_ISL_13439473, EPI_ISL_13439474, EPI_ISL_13439475, EPI_ISL_13439476, EPI_ISL_13439477, EPI_ISL_13439478, EPI_ISL_13439479, EPI_ISL_13439480, EPI_ISL_13439481, EPI_ISL_13574266, EPI_ISL_13574267, EPI_ISL_13574268, EPI_ISL_13574269, EPI_ISL_13439482, EPI_ISL_13574270, EPI_ISL_13574271, EPI_ISL_13439484, EPI_ISL_13439485, EPI_ISL_13439486, and EPI_ISL_14859273. The GenBank accession numbers are listed in


Patients with dysphagia have impairments in many aspects, and an interdisciplinary approach is fundamental to define diagnosis and treatment. A joint approach in the clinical and videoendoscopy evaluation is paramount.To study the correlation between the clinical assessment (ACD) and the videoendoscopic (VED) assessment of swallowing by classifying the degree of severity and the qualitative/descriptive analyses of the procedures.cross-sectional, descriptive and comparative.held from March to December of 2006, at the Otolaryngology/Dysphagia ward of a hospital in the country side of São Paulo. 30 dysphagic patients with different disorders were assessed by ACD and VED. The data was classified by means of severity scales and qualitative/descriptive analysis.the correlation between severity ACD and VED scales pointed to a statistically significant low agreement (KAPA = 0.4) . The correlation between the qualitative/descriptive analysis pointed to an excellent and statistically significant agreement (KAPA=0.962) (p<0.001) concerning the entire sample.the low agreement between the severity scales point to a need to perform both procedures, reinforcing VED as a doable procedure. The descriptive qualitative analysis pointed to an excellent agreement, and such data reinforces our need to understand swallowing as a process. Multidisciplinary work in dysphagia is a common denominator advocated by researchers and clinicians, since dysphagic patients have losses in the medical, nutritional, physiotherapeutic, physiological and speech arenas, thus needing numerous professionals to serve all of their health care demandsThe most known methods used to assess swallowing are the clinical evaluation of swallowing (CES) and the instrumental tests of video-fluoroendoscopy (VFE) and swallowing video-endoscopy (SVE). CES can not make a definitive diagnosis of dysphagia; however, it is a component which allows us to understand its natureAmong the instrumental tests, VFE has been considered the “gold standard”; however, because of its high cost and scarcity of places where it can be performed, SVE has proven accessible and doable. Swallowing videoendoscopy is a simple test, of low cost and little invasiveness, besides being easily transportable, making it possible to do sequential evaluations in patients with mobility challenges. It allows one to observe the pharyngeal phase of swallowing; it allows the physician to order the patient to perform airway protection maneuvers - so as to help the physician guide the patient regarding a proper diet for these patientsConsidering the importance of SVE in the diagnosis of dysphagia, otorhinolaryngologists gain relevance in the work team, being the professional responsible for performing the exam. The ENT is in charge of interpreting the SVE in its functional and anatomical aspects, and such data is fundamental for diagnosis. The speech therapist can work together with the ENT during the exam, suggesting the assessment of therapeutic strategies.Considering the different functions of each swallowing assessment procedure it is necessary to understand and interpret the different signs and symptoms observed in order to pinpoint the participation of each evaluation procedure and thus establish the approach in cases of dysphagia.To study the correlation between the clinical evaluation (CES) and swallowing video-endoscopy (SVE) by classifying the degree of severity and the qualitative/descriptive analysis of the two evaluation procedures.The present cross-sectional, descriptive and comparative study was approved by the Ethics Committee of the institution under protocol # 796/2005. All the subjects signed the informed consent form.The evaluations were carried out in the dysphagia ward - ENT of a hospital in the country-side of the state of São Paulo between March and December of 2006. This ward is geared specially to patients with neurogenic dysphagia, diagnosed with Parkinson's disease (PD), Amyotrophic Lateral Sclerosis (ALS) and Machado-Joseph Disease (MJD).All the patients were submitted to CES and SVE. After the procedures, the results were discussed with the team, made up by an ENT physician, ENT residents, speech therapists and nutritionists.CES and SVE followed the procedures proposed by the present study (Attachment 1), which was built from the protocols of other authorsThe CES was done in a direct and indirect manner. The indirect one includes interview, structural and sensitive evaluation of the oral cavity and administration of food. The neck was ausculted during rest, during saliva swallowing and before, during and after the swallowing of food. Later on, compensatory maneuvers were studied in order to achieve a safe swallowing.SVE followed the procedures proposed (Attachment 1) and was carried out by an otorhinolaryngologist using the conventional video-endoscopic equipment. The speech therapist participated offering the different food quantities and consistencies to be studied, and also suggesting the evaluation of certain airway protection maneuvers. The exam was recorded in a DVD.The data was analyzed in the following fashion:- Step 1 - CES and SVE analysis by means of classification according to severity scales.The severity scale employed for CES was proposed by Furkim and Silva- Step 2 - Compare the degrees of severity between the CES and SVE scales.- Step 3 - Case-by-case classification according to the qualitative/descriptive analysis, based on the signs and symptoms observed during CES and SVE.The qualitative analysis of the signs observed in the CES and SVE was carried out once the scales did not provide subsidies for the therapeutic planning. The analysis was based on the comparison of the CES and SVE findings according to the criteria presented on The signs listed above make up the assessment protocol presented in the present study - which is descriptive, providing a broad view of the swallowing process and creation of specific treatment plans, since it is possible to identify the alteration shown.Each case had its two assessments (CES and SVE) compared according to the qualitative analysis criteria , and was- Step 4: Comparing the severity degree classification and the qualitative analysis.In order to understand the contribution of each procedure in the evaluation of swallowing we chose to analyze the agreement between the qualitative analysis and the degree of severity, by correlating the scales with the data which were identified in the procedures. After the correlation the data were grouped in the following way:1 - Group in which the CES and SVE severity scale indicated the same degree and the qualitative analysis indicated similar CES and SVE signs;2 - Group in which the severity scales indicated a greater degree by SVE, correlated with cases in which the qualitative analysis indicated a higher SVE degree, correlated with cases in which the qualitative SVE analysis indicated more signs; 3 - cases in which the CES indicated a greater severity in the scale and more data in the qualitative analysis.In order to describe the sample profile according to the study variables, we created frequency tables of the category variables (disease) with absolute (n) and percentage (%) values, and descriptive statistics with position and scatter values  of the continuous variable (disease).The statistical analysis used the “The SAS System for Windows” , version 8.02 software. The agreement analysis among the classifications used the kappa agreement coefficient. Kappa values above 0.75 meant excellent agreement and values between 0.40 and 0.75 meant intermediate agreement, values below 0.40 indicated low agreement among the classifications. The level of significance adopted for the statistical tests was 5% (p<0.05)We studied 30 adult dysphagic patients, 19 men and 11 women. Their mean age was 56 years, varying between 19 and 91 years. They presented different base diagnosis: Parkinson's disease, amyotrophic lateral sclerosis, Machado-Joseph disease, stroke, and four patients with other diagnoses. The correlation among the results from the severity scale classification in each evaluation procedure (step 2) is depicted on KAPA=0.400; CI95%: ; Z=2.74; p=0.006It is possible to see in Graph 1 that the number of agreeing evaluations according to the criteria on the severity scales (same degree of severity in CES and SVE) is not very relevant. The statistical analysis indicated an intermediate/low agreement (KAPA = 0.4) in a significant way (p=0.006). Kappa values below 0.4 indicate low agreement.The results from steps 3 and 4 - descriptive qualitative analysis classification and comparison of these results with the severity degree classification - indicated an agreement in most of the cases studied, as shown on The agreement between the degree of severity and the qualitative analysis indicated excellent degree (Kappa=0.962) in a statistically significant way (P<0.001). Such data reinforces that the qualitative/descriptive analysis proved to be an efficient evaluation method.The subjects in the sample have ages above 50 years, and this can justify the fact that they frequently present neurodegenerative alterations. There is a prevalence of patients with Parkinson's disease and ALS, followed by MJD and Stroke, for being the main population in the ward.According to Table 1, the agreement observed between CES and SVE severity scales was intermediate/low in a statistically significant way. Many studies correlate data found in the CES with findings from objective exams. Mathers-Schmidt and KurlinskiThe correlation of signs observed between CES and SVE, from the qualitative viewpoint is justified by the influence of the oral phase in the pharyngeal phase of swallowingNasal food reflux, which cause is inefficiency or failure of the soft palate muscles, reducing intraoral pressure - which can be seen at CES and SVE. There are correlations between aspiration risk and changes in soft palate movementMotor or sensitive involvement of facial muscles causes alterations to the neuronal information, which is the basis for a proper motor response regarding the food to be ingested. Such involvement may cause an increase in oral transit time, posterior deflection and/or inefficient ejection, resulting in alterations of the pharyngeal phase, especially stasis in the valleculasMultiple swallowing can be seen during CES and in SVE, which happen because of stasis in the oral cavity and vallecula - an inadequate oral phase which causes altered food pushing. Stasis in the pyriform sinuses and posterior pharyngeal walls are also considered alterations to the pharyngeal phase of swallowing, having seen that the mechanism impaired is pharyngeal wall mobility.Throat clearing, cough and alterations in neck auscultation are signs of penetration and/or aspiration seen during CES and can be confirmed by SVE -by the presence of food in the larynx without passing through the vocal folds (penetration) or by the presence of food below the vocal folds (aspiration)International studies comparing the use of neck auscultation, CES and objective exams to predict aspiration indicate that the association of two procedures is safer to find aspiration since the auscultation alone does not guarantee sensitivity to all the altered casesTohara et al.As we observe the data individually, we stress 13 disagreeing cases . In 5 ofWe can argue that in the 8 cases in which SVE showed more data, in two patients we observed stasis which were not suggested in the clinical evaluation, besides aspiration in two and laryngotracheal penetration in four cases.It is important to discuss the clinical evaluation that is not efficient to identify silent penetrations and aspirations, besides being little efficient to detect stasis in difficult places, which can cause late aspirations and inefficient treatment.Of the 30 patients investigated, in 26 who were clinically and vide-ofluoroendoscopically evaluated we noticed that it was not safe to forecast the presence of penetration/aspiration of liquids by the clinical evaluation34. Because of the need for complementary tests, the present study also presents the evaluation roadmap used in order to suggest assessment procedures which may help to better understand the swallowing process and provide complementary information to the clinical-therapeutic rationale of dysphagic patients.Many studies stress the importance of associating the CES and the objective examination in the assessment of swallowing. Such studies suggest that the two procedures are complementary and essential for the diagnosis and treatment planning of dysphagia, leading to the definition of more specific approaches for each patientSwallowing evaluation procedures must try to understand the swallowing process, in other words, the mental cognitive-status behaviorSVE is a highly efficient procedure since it does not require high investments because the equipment utilized is the one ENTs are already used to having, and also in terms of time because the entire test can be performed well under 20 minutes. The SVE also broadens the action scope of otorhinolaryngologists and allows for an interdisciplinary work with speech therapists.1.The severity classification agreement of CES and SVE proved to be intermediate/low, reinforcing the need to perform both assessment procedures.2.The agreement between the correlation of severity degree and qualitative/descriptive analysis severity proved to be excellent, reinforcing the qualitative/descriptive analysis as an efficient assessment method.On-going PhD thesis at the Institute of Language Studies in the field of Neurolinguistics, entitled: “Study and speech therapy follow up of post-stroke subjects”. Such study is associated to the Neurolinguistics Integrated Project (CNPq: 521773/95-4).ATTACHMENT 1Evaluation RoadmapSwallowing Clinical and Video-endoscopic (SVE) Assessment Protocol (May/07)Exam date: _____ / _____ / _____Patient: ____________________ Reg.#: ____________________ BD: _______________ Age: _____Address: _________________________________________________________________Tel: _________________________ Informer: ___________________________________D.H.: ______________________________________________________________________P.H: ______________________________________________________________________Disease Duration: ____________________________________________________________Medicamentions: ____________________________________________________________Current complaint: ____________________________________________________________Swallowing complaint: Yes_____NoComplaint duration: ____________________________________________________________Prior feeding habits: _______________________________________________________Meal Records (24 hrs): __________________________________________________Usual Weight: __________ Current weight: _______________ Height:__________ BMI:Monthly family income: _________________________ # of family members: __________General health status:Heart disorders: ______________________________________________________________________High blood pressure: ______________________________________________________________________Pulmonary infections: ____________________________________________________________Gastric disorders: _________________________________________________________________Mouth and teeth alterations: ____________________________________________________________Malnutrition: ______________________________________________________________________Dehydration: ______________________________________________________________________Diabetes: (Type) ____________________________________________________________Tracheostomy:  Present  absentCannula:  metal  PVC plastic  silicone  with Cuff  WO/cuffMechanical ventilation  Present  absentNon-invasive ventilation: Mask  Nasal Swallowing complaint:Indirect clinical evaluationDirect clinical evaluationSigns of penetration/aspiration:Facial color alteration: ____________________________________________________Respiratory rate alteration: ____________________________________________________2 saturation alteration: ____________________________________________________OManeuvers utilized: ____________________________________________________Swallowing Videoendoscopic Evaluation1.Nasal cavitiesSeptum  centered  deviated R  deviated L  Non-obstructive irregularitiesMucosa  pale  edematous  wet  atrophicTurbinates  normotrophic  hypertrophic2.Rhinopharynx:Mucosa  pale  edematous  wet  atrophicEustachian tube ostium  free  obstructed3.Pharynx-soft palate sphincter:Phonation Complete closure  Incomplete closure coronal  sagittal  circular  circular with Passavant ringSwallowing Complete closure  incomplete closure coronal  sagittal  circular  circular with Passavant ring4.Hypopharynx Tongue base mobility  proper  altered _______________________Posterior wall mobility  proper  altered ______________________Vallecula  normal  lesion  saliva stasisEpiglottis  normal  omega-shape  lesion ______________________Arytenoids  normal  hyperemia  edema Interarytenoid region  normal  hyperemia  edemaPyriform recess  free  obstructed  saliva stasis  R  LSensitivity  normal  reduced  absent5.LarynxVocal folds Ventricular folds mobile  normal paresis  R  L  hyperconstriction  R  L Immobility  R  L Laryngeal asymmetry  yes  no arching  R  L sensitivity to the mechanical stimulus atrophy  R  L epiglottis  normal  altered lesion _________________  R  L aryepiglottic fold  normal  altered other ______________________ subglottis  normal  altered6.Glottic closure complete  incomplete  consistent  inconsistent posterior triangular slit  mid-posterior triangular slit  anterior spindle-like slit spindle-slit in all the extension  hourglass-like slitSwallowing Videoendoscopic Evaluation (SVE)


The presented method is an adaptation of NeuroKit2 to simplify and automate computation of the various mathematical estimates of heart rate variability (HRV) or similar time series. By default, the present approach accepts as input electrocardiogram's R-R intervals (RRIs) or peak times, i.e., timestamp of each consecutive R peak, but the RRIs or peak times can also stem from other biosensors such as photoplethysmography (PPGs) or represent more general kinds of biological or non-biological time series oscillations. The data may be derived from a single or several sources such as conventional univariate heart rate time series or intermittently weakly coupled fetal and maternal heart rate data. The method describes preprocessing and computation of an output of 124 HRV measures including measures with a dynamic, time-series-specific optimal time delay-based complexity estimation with a user-definable time window length. I also provide an additional layer of HRV estimation looking at the temporal fluctuations of the HRV estimates themselves, an approach not yet widely used in the field, yet showing promise (doi: 10.3389/fphys.2017.01112). To demonstrate the application of the methodology, I present an approach to studying the dynamic relationships between sleep state architecture and multi-dimensional HRV metrics in 31 subjects. NeuroKit2′s documentation is extensive. Here, I attempted to simplify things summarizing all you need to produce the most extensive HRV estimation output available to date as open source and all in one place. The presented Jupyter notebooks allow the user to run HRV analyses quickly and at scale on univariate or multivariate time-series data. I gratefully acknowledge the excellent support from the NeuroKit team.  Specifications tableThe methods section is structured as follows. First, following a brief rationale for the method I outline the HRV metrics computed. Second, I describe the implementation in Python. This section contains several elements defining the functions for executing the data loading, preprocessing and feature computation steps followed by data saving; as last step, I provide the code to tie everything together for a single step execution. At last, I present an application of the code to an open-source dataset and conclude with remarks for the broader usage.Heart rate variability (HRV) as a search term on PubMed rendered ∼55,000 publications as of June 16, 2022. While first studies appeared in 1925, there has been a notable rise in scientific publishing around 1975 with some 400 papers appearing annually as of 2021. This is likely attributable to the steady increase in computational capacity and its access to it along with growing recognition of the HRV physiology and pathophysiology. For example, HRV has been recognized as a biomarker of health and stress in adult and developing organisms reflecting heart-brain interactions and resulting, among other observations, in the phenomenon of heart beat-evoked potentials, a direct reflection of bidirectional brain-heart communication The number of HRV estimates, sometimes also referred to as metrics or biomarkers, has grown as well, now exceeding 100, albeit it is understood that some of these estimates are collinear With the advent of Digital Health and increased utilization of wearable or ambient sensors to capture heart rate and other biological oscillations, the awareness of caveats in HRV analysis in contrast to the traditional electrocardiogram (ECG)-based approach also needs to rise Several toolboxes have been built to collate the existing methodologies in a more accessible format and foster the discovery of new biomarkers of health outcomes based on HRV and other physiological time series In parallel, the ecosystem of Python-based open-source packages for time series processing has also been maturing. One such package stands out in terms of methodological scope, functional depth, rich API and constant updates through a large international community of researchers: NeuroKit2. It is a Python Toolbox for Neurophysiological Signal Processing The presented method is an adaptation of NeuroKit2 to simplify and automate computation of the various mathematical estimates of HRV or similar time series The method describes preprocessing and computation of an output of 124 HRV measures including measures with a dynamic, time-series-specific optimal time delay-based complexity estimation with a user-definable time window length .Table 1HI also provide an additional layer of HRV estimation looking at the temporal fluctuations of the HRV estimates themselves, an approach not yet widely used in the field, yet showing promise.Finally, I present an application of the proposed HRV estimation pipeline to an open-source dataset from PhysioNet acquired in 31 subjects during sleep using Apple Watch and enriched with expert annotation of sleep states ,18,19.How does this methodology add to the existing set of techniques and tools? NeuroKit2′s documentation is extensive. Here, I attempted to simplify things summarizing all the researcher needs to produce the most extensive HRV estimation output available to date as open source and all in one place. The presented Jupyter notebooks allow the user to run HRV analyses quickly and at scale on univariate or multivariate time-series data. I gratefully acknowledge the excellent support from the NeuroKit team.(1)Univariate or multivariate time series input; ingestion, preprocessing and computation of 62 HRV metrics.(2)Standardization of RRI window lengths and RRI duration-specific computation of complexity estimates.(3)Estimation of intra- and inter-individual higher order temporal fluctuations of HRV metrics.(4)Application to a sleep dataset recorded using Apple Watch and expert sleep labeling.The key features of the presented methodology are:The step-by-step approach is as follows.1. Create a dedicated virtual environmentYou may use conda or another environment manager such as pip or Docker. The choice boils down to your preferences and constraints: for example, certain Python packages can only be installed in pip and not in conda. For the proposed approach, I am not aware of any constraints that prevent the user from using conda. Ultimately, using a virtual environment will help you down the road to ensure your Python analytical pipeline keeps on working and does not get broken by unintended package updates and disrupted interdependencies. As an alternative to this conda step, I provide a Docker container here # call conda datanalysis environment!conda init bash!conda activate datanalysis #or use your own preferred venv2. Load the required and recommended packages.import neurokit2 as nkimport pandas as pdimport matplotlib.pyplot as pltimport numpy as npimport osimport scipy.iofrom pathlib import Pathfrom scipy.stats import variationfrom hmmlearn import hmm# load Matlab data filesfrom scipy.io import loadmat3. Import raw peaks.The source may be Matlab files or whatever input data format you may need. In the present example, we load a duo of files: corresponding maternal and fetal peak data. Your use case may differ. For example, you may load just one set of peak data, three or more sets of peak data derived from different ECG channels, an ECG-derived peak times channel and a PPG-derived peak times channel, etc. Simply amend the code accordingly by editing and adding the additional lines for each step as required.In this work, because the focus is on peak times or heart rate  time series, an important step is skipped deliberately: the derivation of the peak data from the raw signal. This can be ECG, PPG or otherwise recorded blood pressure fluctuations (pulse). The HRV Task Force recommends checking for the presence of ectopic heartbeats, e.g., premature ventricular contractions (PVCs) ,43. Neur# Import raw peaks from the mat files; adjust to fit your input data formatf_filepath_peaks=Path.cwd/"raw_peaks/f" #fetal raw peaks mat files;m_filepath_peaks=Path.cwd/"raw_peaks/m" #maternal raw peaks mat files;4. Get ready for batch file processing. a. Create a list of relevant files in directoryf_peaks_files = [f for f in sorted(f_filepath_peaks.iterdir) #create a list of relevant files in directoryif f.suffix == '.mat']m_peaks_files = [f for f in sorted(m_filepath_peaks.iterdir) #create a list of relevant files in directoryif f.suffix == '.mat'] b. Read one file at a time using the above list, trim, clean, convert to RRI c. The present syntax is for a specific ECG format; adopt to your use case d. Iterate over i files in the f_ or m_ peaks_files lists and extract the correct peaks channel as numpy arraydef read_mat_file:# Import 5th row of the mat file's peak data which has 1000 Hz sampling rate; you may need to adopt this step as per your data structuref_file_PEAK_raw=loadmat(f_peaks_file)m_file_PEAK_raw=loadmat(m_peaks_file)f_peaks=f_file_PEAK_raw['fetal_Rpeaks'][4] #this is my 5th row ECG-SAVER-extracted peaks channelm_peaks=m_file_PEAK_raw['mother_Rpeaks'][4] #this is my 5th row# Trim trailing zerosf_peaks_trimmed=np.trim_zerosm_peaks_trimmed=np.trim_zeros# Artifact removal [see next section for details]f_clean_peaks=nk.signal_fixpeaks #allow 80–180 bpmm_clean_peaks=nk.signal_fixpeaks #allow 40–150 bpm# Document artifacts from each run as clean_peaks_rri[0]: build a dataframe for each file over all segments# Convert to RRIf_rri = peaks_to_rrim_rri = peaks_to_rrireturn f_clean_peaks[1], m_clean_peaks[1], f_rri, m_rri, f_clean_peaks[0], m_clean_peaks[0] e. Proceed with the steps below: HRV compute, save. Cf. final section (10).Convert peaks to RRIs5. Using NeuroKit2’s functions to take the cleaned peaks as input: peaks_to_rri# Some NK functions  take RRIs# So use these UDFs borrowed from the NK package: convert peaks to RRI on the cleaned peaks outputdef peaks_to_rri:rri = np.diff(peaks) / sampling_rate * 1000if interpolate is False:return rrielse:# Minimum sampling rate for interpolationif sampling_rate < 10:sampling_rate = 10# Compute length of interpolated heart period signal at requested sampling rate.desired_length = int(np.rint(peaks[-1]))rri = signal_interpolate,**kwargs)return rri, sampling_rate6. Artifact correction. a. This is a key step that will influence everything downstream. It is often not reported clearly in the studies. b. Adjust the sampling rate and threshold settings as appropriate for your data. c. Note that we save the logs of artifact correction for audit purposes. Sometimes, you need to know why a certain dataset behaved in the way it did and this documentation can come in handy.# Artifact correction# Integrated into the above UDF red_mat_file, but you may find this useful to adopt elsewhere in your codehttps://neurokit2.readthedocs.io/en/latest/functions.html#neurokit2.signal.signal_fixpeaks# Artifact removal on peaks using Kubios: write into UDF taking trimmed_peaks input# caution: nk.signal_fixpeaks takes peaks, not RRI!# nk.signal_fixpeaks saves the corrected peak locations to the [1] index of the output data sturcture# accessible like so: clean_peaks[1]# Review the settings for fetal versus maternal RRI inputs! Adjust to match your RRI physiology# interval_min – minimum interval btw peaks | interval_max – maximum interval btw peaks.f_clean_peaks=nk.signal_fixpeaksm_clean_peaks=nk.signal_fixpeaks# Convert trimmed and cleaned peaks to RRI (using _trimmmed_ raw peaks as input!)rri_clean = peaks_to_rri7. Compute all HRV metrics segment-wise a. Rather than computing on the entire time series at once and trading the reproducibility as a result , we i. set the segment duration explicitly a priori and ii. Take advantage of the segment-wise estimate of HRV  to investigate the higher-order structure of the HRV metrics themselves. b. For complexity estimates, note that we use segment duration-specific estimation of optimal time delay rather than using default settings. This allows us to compute FuzzEn, FuzzEnMSE, FuzzEnRCMSE, cApEn specifically for the optimal time delay. Why select these complexity estimates? It is heuristic. I have found Fuzzy Entropy estimates to be understudied and robust, especially with RRI time series. This is hence worthy of additional attention in future studies deploying complexity estimates. Other time-delay-dependent complexity estimates can be plugged in here, all made available via NeuroKit2 API.# UDF compute_HRV# This UDF computes all [regular and extra non-linear] HRV metrics segment-wise for a filedef compute_HRV:# Regular HRV matrix (from peaks)duration_peaks=peaks[len(peaks)-1] #gives me the duration in samplesdivider=duration_peaks/1000/60/5 #sampling_rate, 5 min window segmentssegment=np.array_split #divide in segments of 5 min; the last segment may be shorter; discard during statistical analysis on HRV metricssegment_df=pd.DataFramefor i in range(len(segment)):segment=nk.hrvsegment_df = pd.concat# Additional nonlinear HRV metrics from RRIssegment=np.array_split #divide _RRI_ in segments of 5 min; the last segment may be shorter; discard during statistical analysis on HRV metrics#create my dataframe structure to which to append the list as a row in the followingextra_columns=extra_complexity_df=pd.DataFrame(columns=extra_columns)df_length=len(extra_complexity_df)extra_complexity_df_total=pd.DataFrame(columns=extra_columns)for i in range(len(segment)):optimal_complexity_parameters = nk.complexity_delayextra_complexity_segment_fuzen=nk.entropy_fuzzyextra_complexity_segment_fuzen_mse=nk.complexity_fuzzymseextra_complexity_segment_fuzen_rcmse=nk.complexity_fuzzyrcmseextra_complexity_segment_capen=nk.entropy_approximatesegment_duration=np.sum(segment[i])/1000 #segment duration in seconds#join all individual output floats including values of segment[i] - i.e., for each segment - and its duration in seconds as numpy.sum(segment[1])/1000extra_complexity = extra_complexity_df.loc[df_length]=extra_complexityextra_complexity_df_total = pd.concat# simply concatenate both df's horizontally; this scales allowing addition of other df's from bivariate computationsfinal_df=pd.concatreturn final_df #this is per subject with SubjectID output along on the right side8. Compute higher order HRV metrics.Here I made explicit and expanded upon what we attempted first in def compute_basic_stats:# compute mean and variation# assuming "ts_data" is where my HRV metric values list is per subjectmean=np.meancoeff_variation=variation# this function works similar to variation but works purely with numpy# cv = lambda x: np.std(x) / np.mean(x)# First quartile (Q1)Q1 = np.percentile# Third quartile (Q3)Q3 = np.percentile# Interquaritle range (IQR)IQR = Q3 - Q1midhinge = (Q3 + Q1)/2quartile_coefficient_dispersion = (IQR/2)/midhinge# adding entropy estimate; this is experimental!# ts_entropy=nk.entropy_sample(ts_data)# yielding error "could not broadcast input array from shape  into shape (7)" | the following syntax fixes that and is more elegant in that it estimates optimal delay# optimal_complexity_parameters = nk.complexity_delay# ts_entropy=nk.entropy_fuzzy# still yielding len errorts_entropy=nk.entropy_shannon(ts_data)basic_stats=, quartile_coefficient_dispersion, ts_entropy]return basic_stats#HMM Modeldef do_hmm(ts_data):#ts_data=numpy.array(data)gm = hmm.GaussianHMM(n_components=2)gm.fit)hmm_states = gm.predict)#hmm_states=[states.tolist]print(hmm_states)return hmm_states # next, add _states_ iteratively for all subjects to states_Uber list to spot patterns# deal with last column which is string and needs to be skippeddef skip_last_column(lst):# unpack the list of listsdef Extract(lst):return [item[0] for item in lst]# check for string in the first sublist element_to_check=Extract(lst)[0]return isinstance #return Boolean for presence of string in the sublistdef compute_higher_HRV:# assuming "final_df" is the dataframe where the HRV metric values are listed segment-wise per subject# compute basic statshigher_order_basic_stats=for i in range: #last column is the SubjectID string, so skipping it belowmetric=final_df.iloc].values#String skip logic to skip over SubjectID columnif skip_last_column == False:results_temp1=compute_basic_stats,SubjectID)higher_order_basic_stats.append(results_temp1)else:i+=1basic_stats=pd.DataFramecolumns=final_df.columns[0:63] #make sure I don't select the last column which has SubjectIDbasic_stats.index=[columns]basic_stats_final=basic_stats.T #transpose# compute HMM stats: computing on just 7 data points leads to errors in some instances, so omit for now and revisit later when used on longer HRV metrics time series, say, several hours# Estimate HMM probabilities output for a given segmented HRV metric# Then compute basic_stats on this estimate;# Hypothesis: stable tracings will have tight distributions of HMM values and resemble entropy estimates;# This will apply statistically significantly for physiologically stressed (tighter distributions) versus control subjects#higher_order_basic_stats_on_HMM=#for i in range: #last column is the SubjectID string, so removing it# metric=final_df.iloc].values# print)# some HRV metrics have NaNs and the "do_hmm" script crashes on those;# Adding logic to skip if NaN is present# a=any(pd.isna(metric)) #checking if _any_ values in HRV metrics list are NaN# b=skip_last_column(metric)# skip_reasons={a:'True', b:'True'}#NaN or string skip logic# if any(skip_reasons):# i+=1# else:# results_hmm_temp2=do_hmm(metric)# print(results_hmm_temp2)# print(type(results_hmm_temp2))# results_stats_hmm_temp=compute_basic_stats #j being the file number; != SubjectID# higher_order_basic_stats_on_HMM.append(results_stats_hmm_temp)#basic_stats_on_HMM=pd.DataFrame#basic_stats_on_HMM.index=[columns]#basic_stats_on_HMM_final=basic_stats_on_HMM.T #transpose#higher_final_df=pd.concathigher_final_df=basic_stats_final #leaving the syntax above for when the data allow HMM analysisreturn higher_final_df #this includes SubjectID9. Save everything.Gather all data from the separate data frames into spreadsheets for further analyses.# Execute the entire analysisFor each file :- call read_mat_file- call compute_HRV- save results to Excel10. Execute the entire pipeline calling the above defined functions# Initialize data structuresf_artifacts_log=m_artifacts_log=Uber_fHRV=Uber_mHRV=Uber_higher_fHRV=Uber_higher_mHRV=i=0# Compute & save into listswhile i<=len(f_peaks_files)-1: #careful - this assumes equal number of fetal and maternal raw files# read the peaks file, trim trailing zeros, artifact correct it, convert to RRIs and return the resultsf_clean_peaks, m_clean_peaks, f_rri, m_rri, f_clean_peaks_artifacts, m_clean_peaks_artifacts=read_mat_filefSubjectID=format(f_peaks_files[i].stem)mSubjectID=format(m_peaks_files[i].stem)f_artifacts_log_i=m_artifacts_log_i=#save artifact processing log from each file starting with its real SubjectIDf_artifacts_log.append(f_artifacts_log_i)m_artifacts_log.append(m_artifacts_log_i)# compute all HRV metricsffinal=compute_HRVmfinal=compute_HRV# update the UBER dfUber_fHRV.appendUber_mHRV.append# compute higher_order HRV metricsfhigher_final=compute_higher_HRVmhigher_final=compute_higher_HRV# update the UBER_higher_dfUber_higher_fHRV.appendUber_higher_mHRV.appendi+=1if i>len(f_peaks_files):breakprint('Computation completed.')# save artifacts logsdf_Uber_f_artifacts = pd.DataFrame.from_records(f_artifacts_log) #edit the name as neededdf_Uber_m_artifacts = pd.DataFrame.from_records(m_artifacts_log) #edit the name as neededdf_Uber_f_artifacts.to_exceldf_Uber_m_artifacts.to_excel# save HRV resultsUber_fdf=pd.concat(Uber_fHRV)Uber_fdf.to_excelUber_mdf=pd.concat(Uber_mHRV)Uber_mdf.to_excelUber_higher_fdf=pd.concat(Uber_higher_fHRV)Uber_higher_fdf.to_excelUber_higher_mdf=pd.concat(Uber_higher_mHRV)Uber_higher_mdf.to_excel11. Method validation: Demonstrating the performance of the proposed HRV pipeline in a retrospective analysis of a polysomnography dataset recorded with Apple Watch.date (in seconds since polysomnography start) stage .As validation dataset, the data by Walch et al. was used which is available from PhysioNet. The team acquired heart rate data in 31 subjects during sleep using Apple Watch and enriched the data with expert annotation of sleep states ,18,19. T(1)The heart rate data, extracted from the Apple watch, is publicly available.The data were recorded from 31 subjects during sleep, averages 7.3 h, and comes expertly annotated with sleep state labels.(2)The authors provided a script on GitHub for how to enable such data extraction in the future. This should make such a demonstration particularly relevant for future studies (3)This dataset ties in well with the accompanying publication in the Journal of Biomedical Informatics This dataset is appealing for several reasons for the intended objective of HRV pipeline validation:Interestingly, the presented HRV pipeline yields insights into sleep state dynamics reflected in HRV which I discuss below. The underlying code, based on the presented HRV estimation pipeline, and all generated data can be found on FigShare and DockerHub •The number of HRV metrics was increased from 63 (as per above Jupyter notebook) to 124 HRV metrics, computed on this entire PhysioNet dataset cf. .•Since this is intended as an example only, for ease of computing, I used the entire dataset to compute HRV ; I also set optimization for complexity parameters to default settings for the same reasons. The code is available for those who wish to dive deeper and have the resources to do so.•○The code is presented to determine the total duration of each sleep state per recording using the labeled files ○The saved continuous and averaged SampEn and RMSSD data are provided for the entire cohort, for future analyses ○The code and the visualizations of each subject's time course are provided for heart rate, SampEn, and sleep state architecture ○R = 0.39, p = 0.03) or CV RMSSD (R = 0.55 and p = 0.001), respectively . The findings show again, this time quantitatively across the cohort, a degree of correlation between HRV complexity fluctuations and duration of deep sleep . Note thectively .Fig. 2Sp○Next, I expanded the scope by assessing and showing the correlations systematically for all subjects, all 124 HRV metrics, and all sleep states   [46].FigSample Entropy (SampEn) is reported as an example complexity metric of HRV over time as it changes during sleep along with the traditional linear time-domain metric RMSSD; these are plotted along with the heart rate and sleep state architecture (using the supplied labels). This approach can contribute to studying these relationships systematically and develop open source algorithms to reliably detect sleep states from PPG-derived HRV data.To analyze this dataset, I expanded the presented HRV pipeline further and deployed it in several ways that can be used as a basis for future studies as follows.I suggest the following implications for future work. First, the dataset and the presented findings can be studied further using machine learning tools to derive an optimal HRV metric-based predictor of the NREM states or REM states’ duration. Second, the richness of the temporal fluctuations can be further harnessed for classification and prediction using the code for hidden Markov mechanisms (HMM). I consider this to be out of scope for the present manuscript but provide the necessary code.•https://hub.docker.com/r/mfrasch/hrv-pipeline. The notebook is deposited on GitHub pages (https://martinfrasch.github.io): for viewing online here (https://martinfrasch.github.io/MethodsX%20R1%20HRV%20pipeline%20v4.1.html)All data produced during this analysis has been deposited in FigShare at 10.6084/m9.figshare.20076464 •https://martinfrasch.github.io/MethodsX%20R1%20HRV%20pipeline%20v4.1%20FINAL.ipynb)and as downloadable Jupyter notebook here  can be found here (https://chart-studio.plotly.com/∼mfrasch/6)12. Data availabilityFinal remarksThe presented HRV computation pipeline in Python using the API of NeuroKit2 package is shown based on the use of the maternal-fetal trans-abdominally derived non-invasive ECG signal followed by maternal and fetal ECG extraction using SAVER algorithm Recent advances in the in silico modeling of physiological systems open avenues for discovery of novel and deeper understanding of the existing HRV metrics The literature indicates a high potential of HRV biomarkers to serve as predictors of important health outcomes such as cardiac or mental health as well as in critical care and disorders of consciousness .The author declares the following financial interests/personal relationships which may be considered as potential competing interests:MGF holds patents on EEG and ECG processing. MGF is founder of and consults for Digital Health companies commercializing predictive potential of physiological time series for human health.


Understanding dysregulation of the eukaryotic initiation factor 4F (eIF4F) complex across tumor types is critical to cancer treatment development. We present a protocol and accompanying R package “eIF4F.analysis”. We describe analysis of copy number status, gene abundance and stoichiometry, survival probability, expression covariation, correlating genes, mRNA/protein correlation, and protein co-expression. Using publicly available large multi-omics data, eIF4F.analysis permits computationally derived and statistically powerful inferences regarding initiation factor regulation in human cancers and clinical relevance of protein interactions within the eIF4F complex.For complete details on the use and execution of this protocol, please refer to Wu and Wagner (2021).  •An R package to analyze eIF4F dysregulation, using large multi-omics datasets•Detailed steps for software installation, data download, and library initialization•Guidelines for deriving biological and clinical inferences from multiple analyses•Illustrated code structure explains bioinformatics pipeline assembly technique Publisher’s note: Undertaking any experimental protocol requires adherence to local institutional guidelines for laboratory safety and ethics. Understanding dysregulation of the eukaryotic initiation factor 4F (eIF4F) complex across tumor types is critical to cancer treatment development. We present a protocol and accompanying R package “eIF4F.analysis”. We describe analysis of copy number status, gene abundance and stoichiometry, survival probability, expression covariation, correlating genes, mRNA/protein correlation, and protein co-expression. Using publicly available large multi-omics data, eIF4F.analysis permits computationally derived and statistically powerful inferences regarding initiation factor regulation in human cancers and clinical relevance of protein interactions within the eIF4F complex. In complex biological systems, biological processes rely on participation of multiple proteins through their physical and specific functional interactions. Clinical relevance of protein-protein interactions (PPIs) has been traditionally investigated through wet-lab approaches using tissue cultures and animal models, which are often complicated by easily-perturbed cell culture conditions or poor recapitulation of human diseases.in vivo gene co-expression and protein interactions has been reported after analyzing large-scale data from multiple species including human.,,The validity of our method derives from the biological requirement for interacting proteins to be simultaneously present within a cell, which implies that synthesis and degradation of interacting proteins ought also to coincide.EIF4F genes and their protein interactions from analysis results. Our innovative computational method can be extended for broader application to reveal the clinical relevance of PPIs in assorted disease conditions, given additional disease-related datasets, custom lists of candidate protein complexes with subunits, and implementation of more association analyses. However, the protocol presented here is narrowly targeted to the production of our eIF4F results.As we previously published,1.Download & install R 4.2.1, if not already installed.2.https://www.rstudio.com/products/rstudio/download/).Download & install RStudio, if not already installed: )install.packages("BiocManager")> BiocManager::install(version = "3.15")# install required R packages:> bio_pkgs <- c> BiocManager::install(bio_pkgs)# load required packages> lapplyNote: Except for the "RCurl," "R.utils," and "utils" packages that are required for Download.R file, all dependent packages will be installed in the next step. However, installation of all dependent package takes a long time and sometimes gives installation errors related to the setting of individual users. Thus, we recommend users to manually install dependent packages before installing eIF4F.analysis package.CRITICAL: If installation of some dependent packages requires to install or update non-Bioconductor packages, use install.packages for non-Bioconductor packages.The required packages will be automatically installed the first time you run eIF4F.analysis.4.Install eIF4F.analysis package in RStudio.> devtools::install_github5.Load eIF4F.analysis package in RStudio.> libraryInstall the development version of eIF4F.analysis package from GitHub with the following commands:6.Open the terminal and run the following command line to clone our GitHub repository for eIF4F.analysis package. This step will store all package files under home directory as ∼/eIF4F.analysis A.Figure https://github.com/a3609640/eIF4F.analysis$ git cloneNote: Installing eIF4F.analysis package in the Linux system is highly recommended.7.Under the ∼/eIF4F.analysis/Script folder B, there # default directory for data download and output storage> data_file_directory <- Sys.getenv(c("DATA_FILE_DIRECTORY"), unset = "∼/eIF4F.analysis/eIF4F_data")> output_directory <- Sys.getenv(c("OUTPUT_DIRECTORY"), unset = "∼/eIF4F.analysis/eIF4F_output")CRITICAL: By default, Download.R generates root directory paths ∼/eIF4F.analysis/eIF4F_data and ∼/eIF4F.analysis/eIF4F_output. These two directory paths are also set inside the package (in Load.R), and the values must agree in both places. The descriptions of the steps that follow assume the use of the default eIF4F_output location.We provide two R scripts in our GitHub repository for users to download datasets and to run eIF4F.analysis package. Users need to clone the package files from GitHub, and set up the directories for input and output files.Timing: 1 h8.Run the Download.R file in RStudio with the following command line.> sourceNote: Download times were observed with a 100 Mbps internet connection. Remote data sources mentioned here may offer limited and lower bandwidth.CRITICAL: By default, user will be able to clone all the scripts and R codes from Github repository, to download datasets, and to store analysis results (by default) under a single folder ∼/eIF4F.analysis.Execution of Download.R script creates two folders: ∼/eIF4F.analysis/eIF4F_data and ∼/eIF4F.analysis/eIF4F_output C. Downlo•Software: R version 4.2.1 and RStudio (2022.07.1 build 554).•Operating systems: The package was developed and tested with Linux OS (Pop!_OS 22.04 LTS).CRITICAL: We recommend Linux to run the package.•○Memory: 48 GB minimum.○Processors: tested with Intel Core i7-8700k CPU (6 cores), Intel Core i7-8550U CPU (4 cores).○Disk space: 30 GB minimum. The total disk space for eIF4F.analysis folder is 26.2 GB, including all downloads and the analysis results.Computer hardware:https://a3609640.github.io/eIF4F.analysis/reference/index.html.The package includes one initiation step, and seven major analysis steps. User can execute each analysis step with one exported function that calls a group of internal functions for data process, data analysis and plotting to achieve a set of analyses. This package organizes all functions related to each analysis step together as one R script under ∼/eIF4F.analysis/R Analysis.R contains ten exported functions in the package to initialize package and to execute all analyses presented in Wu and Wagner (2021).Timing: < 5 min1.Run the following command line to create the output directories to store the output files.> initialize_dirNote:initialize_dir creates sub-directories under ∼/eIF4F.analysis/eIF4F_output  and stores them as “TCGA_CNV_value.csv”, “TCGA_CNV_sampletype.csv” and “TCGA_CNVratio_sampletype.csv” under the ProcessedData folder.b.i.TCGA_GTEX_RNAseq_sampletype comes from the recomputed RNAseq dataset from both TCGA and GTEx, "TcgaTargetGtex_RSEM_Hugo_norm_count", and the annotation dataset "TcgaTargetGTEX_phenotype.txt".initialize_RNAseq_data reads the recomputed RNAseq data from both TCGA and GTEx. The implementation details of each operation are within the ∼/eIF4F.analysis/R/DEG.R file. initialize_RNAseq_data sets one global variable TCGA_GTEX_RNAseq_sampletype for the gene expression analysis (step-3), PCA (step-5) and correlating gene analysis (step-6), and stores TCGA_GTEX_RNAseq_sampletype as “TCGA_GTEX_RNAseq_sampletype.csv” in the ProcessedData folder.c.i.TCGA_RNAseq_OS_sampletype comes from three datasets: the RNAseq dataset "EB++AdjustPANCAN_IlluminaHiSeq_RNASeqV2.geneExp.xena", the survival dataset "Survival_SupplementalTable_S1_20171025_xena_sp" and the annotation dataset "TCGA_phenotype_denseDataOnlyDownload.tsv".initialize_survival_data reads the RNAseq and patient survival data from TCGA. The implementation details of this operation are within the ∼/eIF4F.analysis/R/Survival.R file. This function sets the global variable TCGA_RNAseq_OS_sampletype for survival analysis (step-4), and store TCGA_RNAseq_OS_sampletype as “TCGA_RNAseq_OS_sampletype.csv” inside the ProcessedData folder.d.i.This function sets three global variables for the CCLE data: (1) CCLE_RNAseq contains the RNAseq data derived from "CCLE_expression_full.csv", (2) CCLE_Anno contains the annotation data derived from "sample_info.csv", and (3) CCLE_Proteomics contains the protein expression level data derived from "protein_quant_current_normalized.csv". This function stores CCLE_RNAseq, CCLE_Anno and CCLE_Proteomics as “CCLE_RNAseq.csv”, “CCLE_Anno.csv”, and “CCLE_Proteomics.csv” inside the ProcessedData folder.ii.This function sets two global variables as data frames for the CPTAC LUAD data published in Gillette et al. (2020)initialize_proteomics_data reads the proteomics related data from CCLE and CPTAC LUAD, including: proteomics data, annotation data for cancer types, RNAseq data for the correlation analysis on protein RNA levels (step-7 and step-8). The implementation details of this operation are within the ∼/eIF4F.analysis/R/RNAProCorr.R file.e.i.CPTAC_LUAD_Phos contains the phosphoproteomics data published in Gillette et al. (2020)ii.CRITICAL: The first run of data initialization functions creates and stores the processed data from download files. Following runs of the initialization functions will check the existence of processed data files and read them, which take a much shorter time to complete than the first run. CPTAC_LUAD_Clinic_Sampletype contains the annotation data and is derived from "S046_BI_CPTAC3_LUAD_Discovery_Cohort_Clinical_Data_r1_May2019.xlsx" and "S046_BI_CPTAC3_LUAD_Discovery_Cohort_Samples_r1_May2019.xlsx".initialize_phosphoproteomics_data reads phospho-proteomics-related data from CPTAC LUAD, and sets two global variables with data frames for the protein expression analysis (step-8). The implementation details of this operation are in the ∼/eIF4F.analysis/R/Proteomics.R file. This function stores two global variables CPTAC_LUAD_Phos and CPTAC_LUAD_Clinic_Sampletype as “CPTAC_LUAD_Phos.csv” and “CPTAC_LUAD_Clinic_Sampletype.csv” in the ProcessedData folder.Run the following command line to acquire omics datasets from the download data files.Initialization processes rely on three exported functions to define subdirectories for output data, to define the graphic formats (font size and style), and to load data from downloaded data files. The definitions of three initialization functions were stored in ∼/eIF4F.analysis/R/Load.R.Timing: < 1 minEIF4F genes across TCGA tumors and creates the analysis results both on screen and as pdf files stored in ∼/eIF4F.analysis/eIF4F_output/CNV folder.4.Run the following command line in RStudio.> EIF4F_CNV_analysisNote:EIF4F_CNV_analysis is a wrapper function of three internal composite functions that take input data frames and call internal functions for analysis. Note:.plot_bargraph_CNV_TCGA takes the data frame TCGA_CNV_sampletype and calculates the frequency of each CNV status for EIF4F genes in all tumors combined from 33 TCGA cancer types. Its output is a stacked bar plot that ranks the EIF4F gene by the frequencies of copy number gain  from individual TCGA cancer types. This function produces a CNV ratio boxplot for each gene in individual TCGA cancer types  analysis to associate survival probabilities with gene expression. This function takes arbitrary gene expression cutoff, 0.2 for 20% or 0.3 for 30%, to stratify the patient groups based on the top or bottom precents of gene expression within their tumors. This function performs KM analysis on all combined TCGA cancer types  regression method. This function can perform survival analyses on all combined TCGA cancer types or individual cancer type such as “lung adenocarcinoma” as an argument. The function performs both univariable Cox-PH analysis using a single gene expression as the dependent variable  on Timing: < 30 minEIF4F subunits from tumor or healthy samples, and outputs results to the ∼/eIF4F.analysis/eIF4F_output/COR folder.8.Run the following command line in RStudio.> EIF4F_Corrgene_analysisNote:EIF4F_Corrgene_analysis is a wrapper function to call one internal composite function that takes input data frames and calls internal functions for analysis. Note:.plot_Corr_RNAseq_TCGA_GTEX takes the data frameTCGA_GTEX_RNAseq_sampletype and selects RNAseq data from two sample types: TCGA tumors, or GTEx healthy tissues. This function separately identifies correlating genes (CORs) of EIF4E, EIF4A1, EIF4G1, and EIF4EBP1 from tumor samples or from healthy tissues. The significant CORs for each EIF4F subunit are identified and classified as positive or negative CORs (posCORs and negCORs). This function analyzes the overlap posCORs or negCORs of four EIF4F subunits from tumor samples or healthy tissues as Venn plots  datasets, and outputs results to the ∼/eIF4F.analysis/eIF4F_output/RNApro folder.Timing: < 5 min10.Run the following command line in RStudio.> EIF4F_Proteomics_analysisNote:EIF4F_Proteomics_analysis is a wrapper function to call two internal composite functions that take input data frames and call internal functions for analysis. Note:.plot_scatterplot_protein_LUAD takes the data frame CPTAC_LUAD_Proteomics and selects the proteomics data of tumor samples. It analyzes the correlation between two input proteins across the LUAD tumor samples protein expression in different tumor stages, and outputs results to the ∼/eIF4F.analysis/eIF4F_output/proteomics folder.All analysis results are produced as plots on screen and as pdf files in output file directories. Examples of results from each analysis step are shown in The execution of this package relies on specific exported functions and does not allow parameter input within the package. However, for each analysis step, the internal composite functions, the required input data frames, and the dependent functions are stored within one R file E. Most ieIF4F.analysis package relies on many dependent packages for data analysis and plotting. Because those dependent packages are widely used for individual applications, their combined usage provides great convenience for users to achieve a thorough understand of eIF4F functions. However, a major limitation of this approach is that incompatibility may occur with future version changes, since those packages are maintained independently of each other.This package aims to provide an easy method to reliably reproduce the results from Wu and Wagner (2021),Attaching package: ‘eIF4F.analysis’The following objects are masked _by_ ‘.GlobalEnv’:initialize_data, initialize_dir, initialize_formatError messages during Preparation three: installing and loading eIF4F.analysis.It means that you have objects  present in your global environment with the same name as (exported) things in your package. Clean the environment and reload the package.> EIF4F_Corrgene_analysisFailed with error: org.Hs.egPFAM is defunct. Please use select if you need access to PFAM or PROSITE accessions.Note: The object org.Hs.egPFAM has not been not used for any operation in the script, thus this error message does not affect the results of the analyses.While running EIF4F_Corrgene_analysis at step-6: analyze the correlating genes (CORs) of EIF4F subunits, you run into the following error:> library(org.Hs.eg.db)Run the following command to reload the “org.Hs.eg.db” package. If the same error message of defunct org.Hs.egPFAM appears, please reinstall the "org.Hs.eg.db" package to the latest version (3.15.0).gerhard_wagner@hms.harvard.edu).Further information and requests for resources should be directed to and will be fulfilled by the lead contact, Gerhard Wagner (This study did not generate new unique reagents.