Skip to content

Commit c18cf3c

Browse files
committed
Fixed missing rawstring for regexes.
1 parent 3c19ba2 commit c18cf3c

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

autoprot/analysis/qc.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ def tmt6plex_labeling_efficiency(evidence_under, evidence_sty_over, evidence_h_o
764764
evidence_under = evidence_under[
765765
~(
766766
evidence_under["Modified sequence"].str.contains(
767-
"\_\(Acetyl \(Protein N\-term\)\)"
767+
r"\_\(Acetyl \(Protein N\-term\)\)"
768768
)
769769
& evidence_under["Modified sequence"].str.contains("K")
770770
)
@@ -790,7 +790,7 @@ def tmt6plex_labeling_efficiency(evidence_under, evidence_sty_over, evidence_h_o
790790
) = ("",) * 7
791791

792792
if str(126) in raw:
793-
nterm = "\_\(TMT6plex\-Nterm126\)"
793+
nterm = r"\_\(TMT6plex\-Nterm126\)"
794794
lysine = (
795795
"TMT6plex-Lysine126" # modifications have to be named after MQ mod.list
796796
)
@@ -808,7 +808,7 @@ def tmt6plex_labeling_efficiency(evidence_under, evidence_sty_over, evidence_h_o
808808
if str(126) in entry
809809
][0]
810810
if str(127) in raw:
811-
nterm = "\_\(TMT6plex\-Nterm127\)"
811+
nterm = r"\_\(TMT6plex\-Nterm127\)"
812812
lysine = "TMT6plex-Lysine127"
813813
h_over = "TMT6plex (H)127"
814814
sty_over = "TMT6plex (STY)127"
@@ -824,7 +824,7 @@ def tmt6plex_labeling_efficiency(evidence_under, evidence_sty_over, evidence_h_o
824824
if str(127) in entry
825825
][0]
826826
if str(128) in raw:
827-
nterm = "\_\(TMT6plex\-Nterm128\)"
827+
nterm = r"\_\(TMT6plex\-Nterm128\)"
828828
lysine = "TMT6plex-Lysine128"
829829
h_over = "TMT6plex (H)128"
830830
sty_over = "TMT6plex (STY)128"
@@ -840,7 +840,7 @@ def tmt6plex_labeling_efficiency(evidence_under, evidence_sty_over, evidence_h_o
840840
if str(128) in entry
841841
][0]
842842
if str(129) in raw:
843-
nterm = "\_\(TMT6plex\-Nterm129\)"
843+
nterm = r"\_\(TMT6plex\-Nterm129\)"
844844
lysine = "TMT6plex-Lysine129"
845845
h_over = "TMT6plex (H)129"
846846
sty_over = "TMT6plex (STY)129"
@@ -856,7 +856,7 @@ def tmt6plex_labeling_efficiency(evidence_under, evidence_sty_over, evidence_h_o
856856
if str(129) in entry
857857
][0]
858858
if str(130) in raw:
859-
nterm = "\_\(TMT6plex\-Nterm130\)"
859+
nterm = r"\_\(TMT6plex\-Nterm130\)"
860860
lysine = "TMT6plex-Lysine130"
861861
h_over = "TMT6plex (H)130"
862862
sty_over = "TMT6plex (STY)130"
@@ -872,7 +872,7 @@ def tmt6plex_labeling_efficiency(evidence_under, evidence_sty_over, evidence_h_o
872872
if str(130) in entry
873873
][0]
874874
if str(131) in raw:
875-
nterm = "\_\(TMT6plex\-Nterm131\)"
875+
nterm = r"\_\(TMT6plex\-Nterm131\)"
876876
lysine = "TMT6plex-Lysine131"
877877
h_over = "TMT6plex (H)131"
878878
sty_over = "TMT6plex (STY)131"
@@ -893,20 +893,20 @@ def tmt6plex_labeling_efficiency(evidence_under, evidence_sty_over, evidence_h_o
893893
& (
894894
~(
895895
group["Modified sequence"].str.contains(
896-
"\_\(Acetyl \(Protein N\-term\)\)"
896+
r"\_\(Acetyl \(Protein N\-term\)\)"
897897
)
898898
)
899899
& (group["Modified sequence"].str.contains(nterm))
900900
)
901901
).sum()
902902

903903
df_efficiency.loc[raw, ["partially labeled"]] = (
904-
group["Modified sequence"].str.contains("\(TMT6plex").sum()
904+
group["Modified sequence"].str.contains(r"\(TMT6plex").sum()
905905
- df_efficiency.loc[raw, ["fully labeled"]].values
906906
)
907907

908908
df_efficiency.loc[raw, ["not labeled"]] = (
909-
~group["Modified sequence"].str.contains("\(TMT6plex")
909+
~group["Modified sequence"].str.contains(r"\(TMT6plex")
910910
).sum()
911911

912912
df_efficiency.loc[[under_experiment], "sum all labeled"] = (

autoprot/analysis/stat_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def ttest(
9090
'log2_Ratio H/L normalized BC36_1','log2_Ratio H/M normalized BC36_2',
9191
'log2_Ratio M/L normalized BC36_2']
9292
prot = pd.read_csv("../data/proteinGroups_minimal.zip", sep='\\t', low_memory=False)
93-
protRatio = prot.filter(regex="Ratio .\/. normalized").columns
93+
protRatio = prot.filter(regex=r"Ratio .\/. normalized").columns
9494
protLog = pp.log(prot, protRatio, base=2)
9595
prot_tt = ana.ttest(df=protLog, reps=twitchVsmild, cond="_TvM", return_fc=True, adjust_p_vals=True)
9696
prot_tt["pValue_TvM"].hist(bins=50)

autoprot/preprocessing/transformation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def log(
8282
--------
8383
First collect colnames holding the intensity ratios.
8484
85-
>>> protRatio = prot.filter(regex="^Ratio .\/.( | normalized )B").columns
86-
>>> phosRatio = phos.filter(regex="^Ratio .\/.( | normalized )R.___").columns
85+
>>> protRatio = prot.filter(regex=r"^Ratio .\/.( | normalized )B").columns
86+
>>> phosRatio = phos.filter(regex=r"^Ratio .\/.( | normalized )R.___").columns
8787
8888
Some ratios need to be inverted as a result from label switches.
8989
This can be accomplished using the invert variable.

autoprot/visualization/basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ def volcano(
15151515
15161516
prot = pp.read_csv("../data/proteinGroups_minimal.zip")
15171517
prot = pp.cleaning(prot, "proteinGroups")
1518-
protRatio = prot.filter(regex="^Ratio .\/.( | normalized )B").columns
1518+
protRatio = prot.filter(regex=r"^Ratio .\/.( | normalized )B").columns
15191519
prot = pp.log(prot, protRatio, base=2)
15201520
twitchVsmild = ['log2_Ratio H/M normalized BC18_1','log2_Ratio M/L normalized BC18_2',
15211521
'log2_Ratio H/M normalized BC18_3',
@@ -2130,7 +2130,7 @@ def ratio_plot(
21302130
21312131
prot = pp.read_csv("../data/proteinGroups_minimal.zip")
21322132
prot = pp.cleaning(prot, "proteinGroups")
2133-
protRatio = prot.filter(regex="^Ratio .\/.( | normalized )B").columns
2133+
protRatio = prot.filter(regex=r"^Ratio .\/.( | normalized )B").columns
21342134
prot = pp.log(prot, protRatio, base=2)
21352135
prot['Gene names 1st'] = prot['Gene names'].str.split(';').str[0]
21362136

0 commit comments

Comments
 (0)