Skip to content

Commit

Permalink
fix vcf-samples logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimens committed Jul 10, 2024
1 parent 47fd175 commit 63c0da1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/harpy/snakefiles/phase.smk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else:
linkarg = "--10x 1"

if samples_from_vcf:
bcfquery = subprocess.run(["bcftools", "query", "-l", variantfile], stdout=subprocess.PIPE)
bcfquery = subprocess.Popen(["bcftools", "query", "-l", variantfile], stdout=subprocess.PIPE)
samplenames = bcfquery.stdout.read().decode().split()
else:
samplenames = [Path(i).stem for i in bamlist]
Expand All @@ -38,9 +38,12 @@ else:
# toggle indel mode
if config["inputs"].get("genome", None):
genomefile = config["inputs"]["genome"]
bn = Path(genomefile).stem
geno = f"{bn}.fasta"
genofai = f"{bn}.fasta.fai"
if genomefile.lower().endswith(".gz"):
bn = Path(Path(genomefile).stem).stem
else:
bn = Path(genomefile).stem
geno = f"Genome/{bn}.fasta"
genofai = f"Genome/{bn}.fasta.fai"
indelarg = f"--indels 1 --ref {geno}"
indels = True
else:
Expand Down

0 comments on commit 63c0da1

Please sign in to comment.