jamescasbon / PyVCF

A Variant Call Format reader for Python.
http://pyvcf.readthedocs.org/en/latest/index.html
Other
404 stars 200 forks source link

vcf_filter.py python3 error with --output #327

Open ghost opened 3 years ago

ghost commented 3 years ago

When I try to use the --output arg to vcf_filter.py I get this traceback:

Traceback (most recent call last):
  File "/home/coyote/anaconda3/bin/vcf_filter.py", line 168, in <module>
    if __name__ == '__main__': main()
  File "/home/coyote/anaconda3/bin/vcf_filter.py", line 142, in main
    output = vcf.Writer(args.output, inp)
  File "/home/coyote/anaconda3/lib/python3.7/site-packages/vcf/parser.py", line 644, in __init__
    quotechar='', quoting=csv.QUOTE_NONE)
TypeError: argument 1 must have a "write" method

Do you mean to have this on line 142 of vcf_filter.py: output = vcf.Writer(open(args.output, 'w'), inp)

instead of this: output = vcf.Writer(args.output, inp)