Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mouse #53

Merged
merged 13 commits into from
Apr 4, 2020
Prev Previous commit
Next Next commit
fixed pval probe detection bug where manifest and idat probe names do…
…n't match
  • Loading branch information
marcmaxson committed Apr 3, 2020
commit 3d39c3c1244ae15f1a0c626221f7aad5c8d53a46
8 changes: 6 additions & 2 deletions methylprep/processing/p_value_probe_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,18 @@ def _pval_sesame(data_containers):
return pval


def _pval_sesame_preprocess(data_container, column='mean_value', probe_column='IlmnID'):
def _pval_sesame_preprocess(data_container, column='mean_value'):
"""Performs p-value detection of low signal/noise probes. This ONE SAMPLE version uses meth/unmeth before it is contructed into a _SampleDataContainer__data_frame.
- returns a dataframe of probes and their detected p-value levels.
- this will be saved to the csv output, so it can be used to drop probes at later step.
- output: index are probes (IlmnID); one column [poobah_pval] contains the sample p-values."""
- output: index are probes (IlmnID or illumina_id); one column [poobah_pval] contains the sample p-values."""
meth = data_container.methylated.data_frame
unmeth = data_container.unmethylated.data_frame
manifest = data_container.manifest.data_frame[['Infinium_Design_Type','Color_Channel']]
if manifest.index.name != meth.index.name or manifest.index.name != unmeth.index.name:
raise KeyError(f"manifest probe_column ({manifest.dataframe.index.name}) does not match meth/unmeth probe names from idats ({meth.index.name}).")
probe_column = manifest.index.name

IG = manifest[(manifest['Color_Channel']=='Grn') & (manifest['Infinium_Design_Type']=='I')]
IR = manifest[(manifest['Color_Channel']=='Red') & (manifest['Infinium_Design_Type']=='I')]
II = manifest[manifest['Infinium_Design_Type']=='II']
Expand Down
4 changes: 1 addition & 3 deletions methylprep/processing/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,8 @@ def preprocess(self):
uncorrected_unmeth = self.unmethylated.data_frame.copy()

if self.pval == True:
# (self.methylated.data_frame, self.unmethylated.data_frame)
pval_probes_df = _pval_sesame_preprocess(self)
# df with one column named 'poobah_pval'
# missing: how to merge this df into the data_frame and actually drop probes
# output: df with one column named 'poobah_pval'

preprocess_noob(self) # apply corrections: bg subtract, then noob (in preprocess.py)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='methylprep',
version='1.2.5',
version='1.2.8',
description='Python-based Illumina methylation array preprocessing software',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
Expand Down