Skip to content

Commit

Permalink
Merge pull request #44 from uclahs-cds/abesh-handle-file-types
Browse files Browse the repository at this point in the history
Add filetype check for unsupported cases
  • Loading branch information
Arpi Beshlikyan authored Jul 25, 2022
2 parents 30f4507 + 0901d5b commit 343f471
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Single source package version from \_\_init__.py
- Use `pysam` instead of `samtools` in bam file validation.

### Fixed
- Add handling for valid file types whose validation is not yet implemented.

---

## [2.1.6] - 2021-10-18
Expand Down
5 changes: 4 additions & 1 deletion validate/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,16 @@ def fastq_case():
if file_extension in ('.fastq', '.fq'):
warnings.warn('Warning: fastq or fq file is not zipped')

def unsupported_case():
raise TypeError('File type not yet supported by PipeVal.')

file_type_switcher ={
'file-bam': bam_case,
'file-vcf': vcf_case,
'file-fastq': fastq_case
}

file_type_switcher[file_type]()
file_type_switcher.get(file_type, unsupported_case)()

return True

Expand Down

0 comments on commit 343f471

Please sign in to comment.