Skip to content

Commit

Permalink
added max_sr_support and max_pe_support options to filter-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Joey Arthur committed Jul 6, 2018
1 parent 54bd9a0 commit ab06052
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arcsv/filter_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,16 @@ def apply_filters(opts, records, header):
supporting_splits = [int(x) for x in sv[col_lookup['sr_support']].split(',')]
if min(supporting_splits) < opts['min_sr_support']:
continue
if opts['max_sr_support'] is not None and \
max(supporting_splits) > opts['max_sr_support']:
continue
# discordant paired-end read support
supporting_pe = [int(x) for x in sv[col_lookup['pe_support']].split(',')]
if min(supporting_pe) < opts['min_pe_support']:
continue
if opts['max_pe_support'] is not None and \
max(supporting_pe) > opts['max_pe_support']:
continue
# allele fraction
af = float(sv[col_lookup['af']])
if af < opts['min_allele_fraction'] or af > opts['max_allele_fraction']:
Expand Down
2 changes: 2 additions & 0 deletions bin/arcsv
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ def add_filter_parser(subparsers):
parser_filter.add_argument('--min_sr_support', required=False, type=int, default=0,
help='minimum supporting split reads '
'(required at each breakpoint in case num_sv > 1)')
parser_filter.add_argument('--max_sr_support', required=False, type=int)
parser_filter.add_argument('--min_pe_support', required=False, type=int, default=0,
help='minimum supporting discordant read pair cluster size '
'(required at each breakpoint in case num_sv > 1)')
parser_filter.add_argument('--max_pe_support', required=False, type=int)
parser_filter.add_argument('--min_allele_fraction', required=False, type=float, default=0,
help='minimum predicted allele fraction of alternate alleles')
parser_filter.add_argument('--max_allele_fraction', required=False, type=float, default=1,
Expand Down

0 comments on commit ab06052

Please sign in to comment.