cnvkit icon indicating copy to clipboard operation
cnvkit copied to clipboard

Hard coded additional GC content filter in fix.py module

Open tsivaarumugam opened this issue 3 years ago • 3 comments

Hello,

In cnvkit version 0.9.8 and above, there is a hard coded GC content filter at line number 125 in the "mask_bad_bins" definition in fix.py module commit.

I understand the reason behind the filter and referred the supporting article/publication as well, but this new condition is filters out approximately 10% of our regions of interest.

Is it possible to club this filtering condition with the existing --no-gc flag command line argument and add the hard coded values to params.py module along with preexisting hard code values, so that the filter can be toggled on or off by the user without modifying the code.

Attaching the screenshots for reference.

Kindly go through and let me know.

screenshot of code snippet cnvkits version 0.9.6 cnvkits_branch0 9 6_function_mask_bad_bins

screenshot of code snippet cnvkits version 0.9.8 cnvkits_branch_0 9 8_function_mask_bad_bins

Thanks

tsivaarumugam avatar May 05 '22 10:05 tsivaarumugam

Hi @tsivaarumugam,

I took a look and I do not think it is possible to connect this hard-coded GC filter you mention, to --no-gc param => Simply because they do not actionnate the same thing :

  • --no-gc param toggles whether or not "correction for GC biais" is made (fix_gc==False if fix --no-gc) : https://github.com/etal/cnvkit/blob/e29ec7de7bdd03892820a7a712c284c46b580dda/cnvlib/fix.py#L86-L90

  • Whereas mask_bad_bins() is always run, in order to filter bad bins (ie ones having extreme values of GC-content, as shown by your 2nd screenshot) : https://github.com/etal/cnvkit/blob/e29ec7de7bdd03892820a7a712c284c46b580dda/cnvlib/fix.py#L72

But I can probably submit a PR adding a new EXTREME_GC_FRACTION param to params.py, as you suggested => And you will just have to set it to 1 to disable GC-masking of bad bins

Hope this helps ! Have a nice day. Felix.

tetedange13 avatar Jun 08 '22 16:06 tetedange13

Hi Felix,

Thanks for the reply. Yes the "EXTREME_GC_FRACTION" parameter option sounds reasonable and good to me. could you please do the needful changes in the params.py to make the hardcoded values as tunable command line parameter switch.

Thank you for the help and your valuable time.

Thanks & best regards, Siva T


From: tetedange13 @.> Sent: Wednesday, June 8, 2022 6:54 PM To: etal/cnvkit @.> Cc: Siva Arumugam @.>; Mention @.> Subject: Re: [etal/cnvkit] Hard coded additional GC content filter in fix.py module (Issue #738)

Hi @tsivaarumugamhttps://github.com/tsivaarumugam,

I took a look and I do not think it is possible to connect this hard-coded GC filter you mention, to --no-gc param => Simply because they do not actionnate the same thing :

  • --no-gc param toggles whether or not "correction for GC biais" is made (fix_gc==False if fix --no-gc) : https://github.com/etal/cnvkit/blob/e29ec7de7bdd03892820a7a712c284c46b580dda/cnvlib/fix.py#L86-L90

  • Whereas mask_bad_bins() is always run, in order to filter bad bins (ie ones having extreme values of GC-content, as shown by your 2nd screenshot) : https://github.com/etal/cnvkit/blob/e29ec7de7bdd03892820a7a712c284c46b580dda/cnvlib/fix.py#L72

But I can probably submit a PR adding a new EXTREME_GC_FRACTION param to params.py, as you suggested => And you will just have to set it to 1 to disable GC-masking of bad bins

Hope this helps ! Have a nice day. Felix.

— Reply to this email directly, view it on GitHubhttps://github.com/etal/cnvkit/issues/738#issuecomment-1150161863, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWERYB56YNFREAQ73OGYUGLVODF5PANCNFSM5VEU4PTQ. You are receiving this because you were mentioned.Message ID: @.***>

tsivaarumugam avatar Jun 10 '22 04:06 tsivaarumugam

Hi Felix and Siva, thanks for your attention to this. I like the solution of specifying the thresholds in params.py to ensure they're used consistently across the analysis (#753), rather than specifying a command-line option each time (#752). I'll comment in those PRs.

etal avatar Aug 31 '22 03:08 etal