Created
December 26, 2019 16:55
-
-
Save clintval/036caa888c910d1976acc520cb2b4290 to your computer and use it in GitHub Desktop.
Validate the S3 URIs in some delimited sample sheets actually exist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # After a `pip install sample-sheet pendant` | |
| from sample_sheet import SampleSheet | |
| from pendant.aws.s3 import S3Uri | |
| def s3_validate_sample_sheet(path): | |
| for sample in SampleSheet(path): | |
| left = S3Uri(sample.PathToFastq1) | |
| right = S3Uri(sample.PathToFastq2) | |
| assert left.object_exists() | |
| assert right.object_exists() | |
| def s3_validate_sample_merging_config(path): | |
| with open(path) as handle: | |
| next(handle) # Consume the header | |
| for line in handle: | |
| sample, library, prefix = line.strip().split(',') | |
| assert S3Uri(f'{prefix}/{sample}.{library}/{sample}.{library}.raw.mapped.bam').object_exists() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment