Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcftools 1.21 compatibility and typo fix in hatchet.ini #234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion script/hatchet.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ msr = 5000
# Minimum number of total reads per bin and sample
mtr = 5000

[cluster_bins_loc]
[cluster_bins]
diploidbaf = 0.08
# Minimum and maximum number of clusters to infer
# (using silhouette score for model selection)
Expand Down
4 changes: 3 additions & 1 deletion src/hatchet/utils/count_alleles.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def countAlleles(self, bamfile, samplename, chromosome):
self.dp,
self.snplist[chromosome],
)
cmd_query = "{} query -f '%CHROM\\t%POS\\t%REF,%ALT\\t%AD\\n' -i 'SUM(AD)<={} & SUM(AD)>={}'".format(
cmd_query = "{} query -f '%CHROM\\t%POS\\t%REF,%ALT\\t%AD\\n' -i 'SUM(INFO/AD)<={} & SUM(INFO/AD)>={}'".format(
self.bcftools, self.dp, self.mincov
)
if self.E:
Expand All @@ -287,6 +287,8 @@ def countAlleles(self, bamfile, samplename, chromosome):
stderr=err,
universal_newlines=True,
)
# Allow sp mpileup to receive a SIGPIPE if p2 exits. avoid deadlock
mpileup.stdout.close()
stdout, _ = query.communicate()
codes = map(lambda p: p.wait(), [mpileup, query])
if any(c != 0 for c in codes):
Expand Down
Loading