Skip to content

Commit

Permalink
Added --force-samples argument. Added text to model file exception
Browse files Browse the repository at this point in the history
  • Loading branch information
aewebb80 committed Jan 28, 2021
1 parent 4232831 commit 12a8182
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pgpipe/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def create_ind_file (self, file_ext = '', file_path = '', overwrite = False):
if not overwrite:
# Check if the file already exists
if os.path.isfile(ind_filename):
raise IOError('Individuals file exists.')
raise IOError('Individuals file exists. Use --overwrite to ignore')

# Create the population file
ind_file = open(ind_filename, 'w')
Expand Down
15 changes: 14 additions & 1 deletion pgpipe/vcf_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@
Argument used to include positions with the specified filter flag.
**--filter-exclude-filtered** *<filter_flag>*
Argument used to exclude positions with the specified filter flag.
#############################
Other Command-line Arguments
#############################
**--force-samples**
Argument used to ignore the error rasied when a sample that does not exist
within the input VCF.
'''

import os
Expand Down Expand Up @@ -265,8 +273,9 @@ def metavar_list (var_list):

vcf_parser.add_argument('--out-format', metavar = metavar_list(out_format_list), help = 'Defines the desired output format', type = str, choices = out_format_list, default = out_format_default)

# General arguments.
# General arguments
vcf_parser.add_argument('--overwrite', help = "Overwrite previous output", action = 'store_true')
vcf_parser.add_argument('--force-samples', help = "Ignore the error rasied when a sample that does not exist", action = 'store_true')

# Galaxy Option to pipe log to stdout
vcf_parser.add_argument('--log-stdout', help = argparse.SUPPRESS, action = 'store_true')
Expand Down Expand Up @@ -654,6 +663,10 @@ def run (**kwargs):
if vcf_args.filter_mac_max != None:
bcftools_call_args.extend(['--max-ac', vcf_args.filter_mac_max])

# Check if samples should be forced
if vcf_args.force_samples:
bcftools_call_args.append('--force-samples')

# List to store expression for BCFtools include expression functionality
bcftools_expressions = []

Expand Down

0 comments on commit 12a8182

Please sign in to comment.