Skip to content

added function to easily plot signatures from exposures signatures an… - #3

Open
wir963 wants to merge 1 commit into
masterfrom
feat-plot-signatures
Open

added function to easily plot signatures from exposures signatures an…#3
wir963 wants to merge 1 commit into
masterfrom
feat-plot-signatures

Conversation

@wir963

@wir963 wir963 commented Dec 18, 2018

Copy link
Copy Markdown

…d counts

@wir963
wir963 requested a review from mdml December 18, 2018 20:58

@mdml mdml left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine but we should clean up before merging:

  • Describe contributions and testing in pull request. Also include an example output plot.
  • The build is broken. What's going on there? Would be great to have one of these plots automatically produced by Travis as well

# counts_df is samples-by-categories
# exposures_df samples-by-signatures
# signatures_df is signatures-by-categories
def plot_signatures(counts_df, signature_df, exposure_df, output_file):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add palette and ylabel as optional arguments

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More specifically, try to make the function call match the sbs_signature_plot (since you are eventually calling tht)

# and calculate the number of mutations attribution to signature i in sample j
contrib += exposure_df.loc[sample, sig]*counts_df.loc[sample].sum() # calculate the contribution
output.append(signature_df.loc[sig]*contrib)
#contribs[sig].append(phi[i]*contrib)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we need to keep commented out code around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants