Skip to content

Commit

Permalink
feat(pipeline): add the feature of bypassing the gVCF check to the pi…
Browse files Browse the repository at this point in the history
…peline

fix the typo in setting java maximum Heap Space
  • Loading branch information
BinglanLi committed Apr 5, 2024
1 parent cc2120a commit d38005e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions preprocessor/pharmcat_pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ if __name__ == '__main__':
preprocessor_group = parser.add_argument_group('Preprocessor arguments')
preprocessor_group.add_argument('-0', '--missing-to-ref', action='store_true',
help='Assume genotypes at missing PGx sites are 0/0. DANGEROUS!.')
preprocessor_group.add_argument("-G", "--no-gvcf-check", action="store_true",
help="(Optional) do not check whether input is a gVCF, false by default.")
# matcher args
matcher_group = parser.add_argument_group('Named allele matcher arguments')
matcher_group.add_argument('-matcher', action='store_true',
Expand Down Expand Up @@ -110,6 +112,7 @@ if __name__ == '__main__':
help='The maximum memory PharmCAT should use (e.g. "64G"). This is passed on using '
'Java''s -Xmx. Alternatively, set using the JAVA_MAX_HEAP environment '
'variable.')

# misc args
parser.add_argument('-v', '--verbose', action='count', default=0,
help='Print more verbose messages')
Expand Down Expand Up @@ -277,11 +280,14 @@ lead to different results.
if len(vcf_files) == 0:
raise ReportableException('Error: no VCF input')

for file in vcf_files:
if preprocessor.is_gvcf_file(file):
raise ReportableException('%s is a gVCF file, which is not currently supported.\n'
'The PharmCAT VCF Preprocessor will support block gVCF in the future.'
% str(file))
if args.no_gvcf_check:
print('\nBypass the gVCF check.\n')
else:
for file in vcf_files:
if preprocessor.is_gvcf_file(file):
raise ReportableException('%s is a gVCF file, which is not currently supported.\n'
'See https://github.com/PharmGKB/PharmCAT/issues/79 for details.\n'
'If this is not a gVCF file, use -G to bypass.' % str(file))

if len(m_samples) == 0:
m_samples = preprocessor.read_vcf_samples(vcf_files[0], verbose=args.verbose)
Expand Down
2 changes: 1 addition & 1 deletion preprocessor/preprocessor/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def run_pharmcat(jar_location: Path, args: List[str], max_processes: int, max_me
verbose: int = 0):
command: List[str] = [common.JAVA_PATH, '-cp', str(jar_location.absolute())]
if max_memory:
command.extend(['-Xmx', max_memory])
command.extend(['-Xmx' + max_memory])
command.append('org.pharmgkb.pharmcat.BatchPharmCAT')
command.extend(args)
if max_processes:
Expand Down

0 comments on commit d38005e

Please sign in to comment.