88import org .labkey .test .util .DataRegionTable ;
99
1010import java .util .Arrays ;
11+ import java .util .List ;
12+
13+ import static org .junit .Assert .assertEquals ;
1114
1215@ Category ({})
1316public class TargetedMSEarlyStagePTMReportTest extends TargetedMSTest
@@ -33,6 +36,38 @@ private void doInit()
3336 importData (IMPORT_FILE );
3437 }
3538
39+ @ Test
40+ public void testEarlyStagePrepivot ()
41+ {
42+ goToProjectHome ();
43+ goToSchemaBrowser ();
44+ DataRegionTable table = viewQueryData ("targetedms" , "PTMPercentsGroupedPrepivot" );
45+
46+ // Test special-cased peptide
47+ table .setFilter ("PeptideModifiedSequence" , "Starts With" , "EEQ" );
48+ table = new DataRegionTable ("query" , this );
49+ assertEquals (List .of ("false" , "false" , "false" , "false" , "false" , "false" ), table .getColumnDataAsText ("IsCdr" ));
50+ assertEquals (List .of (" " , " " , " " , " " , " " , " " ), table .getColumnDataAsText ("Risk" ));
51+
52+ // Test "normal" peptide
53+ table .setFilter ("PeptideModifiedSequence" , "Starts With" , "WQQ" );
54+ table = new DataRegionTable ("query" , this );
55+ assertEquals (List .of ("false" , "false" ), table .getColumnDataAsText ("IsCdr" ));
56+ assertEquals (List .of ("Low" , "Medium" ), table .getColumnDataAsText ("Risk" ));
57+
58+ // Test CDR peptide
59+ table .setFilter ("PeptideModifiedSequence" , "Starts With" , "VTN" );
60+ table = new DataRegionTable ("query" , this );
61+ assertEquals (List .of ("true" , "true" ), table .getColumnDataAsText ("IsCdr" ));
62+ assertEquals (List .of ("High" , "Medium" ), table .getColumnDataAsText ("Risk" ));
63+
64+ // Test special-cased N-Term Modification, present on QVTL peptide (Q is modified, so don't use it in the filter)
65+ table .setFilter ("PeptideModifiedSequence" , "Contains" , "VTL" );
66+ table = new DataRegionTable ("query" , this );
67+ assertEquals (List .of ("false" , "false" ), table .getColumnDataAsText ("IsCdr" ));
68+ assertEquals (List .of (" " , " " ), table .getColumnDataAsText ("Risk" ));
69+ }
70+
3671 @ Test
3772 public void testEarlyStagePTMReport ()
3873 {
@@ -42,28 +77,34 @@ public void testEarlyStagePTMReport()
4277 DataRegionTable reportTable = new DataRegionTable .DataRegionFinder (getDriver ()).withName ("earlyStagePtmReport" ).waitFor ();
4378
4479 log ("Verifying the table headers" );
45- Assert . assertEquals ("Incorrect column headers" , Arrays .asList ("Chain" , "Site Location" , "Sequence" , "Modification" , "Max Percent Modified" ,
80+ assertEquals ("Incorrect column headers" , Arrays .asList ("Chain" , "Site Location" , "Sequence" , "Modification" , "Max Percent Modified" ,
4681 "Percent Modified" , "Total Percent Modified" , "Percent Modified" , "Total Percent Modified" ), reportTable .getColumnLabels ());
47- Assert . assertEquals ("Incorrect Sample Names displayed as headers" , "Sample1 QE_2" ,
82+ assertEquals ("Incorrect Sample Names displayed as headers" , "Sample1 QE_2" ,
4883 Locator .xpath ("//table/thead[2]/tr" ).findElement (reportTable ).getText ());
4984
85+ int qvtRowIndex = 0 ; // Special-cased modification: Gln->pyro-Glu (N-term Q)
5086 int vtnRowIndex = 1 ;
87+ int eeqRowIndex = 3 ; // Special-cased peptide: EEQYNSTYR(V)
5188 int wqqRowIndex = 7 ;
5289
5390 log ("Verifying the modified percentage for sequence with CDR Range and stressed or not stressed updates" );
54- Assert . assertEquals ("Incorrect percentages for (K)VTNMDPADTATYYCAR(D) sequence" , Arrays .asList ("(K)VTNMDPADTATYYCAR(D)" , "11.3%" , "11.3%" , "11.1%" , "11.1%" ),
91+ assertEquals ("Incorrect percentages for (K)VTNMDPADTATYYCAR(D) sequence" , Arrays .asList ("(K)VTNMDPADTATYYCAR(D)" , "11.3%" , "11.3%" , "11.1%" , "11.1%" ),
5592 reportTable .getRowDataAsText (vtnRowIndex , "Sequence" , "QE_1::PercentModified" , "QE_1::TotalPercentModified" ,
5693 "QE_2::PercentModified" , "QE_2::TotalPercentModified" ));
57- Assert . assertEquals ("Incorrect percentages for (R)WQQGNVFSCSVMHEALHNHYTQK(S) sequence" , Arrays .asList ("(R)WQQGNVFSCSVMHEALHNHYTQK(S)" , "22.1%" , "22.1%" , "24.1%" , "24.1%" ),
94+ assertEquals ("Incorrect percentages for (R)WQQGNVFSCSVMHEALHNHYTQK(S) sequence" , Arrays .asList ("(R)WQQGNVFSCSVMHEALHNHYTQK(S)" , "22.1%" , "22.1%" , "24.1%" , "24.1%" ),
5895 reportTable .getRowDataAsText (wqqRowIndex , "Sequence" , "QE_1::PercentModified" , "QE_1::TotalPercentModified" ,
5996 "QE_2::PercentModified" , "QE_2::TotalPercentModified" ));
6097
61- log ("Verifying the cell colors:Green, Yellow and Red" );
62- Assert . assertEquals ("Incorrect risk category color for - Green" , "rgb(137, 202, 83 )" ,
63- Locator .xpath ("//table/tbody/tr[" + (wqqRowIndex + 1 ) + "]/td[6]" ).findElement (reportTable ).getCssValue ("background-color" ));
64- Assert . assertEquals ("Incorrect risk category color for - Yellow" , "rgb(254, 255, 63)" ,
98+ log ("Verifying the cell colors: Gray, Green, Yellow and Red" );
99+ assertEquals ("Incorrect risk category color for QVT/Sample1 - Green" , "rgb(246, 246, 246 )" ,
100+ Locator .xpath ("//table/tbody/tr[" + (qvtRowIndex + 1 ) + "]/td[6]" ).findElement (reportTable ).getCssValue ("background-color" ));
101+ assertEquals ("Incorrect risk category color for VTN/Sample1 - Yellow" , "rgb(254, 255, 63)" ,
65102 Locator .xpath ("//table/tbody/tr[" + (vtnRowIndex + 1 ) + "]/td[6]" ).findElement (reportTable ).getCssValue ("background-color" ));
66- Assert . assertEquals ("Incorrect risk category color for - Red" , "rgb(250, 8, 26)" ,
103+ assertEquals ("Incorrect risk category color for VTN/QE_2 - Red" , "rgb(250, 8, 26)" ,
67104 Locator .xpath ("//table/tbody/tr[" + (vtnRowIndex + 1 ) + "]/td[8]" ).findElement (reportTable ).getCssValue ("background-color" ));
105+ assertEquals ("Incorrect risk category color for EEQ/Sample1 - Green" , "rgb(246, 246, 246)" ,
106+ Locator .xpath ("//table/tbody/tr[" + (eeqRowIndex + 1 ) + "]/td[6]" ).findElement (reportTable ).getCssValue ("background-color" ));
107+ assertEquals ("Incorrect risk category color for WQQ/Sample1 - Green" , "rgb(137, 202, 83)" ,
108+ Locator .xpath ("//table/tbody/tr[" + (wqqRowIndex + 1 ) + "]/td[6]" ).findElement (reportTable ).getCssValue ("background-color" ));
68109 }
69110}
0 commit comments