Class KaplanMeierFigure

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.biojava.nbio.survival.kaplanmeier.figure.KaplanMeierFigure
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class KaplanMeierFigure extends JPanel
Author:
Scooter Willis
See Also:
  • Constructor Details

    • KaplanMeierFigure

      public KaplanMeierFigure()
  • Method Details

    • getGroups

      public ArrayList<String> getGroups()
      Get the name of the groups that are being plotted in the figure
      Returns:
    • getSurvivalTimePercentile

      public Double getSurvivalTimePercentile(String group, double percentile)
      To get the median percentile for a particular group pass the value of .50.
      Parameters:
      group -
      percentile -
      Returns:
    • setKMFigureInfo

      public void setKMFigureInfo(KMFigureInfo kmfi)
      Parameters:
      kmfi -
    • getKMFigureInfo

      public KMFigureInfo getKMFigureInfo()
    • setFigureLineInfo

      public void setFigureLineInfo(ArrayList<String> lineInfoList)
      Parameters:
      lineInfoList -
    • setCoxInfo

      public void setCoxInfo(ArrayList<String> title, CoxInfo ci, String strataVariable, LinkedHashMap<String,String> legendMap, Boolean useWeighted) throws Exception
      Parameters:
      title - Title of figures
      ci -
      strataVariable - The column that based on value will do a figure line
      legendMap - Map the value in the column to something readable
      useWeighted -
      Throws:
      Exception
    • fmt

      public static String fmt(Double d, int precision, int pad)
      Parameters:
      d -
      precision -
      pad -
      Returns:
    • getSurvivalFitInfo

      public SurvFitInfo getSurvivalFitInfo()
      Returns:
    • setSurvivalData

      public void setSurvivalData(ArrayList<String> title, SurvFitInfo sfi, Double userSetMaxTime)
      Allow setting of points in the figure where weighted correction has been done and percentage has already been calculated.
      Parameters:
      title -
      sfi -
      userSetMaxTime -
    • setSurvivalData

      public void setSurvivalData(ArrayList<String> title, LinkedHashMap<String,ArrayList<CensorStatus>> survivalData, Boolean useWeighted) throws Exception
      The data will set the max time which will result in off time points for tick marks
      Parameters:
      title -
      survivalData -
      useWeighted -
      Throws:
      Exception
    • setSurvivalData

      public void setSurvivalData(ArrayList<String> title, LinkedHashMap<String,ArrayList<CensorStatus>> survivalData, Double userSetMaxTime, Boolean useWeighted) throws Exception
      Parameters:
      title -
      survivalData -
      userSetMaxTime -
      useWeighted -
      Throws:
      Exception
    • saveSurvivalData

      public void saveSurvivalData(String fileName) throws Exception
      Save data from survival curve to text file
      Parameters:
      fileName -
      Throws:
      Exception
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • getFileName

      public String getFileName()
      Returns:
      the fileName
    • getTop

      public int getTop()
      Returns:
      the top
    • getBottom

      public int getBottom()
      Returns:
      the bottom
    • getLeft

      public int getLeft()
      Returns:
      the left
    • getRight

      public int getRight()
      Returns:
      the right
    • getxAxisTimeValues

      public ArrayList<Double> getxAxisTimeValues()
      Returns:
      the xAxisTimeValues
    • getxAxisTimeCoordinates

      public ArrayList<Integer> getxAxisTimeCoordinates()
      Returns:
      the xAxisTimeValues
    • getTimeAxisIncrementPercentage

      public Double getTimeAxisIncrementPercentage()
      Get the percentage increment for the time axis
      Returns:
    • savePNGKMNumRisk

      public void savePNGKMNumRisk(String fileName)
      Combine the KM and Num risk into one image
      Parameters:
      fileName -
    • savePNG

      public void savePNG(String fileName)
      Parameters:
      fileName -
    • main

      public static void main(String[] args)
      Parameters:
      args - the command line arguments