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

error running HetMajorityProb.py #1

Open
ovidp opened this issue Jul 9, 2019 · 5 comments
Open

error running HetMajorityProb.py #1

ovidp opened this issue Jul 9, 2019 · 5 comments

Comments

@ovidp
Copy link

ovidp commented Jul 9, 2019

We are having an issue running HetMajorityProb.py. Python version is 2.7.12 Can you please help? Thanks

zcat sfilt.geno.gz | python ~/2bRAD_denovo/HetMajorityProb.py | awk '$6 < 0.75 {print $1"\t"$2}' > allSites
awk: cmd. line:1: $6 < 0.75 {print $1"\t"$2}
awk: cmd. line:1: ^ backslash not last character on line
Traceback (most recent call last):
File "/home/2bRAD_denovo/HetMajorityProb.py", line 28, in
stdout.write("\t".join([chrom, pos, str(len(pr_heteroz)), str(num_heteroz), str(h_expected), str(utail_prob)]) + "\n")
IOError: [Errno 32] Broken pipe

@nspope
Copy link

nspope commented Jul 9, 2019

What OS/shell are you using? I don't think the issue is on the python side -- my suspicion is that for whatever reason the shell is not treating the single quotes correctly in the awk part of the pipe. Try replacing the awk bit so that the commands are enclosed by double quotes (& escape the internal double quotes with a backslash):

... | awk "$6 < 0.75 {print $1\"\t\"$2}" >allSites (also try correction below)

@nspope
Copy link

nspope commented Jul 9, 2019

Whoops, you my also need to escape the dollar signs in this case (at least, that's necessary in bash):

... | awk "\$6 < 0.75 {print \$1\"\t\"\$2}" >allSites

@z0on
Copy link
Owner

z0on commented Jul 9, 2019 via email

@z0on
Copy link
Owner

z0on commented Jul 9, 2019 via email

@ovidp
Copy link
Author

ovidp commented Jul 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants