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

Issue with plotting CDS #32

Open
menickname opened this issue Jan 21, 2024 · 1 comment
Open

Issue with plotting CDS #32

menickname opened this issue Jan 21, 2024 · 1 comment

Comments

@menickname
Copy link

Dear

I tried to follow tutorial 2 on the example dataset and whenever plotting the CDS, I receive following error message. I have tried to resolve it myself without success.


AttributeError Traceback (most recent call last)
in <cell line: 9>()
7 elif feat.strand == -1:
8 minus_CDS.append(feat)
----> 9 gcircle.featureplot("NC_000913", source=plus_CDS, raxis_range=(700,780), facecolor="tomato")
10 gcircle.featureplot("NC_000913", source=minus_CDS, raxis_range=(780,860), facecolor="cornflowerblue")

/content/pycircos/pycircos.py in featureplot(self, garc_id, feature_type, source, raxis_range, facecolor, edgecolor, linewidth, spine)
1034 for feat in feature_list:
1035 if feat.location.strand >= 0:
-> 1036 s = int(feat.location.parts[0].start.position)
1037 e = int(feat.location.parts[-1].end.position)
1038 pos = start + ((end-start) * s/size)

AttributeError: 'ExactPosition' object has no attribute 'position'

Thank you in advance!

@anw-sh
Copy link

anw-sh commented Feb 19, 2024

Faced the same issue, hope you have solved it...
It worked for me after removing .position attribute after start and end in the pycircos.py

for feat in feature_list:
            if feat.location.strand >= 0:
                s = int(feat.location.parts[0].start) 
                e = int(feat.location.parts[-1].end)
                pos   = start + ((end-start) * s/size)
                width = start + ((end-start) * e/size) - pos    
                positions.append(pos) 
                widths.append(width)
            else:
                s = int(feat.location.parts[-1].start) 
                e = int(feat.location.parts[0].end)
                pos   = start + ((end-start) * s/size)
                width = start + ((end-start) * e/size) - pos    
                positions.append(pos) 
                widths.append(width)

Regards

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

2 participants