Skip to content

Commit

Permalink
Update pymaf.MafFrame.plot_regplot_tmb:
Browse files Browse the repository at this point in the history
* Add new optional argument ``to_csv`` to 
:meth:`pymaf.MafFrame.plot_regplot_tmb` method.
  • Loading branch information
sbslee committed Aug 9, 2022
1 parent 9b6bc14 commit dd92ed8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changelog
* Update ``pyvcf`` submodule to accept "sites-only" VCF.
* Add new method :meth:`pyvcf.VcfFrame.filter_gsa`.
* Add new method :meth:`pyvcf.VcfFrame.duplicated`.
* Add new optional argument ``to_csv`` to :meth:`pymaf.MafFrame.plot_regplot_tmb` method.

0.35.0 (2022-07-12)
-------------------
Expand Down Expand Up @@ -41,7 +42,7 @@ Changelog
0.32.0 (2022-04-02)
-------------------

* Add new optional argument ``filter_off`` for :class:`pykallisto.KallistoFrame` constructor, which is useful for generating a simple count or tpm matrix.
* Add new optional argument ``filter_off`` to :class:`pykallisto.KallistoFrame` constructor, which is useful for generating a simple count or tpm matrix.
* Add new optional argument ``--dir-path`` to :command:`vcf-call` command for storing intermediate files.
* Add new optional argument ``--gap_frac`` to :command:`vcf-call` command so that users can control indel calling sensitivity.
* Add new optional argument ``--group-samples`` to :command:`vcf-call` command so that users can group samples into populations and apply the HWE assumption within but not across the populations.
Expand Down
8 changes: 7 additions & 1 deletion fuc/api/pymaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ def plot_regplot_gene(

def plot_regplot_tmb(
self, af, subject_col, group_col, a, b, ax=None, figsize=None,
**kwargs
to_csv=None, **kwargs
):
"""
Create a scatter plot with a linear regression model fit visualizing
Expand All @@ -1419,6 +1419,8 @@ def plot_regplot_tmb(
AnnFrame column containing sample group information.
a, b : str
Sample group names.
to_csv : str, optional
Write the plot's data to a CSV file.
ax : matplotlib.axes.Axes, optional
Pre-existing axes for the plot. Otherwise, crete a new one.
figsize : tuple, optional
Expand Down Expand Up @@ -1483,6 +1485,10 @@ def one_row(r):
print(f'R^2 = {results.rsquared:.2f}')
print(f' P = {results.f_pvalue:.2e}')

# Write the DataFrame to a CSV file.
if to_csv is not None:
df.to_csv(to_csv)

return ax

def plot_interactions(
Expand Down

0 comments on commit dd92ed8

Please sign in to comment.