Skip to content

Commit dbd6b37

Browse files
authored
Merge pull request #21 from bcgsc/lai_gzip
Fix --lai mode to work with gzipped reference files
2 parents 39b8717 + 3105136 commit dbd6b37

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

ntRootAncestryPredictor.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ sub usage_page {
234234
if ($verbose) {
235235
print "\n\tnz: Non-zero\n";
236236
}
237-
print "\n\nAncestry predictions available in:\n$out\n\n";
237+
print "\n\nAncestry predictions available in:\n$out\n";
238+
239+
if ($tile_resolution) {
240+
print $f . "_ancestry-predictions-tile-resolution_tile$dw.tsv\n";
241+
}
242+
print "\n";
238243

239244
exit(0);

ntroot_run_pipeline.smk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ rule samtools_faidx:
100100
output: out_fai = f"{draft_base}.fai"
101101
params:
102102
benchmark = f"{time_command} samtools_faidx_{draft_base}.time"
103-
shell:
104-
"{params.benchmark} samtools faidx -o {output.out_fai} {input.reference}"
103+
run:
104+
if input.reference.endswith(".gz"):
105+
shell("{params.benchmark} gunzip -c {input.reference} |samtools faidx -o {output.out_fai} -")
106+
else:
107+
shell("{params.benchmark} samtools faidx -o {output.out_fai} {input.reference}")
105108

106109
rule ancestry_prediction:
107110
input:

0 commit comments

Comments
 (0)