-1

I saw already many question on that topic but I cannot get any solution to my code. I believe that the problems comes from the space that I try to put between two arguments or from the sed command. Please I need some help. Thanks a lot

try:
print('filtering vcf files for hwe with: maf '+str(args.maf)+' minDP '+str(args.mdp)+' minQ '+str(args.q))
select_command = os.system("parallel --gnu -j"+str(args.t)+' '+args.vcf+"vcftools --vcf {} --out "+args.i+"$(echo $(basename {}) | sed 's/.vcf//') --remove-indels --maf "+str(args.maf)+" --min-meanDP "+str(args.mdp)+" --minQ "+str(args.q)+" --remove-filtered-all --remove-filtered-geno-all --hwe)

if select_command == 0 :
    print('done')
else :
    print('filtering hwe failed !')     
except OSError as e:
    print("Execution failed ", e)

SyntaxError: EOL while scanning string literal

  • Seems a missing end quote `"` at the very end, here `" --remove-filtered-all --remove-filtered-geno-all --hwe` – Iron Fist Jan 26 '16 at 17:11
  • Shame on me in 2 days I posted two typo errors :-/ I guess the worst part is that I really spend a day trying to figure out... – Stéphanie Arnoux Jan 27 '16 at 08:33
  • Next time you can see it while writing the question: you can see that your *if* is read but it should be blue (like *try*). Almost all the time, it indicate that there is a parsing error in the code you pasted. Good luck next time ;) – Thomas Ayoub Mar 01 '16 at 13:13

1 Answers1

1

You are using one extra quotation mark without a closing one.

select_command = os.system("parallel --gnu -j"+str(args.t)+' '+args.vcf+"vcftools --vcf {} --out "+args.i+"$(echo $(basename {}) | sed 's/.vcf//') --remove-indels --maf "+str(args.maf)+" --min-meanDP "+str(args.mdp)+" --minQ "+str(args.q) --remove-filtered-all --remove-filtered-geno-all --hwe)
ZetaRift
  • 332
  • 1
  • 9