Skip to content

Commit

Permalink
fix(preprocessor): make search path precedence count
Browse files Browse the repository at this point in the history
Create list directly without using set to retain input order information.
  • Loading branch information
kuanyili authored and markwoon committed Nov 12, 2024
1 parent d2078f0 commit 1b5754d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions preprocessor/pharmcat_pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,20 @@ lead to different results.
script_dir: Path = Path(globals().get("__file__", "./_")).absolute().parent

# make sure we have pharmcat.jar
m_pharmcat_jar: Path = preprocessor.find_file(preprocessor.PHARMCAT_JAR_FILENAME, list({script_dir}))
m_pharmcat_jar: Path = preprocessor.find_file(preprocessor.PHARMCAT_JAR_FILENAME, [script_dir])
if m_pharmcat_jar is None:
print('Downloading %s...' % preprocessor.PHARMCAT_JAR_FILENAME)
m_pharmcat_jar = preprocessor.download_pharmcat_jar(script_dir, verbose=args.verbose)

# make sure we have pharmcat_positions.vcf.bgz
m_pharmcat_positions_vcf: Path = preprocessor.find_file(preprocessor.PHARMCAT_POSITIONS_FILENAME,
list({script_dir}))
m_pharmcat_positions_vcf: Path = preprocessor.find_file(preprocessor.PHARMCAT_POSITIONS_FILENAME, [script_dir])
if m_pharmcat_positions_vcf is None:
print('Downloading %s...' % preprocessor.PHARMCAT_POSITIONS_FILENAME)
m_pharmcat_positions_vcf = preprocessor.download_pharmcat_accessory_files(script_dir, verbose=args.verbose)

# make sure we have reference FASTA
m_reference_genome: Path = preprocessor.find_file(preprocessor.REFERENCE_FASTA_FILENAME,
list({m_pharmcat_positions_vcf.parent, script_dir}))
[m_pharmcat_positions_vcf.parent, script_dir])
if m_reference_genome is None:
print('Downloading reference FASTA. This may take a while...')
m_reference_genome = preprocessor.download_reference_fasta_and_index(m_pharmcat_positions_vcf.parent,
Expand Down
4 changes: 2 additions & 2 deletions preprocessor/pharmcat_vcf_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
m_pharmcat_positions_vcf = preprocessor.validate_file(args.reference_pgx_vcf)
else:
m_pharmcat_positions_vcf = preprocessor.find_file(preprocessor.PHARMCAT_POSITIONS_FILENAME,
list({Path.cwd(), script_dir}))
[Path.cwd(), script_dir])
if m_pharmcat_positions_vcf is None:
print('Downloading pharmcat_positions.vcf...')
m_pharmcat_positions_vcf = preprocessor.download_pharmcat_accessory_files(script_dir,
Expand All @@ -153,7 +153,7 @@
m_reference_genome = preprocessor.validate_file(args.reference_genome)
else:
m_reference_genome = preprocessor.find_file(preprocessor.REFERENCE_FASTA_FILENAME,
list({m_pharmcat_positions_vcf.parent, Path.cwd(), script_dir}))
[m_pharmcat_positions_vcf.parent, Path.cwd(), script_dir])
if m_reference_genome is None:
print('Downloading reference FASTA. This may take a while...')
m_reference_genome = preprocessor.download_reference_fasta_and_index(m_pharmcat_positions_vcf.parent,
Expand Down

0 comments on commit 1b5754d

Please sign in to comment.