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/v1.5.2 #89

Merged
merged 4 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed debug print/logging lines
  • Loading branch information
marcmaxson committed Jul 19, 2021
commit 8b5754e435910010bf56071daaf771e66caed30d
2 changes: 1 addition & 1 deletion methylprep/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def cli_process(cmd_args):
args.export_poobah = True
args.no_quality_mask = False

print(vars(args).items())
#print(vars(args).items())

run_pipeline(
args.data_dir,
Expand Down
24 changes: 12 additions & 12 deletions methylprep/processing/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,18 +630,18 @@ def __init__(self, idat_dataset_pair, manifest, retain_uncorrected_probe_intensi
if self.data_type not in ('float64','float32','float16'):
raise ValueError(f"invalid data_type: {self.data_type} should be one of ('float64','float32','float16')")

#if self.debug:
print(f"DEBUG SDC params:")
exclude = ['data_channel', 'man', 'snp_man', 'ctl_man', 'address_code', 'ctrl_green', 'ctrl_red', 'II',
'IG', 'IR', 'oobG', 'oobR', 'methylated', 'unmethylated', 'snp_methylated', 'snp_unmethylated', 'ibG', 'ibR']
for key,value in self.__dict__.items():
if key in exclude:
try:
print(f"-- {key}: {value.shape}")
except:
print(f"-- skipping {key}")
else:
print(f"-- {key}: {value}")
if self.debug:
print(f"DEBUG SDC params:")
exclude = ['data_channel', 'man', 'snp_man', 'ctl_man', 'address_code', 'ctrl_green', 'ctrl_red', 'II',
'IG', 'IR', 'oobG', 'oobR', 'methylated', 'unmethylated', 'snp_methylated', 'snp_unmethylated', 'ibG', 'ibR']
for key,value in self.__dict__.items():
if key in exclude:
try:
print(f"-- {key}: {value.shape}")
except:
print(f"-- skipping {key}")
else:
print(f"-- {key}: {value}")

def process_all(self):
"""Runs all pre and post-processing calculations for the dataset."""
Expand Down
4 changes: 2 additions & 2 deletions methylprep/processing/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def consolidate_values_for_sheet(data_containers, postprocess_func_colname='beta
# remove all failed probes by replacing with NaN before building DF.
sample._SampleDataContainer__data_frame.loc[sample._SampleDataContainer__data_frame[poobah_column] >= poobah_sig, postprocess_func_colname] = np.nan
elif poobah == True and poobah_column not in sample._SampleDataContainer__data_frame.columns:
print('DEBUG: missing poobah')
LOGGER.warning('DEBUG: missing poobah')

if sample.quality_mask == True and mask_column in sample._SampleDataContainer__data_frame.columns:
sample._SampleDataContainer__data_frame.loc[sample._SampleDataContainer__data_frame[mask_column].isna(), postprocess_func_colname] = np.nan
Expand Down Expand Up @@ -216,7 +216,7 @@ def merge_batches(num_batches, data_dir, filepattern):
if dfs: # pipeline passes in all filenames, but not all exist
dfs = pd.concat(dfs, axis='columns', join='inner') #.progress_apply(lambda x: x)
outfile_name = Path(data_dir, f"{filepattern}.pkl")
print(f"{filepattern}: {dfs.shape}")
LOGGER.info(f"{filepattern}: {dfs.shape}")
dfs.to_pickle(str(outfile_name))
del dfs # save memory.

Expand Down
2 changes: 1 addition & 1 deletion methylprep/processing/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
LOGGER = logging.getLogger(__name__)


def preprocess_noob(container, offset=15, pval_probes_df=None, quality_mask_df=None, nonlinear_dye_correction=True, debug=True, unit_test_oob=False): # v1.4.5+
def preprocess_noob(container, offset=15, pval_probes_df=None, quality_mask_df=None, nonlinear_dye_correction=True, debug=False, unit_test_oob=False): # v1.4.5+
""" NOOB pythonized copy of https://github.com/zwdzwd/sesame/blob/master/R/background_correction.R
- The function takes a SigSet and returns a modified SigSet with the background subtracted.
- Background is modelled in a normal distribution and true signal in an exponential distribution.
Expand Down