kwongj / maskrc-svg

Masks recombination as detected by ClonalFrameML or Gubbins and draws an SVG
GNU General Public License v3.0
18 stars 6 forks source link

error #4

Closed zhaoxvwahaha closed 6 years ago

zhaoxvwahaha commented 6 years ago

I used the maskrc to parse the result of ClonalFrameML and got the following error, could you give some help: File "maskrc-svg.py", line 47 print(*args, file=sys.stderr, **kwargs) ^ SyntaxError: invalid syntax

The command I used is: python maskrc-svg.py --aln my.alignment.fa my.ClonalFrameML.prefix

kwongj commented 6 years ago

@zhaoxvwahaha

Could you please report:

  1. what version of maskrc-svg you are running maskrc-svg.py --version

  2. what version of python you are using which python

zhaoxvwahaha commented 6 years ago

maskrc-svg.py 0.4 Python 2.7.13

kwongj commented 6 years ago

You need to be running Python 3. If you have python 3 installed, try: python3 maskrc-svg.py -h

zhaoxvwahaha commented 6 years ago

Thank you very much for prompt reply, I'll upload my python firstly.

zhaoxvwahaha commented 6 years ago

Hi @kwongj , The maskrc-svg work well now, and I also have a question that: The "?" charactor in file "maskrc.aln" mean recombination region, right? If yes, the recombination events in file "prefix.cfml.importation_status.txt" are not same with the "?????" regions, for example there are 2 recombination events for 1-0008, but there are so many "?????" segments separately in file "maskrc.aln", so how can I understand that? Node Beg End 1-0008 169584 169625 1-0008 173225 173657

kwongj commented 6 years ago

It would depend on the other entries in the prefix.cfml.importation_status.txt file. This script just masks the regions listed in that file. Are those two lines the only entries in that file?

You may need to look at the documentation for ClonalFrameML to see what is reported in that file, but from what I recall, it also lists regions of recombination that apply to an entire clade, not just individual taxa.

zhaoxvwahaha commented 6 years ago

No, there are recombination events in other isolates and internal NODE, but for my isolate 1-0008, there are only 2 records. So, perhaps for one isolate, you will not only mark the regions in this isolate, but also mark the recombination regions of corresponding internal NODE, i.e. if 1-0008 belong to NODE1, NODE2 and NODE3, so the recombination events in these NODEs will also be showed in 1-0008 ?

kwongj commented 6 years ago

Yes, recombination regions defined in an ancestral node are applied to all the child taxa. If you draw the svg (--svg), the ancestral recombination regions are shown in grey blocks, while the extant recombination blocks are shown in the specified colour.

zhaoxvwahaha commented 6 years ago

Got it, thank you so much.

diaz13 commented 6 years ago

Hi i run this command : ./maskrc-svg.py --aln genome1.aln --out outfile clonalframeresult1 --svgcolour COLOUR --regions FILE --svg FILE

And i obtain this error: riting masked alignment to outfile ... Drawing SVG to FILE ... Traceback (most recent call last): File "./maskrc-svg.py", line 222, in rect(x,p,w,colour) # regions File "./maskrc-svg.py", line 183, in rect dwg.add(dwg.rect(insert=((xs)+5, (ph)+5), size=(w, h0.8), fill=colour)) File "/home/user/anaconda3/lib/python3.6/site-packages/svgwrite/elementfactory.py", line 68, in call return self.cls(args, kwargs) File "/home/user/anaconda3/lib/python3.6/site-packages/svgwrite/shapes.py", line 64, in init super(Rect, self).init(extra) File "/home/user/anaconda3/lib/python3.6/site-packages/svgwrite/base.py", line 69, in init self.update(extra) File "/home/user/anaconda3/lib/python3.6/site-packages/svgwrite/base.py", line 85, in update self.setitem(key, value) File "/home/user/anaconda3/lib/python3.6/site-packages/svgwrite/base.py", line 162, in setitem self.validator.check_svg_attribute_value(self.elementname, key, value) File "/home/user/anaconda3/lib/python3.6/site-packages/svgwrite/validator2.py", line 62, in check_svg_attribute_value self._check_svg_value(elementname, attributename, value) File "/home/user/anaconda3/lib/python3.6/site-packages/svgwrite/validator2.py", line 79, in _check_svg_value raise TypeError("'%s' is not a valid value for attribute '%s' at svg-element <%s>." % (value, attributename, elementname)) TypeError: 'COLOUR' is not a valid value for attribute 'fill' at svg-element .

i don't no why ??