|
25 | 25 | from sklearn.linear_model import LinearRegression |
26 | 26 | import logomaker |
27 | 27 |
|
28 | | -from . import helper, utils |
| 28 | +from . import helper, utils, report |
29 | 29 | from .concepts import ConceptBuilder |
30 | 30 | from .tpcav_model import TPCAV |
31 | 31 | from matplotlib import gridspec |
@@ -615,7 +615,7 @@ def load_custom_motif_info(key): |
615 | 615 | cavs_fscores_df['AUC_fscores_residual'] = residuals |
616 | 616 | plot_reg(data=cavs_fscores_df, x='avg_len', y='AUC_fscores', ax=axes[0]) |
617 | 617 | plot_reg(data=cavs_fscores_df, x='avg_gc', y='AUC_fscores', ax=axes[1]) |
618 | | - axes[2].set_axis('off') |
| 618 | + axes[2].axis('off') |
619 | 619 |
|
620 | 620 | cavs_fscores_df.sort_values("AUC_fscores_residual", ascending=False, inplace=True) |
621 | 621 | else: |
@@ -648,7 +648,9 @@ def run_tpcav( |
648 | 648 | num_pc: Union[str,int]='full', |
649 | 649 | p=1, |
650 | 650 | max_pending_jobs=4, |
651 | | - save_cav_trainer=True |
| 651 | + save_cav_trainer=True, |
| 652 | + generate_html_report=True, |
| 653 | + html_report_fscore_thresh=0.9, |
652 | 654 | ): |
653 | 655 | """ |
654 | 656 | One-stop function to compute CAVs on motif concepts and bed concepts, compute AUC of motif concept f-scores after correction |
@@ -765,4 +767,9 @@ def run_tpcav( |
765 | 767 | else: |
766 | 768 | cavs_fscores_df = None |
767 | 769 |
|
| 770 | + if generate_html_report: |
| 771 | + report.generate_tcav_html_report(str(output_path / f"report.html"), motif_cav_trainers, |
| 772 | + extra_cav_trainers = {'bed concepts': bed_cav_trainer}, |
| 773 | + motif_file=motif_file, motif_file_fmt=motif_file_fmt, fscore_thresh=html_report_fscore_thresh) |
| 774 | + |
768 | 775 | return cavs_fscores_df, motif_cav_trainers, bed_cav_trainer |
0 commit comments