在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):aebergl/MatSurv开源软件地址(OpenSource Url):https://github.com/aebergl/MatSurv开源编程语言(OpenSource Language):MATLAB 100.0%开源软件介绍(OpenSource Introduction):MatSurvMatSurv is a simple survival analysis function for MATLAB (version 2016b and later) that creates a KM plot with risk table. Survival statistics, such as log-rank p-value and hazard ratio (HR) are also calculated. The log-rank test has been evaluated to give the same results as SAS and R. The style of the KM plot is easily changed with input parameters. No additional toolboxes are needed or depended upon. MatSurv was inspired by the survminer R-package. The general usage is: [p, fh, stats] = MatSurv(TimeVar, EventVar, GroupVar, 'param', value, …) Table of contents
Why MatsurvMatSurv allows MATLAB users to create KM-plots with a risk table and also to perform a log-rank test between two or more groups. An event is, for example, death, relapse of disease, or a new metastatic tumor. If none of these events occur during the study period, the time-to-event is unknown, this point is called censored. A risk table describe the number of patients that are still “at-risk” at a specific timepoint. MatSurv also provides a fine grained customization of the KM-plots, making it suitable for publications. MatSurv hopefully will make the life easier for fellow Bioinformaticians (and other professionals) who prefer MATLAB over R. Citing MatSurvCreed et al., (2020). MatSurv: Survival analysis and visualization in MATLAB. Journal of Open Source Software, 5(46), 1830, https://doi.org/10.21105/joss.01830 MATLAB Release CompatibilityCompatible with R2016b to R2019b Recent Improvements2022-02-17 : Added options to use all four quartile groups, use 2020-04-08 : Added logrank test for trend, use Simple ExampleThe following code loads the data from "Freireich, EJ et al. 1963, Blood, 21, 699-716)" and creates a KM plot with risk table. The time unit is weeks and the x-axis step length is changed to 4. The risk table shows how many are at risk (alive) for each time point. Censored points are marked with a vertical line. [p,fh,stats]=MatSurv([], [], [],'Xstep',4);
Using MatSurvInstallationSimply put MatSurv.m in any directory of your choice and make sure it is added to your path. UsageMatSurv(TimeVar, EventVar, GroupVar,'param', value, ...) creates a Kaplan-Meier plot with a risk table and calculates a log-rank p-value. [p] = MatSurv( ... ) returns the log-rank p-value [p, fh] = MatSurv( ... ) returns both p-value and figure handle [p, fh, stats] = MatSurv( ... ) returns additions stats from the log-rank test [p, fh, stats] = MatSurv([], [], [], ... ) loads a test dataset from "Freireich, EJ et al. 1963, Blood, 21, 699-716" INPUTS:
OUTPUTS:
struct with fields:
GroupNames: Cell with group names
p_MC: log rank p-value (Mantel-Cox)
Chi2_MC: Chi square (Mantel-Cox)
HR_logrank: Hazard Ratio (log rank)
HR_95_CI_logrank: 95 percentile Confidence Intervals [lower upper]
HR_logrank_Inv: Inverted Hazard Ratio (log rank)
HR_95_CI_logrank_Inv: Inverted 95 percentile Confidence Intervals [lower upper]
HR_MH: Hazard Ratio (Mantel-Haenszel)
HR_95_CI_MH: 95 percentile Confidence Intervals [lower upper]
HR_MH_Inv: Inverted Hazard Ratio (Mantel-Haenszel)
HR_95_CI_MH_Inv: Inverted 95 percentile Confidence Intervals [lower upper]
MedianSurvivalTime: Median survival time for each group
More ExamplesAdditional optionsBelow are some examples for how to create different styles of KM plots and also how one can make changes using the figure handle. In the example below, we show how we can change some of the properties of the KM plot via various name-value pair arguments.
[p,fh,stats]=MatSurv([],[],[],'Xstep',4,...
'TitleOptions',{'Color','r','Interpreter','none'},'InvHR',1,...
'Xlim',32,'XMinorTick',3,'LineColor',[0 0 1;1 0 1],'LineStyle',{'-',':'},...
'LineWidth',3,'CensorLineColor','k','RT_KMplot',1);
Example with multiple groupsThis example is taken from the TCGA laml data set. Obtaining the data from cBioPortal can be found in the MatSurv/Article/MATLAB/get_laml_RC_data.m script. The samples are diveded into three groups based on their Cyto score. It is clear from the KM-Plot below that these groups have different outcomes. For this example we will load the data directly. load laml_RC_data.mat
[p,fh,stats]=MatSurv(laml_RC_TimeVar, laml_RC_EventVar, laml_RC_GroupVar,...
'GroupsToUse', {'Good','Intermediate','Poor'},'Xstep',24); Example with merging groupsGroups can be merged using a multilevel cell as GroupToUse input This example will merge the poor and N.D group. The first element in the cell array will define the name of the merged group and can either be the name of an existing group or a new group name. load laml_RC_data.mat
[p,fh,stats]=MatSurv(laml_RC_TimeVar, laml_RC_EventVar, laml_RC_GroupVar,...
'GroupsToUse', {'Good','Intermediate',{'Poor + N.D.','Poor','N.D.'}},'Xstep',24); Example with gene expression dataThis example is also taken from the TCGA LAML dataset but we in this example we will be using RNAseq gene expression data for the hepatocyte growth factor (HGF) gene. HGF gene expression has been related to outcome in a variety of cancers, including of the lungs, pancreas, thyroid, colon, and breast. Obtaining the data from cBioPortal can be found in the MatSurv/Article/MATLAB/get_laml_HGF_gene_data.m script. The expression level of a gene is continues and if no prior knowledge is available, the median is frequqently used to divide the samples into two groups, see the first graph below. Using the top 25% and bottom 25%, quartiles, is also frequently used, see the second graph below. Finally, if one or several cut-points level are known, these can also be used, third graph below. For this example we will load the data directly. load laml_HGF_gene_data.mat
% Using median cut
[p,fh,stats]=MatSurv(laml_HGF_gene_TimeVar,laml_HGF_gene_EventVar,HGF_gene,'Xstep',12,'InvHR',1);
% Using quartile
[p,fh,stats]=MatSurv(laml_HGF_gene_TimeVar,laml_HGF_gene_EventVar,HGF_gene,'Xstep',12,'InvHR',1,...
'CutPoint','quartile');
% Using Two Cut points
[p,fh,stats]=MatSurv(laml_HGF_gene_TimeVar,laml_HGF_gene_EventVar,HGF_gene,'Xstep',12,'InvHR',1,...
'CutPoint',[6 12]);
Median cutQuartileTwo cut pointsUnit TestA test script for MatSurv can be found in the UnitTest directory. List of all input options
KM plot options
Risk table plot options
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论