plotTMB(inputDF, scale, Yrange = "adapt", cutoff = 1, output = "TMB_plot.pdf")
- inputDF: A panda dataframe containing two columns and however many rows of samples.
Column 1 is the category the sample belongs to.
Column 2 is the number of mutations in that sample.
Example:
Column1 | Column2 |
---|---|
Bladder-TCC | 25212 |
Bladder-TCC | 31114 |
Bladder-TCC | 36432 |
- scale: The number of base pairs sequenced in each sample.
The options are:
"exome", which assumes sequencing size of 55 Mb
"genome", which assumes sequencing size of 2800 Mb
"custom", which requires the input to have a 3rd column in the entry that specifies the number of Mbs for each sample to be divded by.
An integer indicating the scale of the sequencing
- Yrange: The range of Yaxis.
The options are:
"adapt", which will make the plot automatically adapt to the given datase
"cancer", which will set the range to 0.001 to 1000
A list of two numbers of powers of 10 indicating the Y-axis range. Example: [0.1,100]
- cutoff: The minimum number of mutations required in a sample to be included in a plot
defaulted at 1, must be larger than or equal to 0
- output: outputfile name
defaulted at "TMB_plot.pdf"
- redbar: redbar location
The redbar value can either be "median" or "mean" which is the value at which the red bar appears, default is "median"
- yaxis: Whether to show yaxis label or not
Defaulted at False
- ascend: Wether to arrange data in ascending order of the height of the redbar
Defaulted at True
- leftm: left margin
Defaulted at 1
- rightm: right margin
Defaulted at 0.3
- topm: top margin
Defaulted at 1
- bottomm: bottom margin
Defaulted at 1
- filterline: bottom margin
Defaulted at True
Will show the number of samples plotted over the number of samples included. When set to False, the divider and the total nubmer of samples plotted will be removed. It will also be automatically removed if no sample was filtered out
Exmaple 1: The full PCAWG dataset at default setting
inputDF = pd.read_table('exmapleInput1_pcawg.txt')
plotTMB(inputDF,"genome")
Exmaple 2: The full PCAWG dataset with redbar set at mean
inputDF = pd.read_table('exmapleInput1_pcawg.txt',redbar="mean")
plotTMB(inputDF,"genome", readbar = "mean")
Exmaple 3: The full PCAWG dataset with decending order
inputDF = pd.read_table('exmapleInput1_pcawg.txt',ascend=False)
plotTMB(inputDF, scale = "genome")
Example 4: Subtset of PCAWG dataset with Y axis adapts to input data
inputDF = pd.read_table('exmapleInput2_pcawg_less.txt')
plotTMB(inputDF, scale = "genome", Yrange = "adapt")
Example 5: Y axis set for standard cancer TMB range
inputDF = pd.read_table('exmapleInput2_pcawg_less.txt')
plotTMB(inputDF, scale = "genome", Yrange = "cancer")
Exmaple 6: Using custome input value for sequencing scale and Y axis range
inputDF = pd.read_table('exmapleInput2_pcawg_less.txt')
plotTMB(inputDF, scale = 2800, Yrange = [0.1,10])
Exmaple 7: Using cutoff to remove lower end outliers
inputDF = pd.read_table('exmapleInput3_signature.txt')
plotTMB(inputDF,"genome",cutoff =2)