Skip to content

Commit

Permalink
column order snakemake-workflows#2
Browse files Browse the repository at this point in the history
  • Loading branch information
tedil committed Sep 17, 2021
1 parent 9812631 commit 7e4eb45
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions workflow/scripts/plotly_plot_logcount.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ def main(snakemake):

counts = pd.read_csv(snakemake.input.logcounts, sep="\t")
counts = counts.set_index("gene")
counts = (
counts.loc[set(counts.index) & (diffexp_genes | genes_of_interest)]
.reset_index()
.set_index(["transcript", "gene"])
.reset_index()
)
counts = counts.loc[
set(counts.index) & (diffexp_genes | genes_of_interest)
].reset_index()

id_vars = ["transcript", "gene"]
value_vars = list(counts.columns[2:])
counts.columns = id_vars + value_vars
id_vars = ["transcript", "gene"]
counts = counts.reindex(columns=id_vars + value_vars)
counts = pd.melt(
counts, id_vars=id_vars, value_vars=value_vars, value_name="logcount"
)
Expand Down

0 comments on commit 7e4eb45

Please sign in to comment.