ProteomicsVisualization
ProteomicsVisualization copied to clipboard
fig 4 and fig 5 issues
Hi, julia
I send you the errors that I get when running the code
fig 4
first error in this cell of the section Read yeast go annotations downloaded from Uniprot:
yeast_go = format_uniprot_annotations(yeast_go) yeast_go
AttributeError Traceback (most recent call last) Cell In[13], line 1 ----> 1 yeast_go = format_uniprot_annotations(yeast_go) 2 yeast_go
Cell In[9], line 32, in format_uniprot_annotations(df, sep, regex)
28 # iterate proteins
29 for e,row in df.iterrows():
30
31 # iterate annotation types
---> 32 for t,a in row.iteritems():
33 try:
34 # skip empty strings
35 if str(a) in ["", "nan"]:
File ~\anaconda3\envs\prot_vis\lib\site-packages\pandas\core\generic.py:5989, in NDFrame.getattr(self, name) 5982 if ( 5983 name not in self._internal_names_set 5984 and name not in self._metadata 5985 and name not in self._accessors 5986 and self._info_axis._can_hold_identifiers_and_holds_name(name) 5987 ): 5988 return self[name] -> 5989 return object.getattribute(self, name)
AttributeError: 'Series' object has no attribute 'iteritems'
#then i cant run all the cells linked to the output "yeast_go"
fig 5 #from this part i was able to run the code until the "radar plot" section when trynging to execute this cell...
fig_radar = px.line_polar(ap4_av_profiles.stack("Fraction").reset_index().rename({0: "value"}, axis=1),
r="value", theta="Fraction", line_group="Compartment", line_close=True,
color="Compartment", color_discrete_sequence=px.colors.qualitative.D3)
.update_layout(width=500, height=230, font_size=8, margin=dict(t=20, b=0, r=0, l=20), template="simple_white")
.update_polars(radialaxis=dict(showgrid=True, gridcolor="darkgrey"),
angularaxis=dict(showgrid=True, gridcolor="darkgrey"))
fig_radar
AttributeError Traceback (most recent call last)
Cell In[30], line 1
----> 1 fig_radar = px.line_polar(ap4_av_profiles.stack("Fraction").reset_index().rename({0: "value"}, axis=1),
2 r="value", theta="Fraction", line_group="Compartment", line_close=True,
3 color="Compartment", color_discrete_sequence=px.colors.qualitative.D3)
4 .update_layout(width=500, height=230, font_size=8, margin=dict(t=20, b=0, r=0, l=20), template="simple_white")
5 .update_polars(radialaxis=dict(showgrid=True, gridcolor="darkgrey"),
6 angularaxis=dict(showgrid=True, gridcolor="darkgrey"))
7 fig_radar
File ~\anaconda3\envs\prot_vis\lib\site-packages\pandas\core\generic.py:5989, in NDFrame.getattr(self, name) 5982 if ( 5983 name not in self._internal_names_set 5984 and name not in self._metadata 5985 and name not in self._accessors 5986 and self._info_axis._can_hold_identifiers_and_holds_name(name) 5987 ): 5988 return self[name] -> 5989 return object.getattribute(self, name)
AttributeError: 'Series' object has no attribute 'stack'
thank you
joaquin