Mercurial > repos > mvdbeek > damid_deseq2_to_peaks
comparison damid_deseq2_to_peaks.py @ 1:edca422b6cd6 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/damid_deseq2_to_peaks commit 77e1df794a4bceebf80dc0d800c18577c531a277
author | mvdbeek |
---|---|
date | Tue, 08 Jan 2019 04:01:54 -0500 |
parents | 3fd7995da4fd |
children |
comparison
equal
deleted
inserted
replaced
0:3fd7995da4fd | 1:edca422b6cd6 |
---|---|
24 | 24 |
25 | 25 |
26 def significant_gatcs_to_peaks(df, p_value_cutoff): | 26 def significant_gatcs_to_peaks(df, p_value_cutoff): |
27 # Add `pass` column for sig. GATCs | 27 # Add `pass` column for sig. GATCs |
28 df['pass'] = 0 | 28 df['pass'] = 0 |
29 df.loc[df[6] < p_value_cutoff, 'pass'] = 1 | 29 df.loc[(df[6] < p_value_cutoff) & (df[2] > 0), 'pass'] = 1 |
30 # Create pass_id column for consecutive pass or no-pass GATCs | 30 # Create pass_id column for consecutive pass or no-pass GATCs |
31 # True whenever there is a value change (from previous value): | 31 # True whenever there is a value change (from previous value): |
32 df['pass_id'] = df.groupby('chr')['pass'].diff().ne(0).cumsum() | 32 df['pass_id'] = df.groupby('chr')['pass'].diff().ne(0).cumsum() |
33 gb = df.groupby('pass_id') | 33 gb = df.groupby('pass_id') |
34 # aggregate | 34 # aggregate |