Compute the score of a linear peptide with respect to a spectrum.
Write a Python function linearscore
, which takes as parameters an amino acid string Peptide
and a collection of integers LinearSpectrum
. The function returns the linear score of Peptide
against Spectrum
.
>>> linearscore("NQEL", [0, 99, 113, 114, 128, 227, 257, 299, 355, 356, 370, 371, 484])
8
>>> linearscore("ICWTVCKDKSMGGNAGIWLRYYKQRKPYWTFSDKWFQR", [0, 57, 57, 57, 71, 87, 97, 99, 99, 101, 103, 103, 113, 113, 113, 113, 114, 114, 115, 128, 128, 128, 128, 128, 128, 128, 137, 147, 147, 156, 156, 156, 156, 163, 163, 163, 170, 171, 185, 186, 186, 186, 186, 194, 198, 199, 212, 216, 218, 224, 225, 227, 228, 241, 242, 243, 243, 248, 250, 251, 256, 260, 269, 275, 281, 284, 284, 284, 285, 287, 289, 291, 298, 299, 299, 299, 299, 311, 312, 314, 314, 319, 326, 333, 338, 340, 346, 349, 351, 355, 356, 356, 356, 365, 365, 380, 381, 384, 388, 388, 402, 411, 412, 412, 412, 412, 413, 419, 429, 431, 432, 434, 437, 439, 442, 446, 450, 451, 452, 454, 455, 461, 461, 466, 468, 469, 469, 482, 484, 487, 493, 493, 494, 497, 501, 508, 509, 510, 526, 532, 537, 540, 544, 547, 550, 555, 565, 567, 568, 574, 575, 576, 579, 580, 582, 589, 594, 595, 597, 597, 598, 600, 600, 608, 610, 617, 618, 625, 625, 636, 637, 637, 652, 654, 655, 663, 666, 672, 675, 679, 679, 679, 692, 693, 694, 696, 700, 703, 704, 711, 712, 713, 723, 728, 730, 731, 736, 738, 738, 745, 749, 750, 753, 753, 768, 780, 780, 781, 788, 791, 793, 797, 799, 800, 800, 806, 807, 807, 807, 815, 822, 825, 826, 831, 841, 848, 849, 851, 852, 858, 860, 864, 866, 867, 890, 894, 894, 905, 906, 909, 912, 912, 916, 920, 924, 925, 927, 935, 936, 939, 943, 947, 951, 954, 955, 959, 962, 963, 963, 963, 966, 977, 978, 981, 986, 992, 1004, 1007, 1019, 1022, 1022, 1030, 1037, 1040, 1040, 1042, 1048, 1049, 1055, 1068, 1076, 1079, 1079, 1081, 1087, 1087, 1092, 1105, 1105, 1106, 1110, 1113, 1118, 1118, 1119, 1126, 1129, 1133, 1135, 1144, 1147, 1149, 1150, 1155, 1163, 1168, 1179, 1190, 1193, 1193, 1196, 1204, 1205, 1205, 1207, 1207, 1209, 1211, 1218, 1226, 1232, 1234, 1236, 1241, 1246, 1250, 1250, 1276, 1276, 1281, 1282, 1291, 1292, 1293, 1303, 1304, 1306, 1307, 1312, 1317, 1321, 1321, 1324, 1324, 1335, 1337, 1349, 1354, 1361, 1363, 1368, 1373, 1378, 1395, 1397, 1397, 1404, 1404, 1404, 1406, 1407, 1413, 1416, 1418, 1432, 1432, 1434, 1435, 1444, 1449, 1452, 1452, 1468, 1489, 1491, 1491, 1500, 1501, 1501, 1503, 1506, 1510, 1517, 1520, 1524, 1531, 1531, 1535, 1560, 1560, 1560, 1563, 1569, 1572, 1580, 1581, 1581, 1588, 1592, 1595, 1602, 1602, 1605, 1615, 1616, 1619, 1629, 1638, 1648, 1657, 1657, 1659, 1662, 1663, 1673, 1682, 1687, 1694, 1700, 1705, 1705, 1715, 1716, 1716, 1719, 1723, 1733, 1743, 1751, 1758, 1766, 1767, 1772, 1778, 1785, 1785, 1785, 1787, 1788, 1790, 1815, 1818, 1819, 1829, 1830, 1836, 1847, 1856, 1868, 1871, 1879, 1880, 1886, 1886, 1887, 1891, 1901, 1906, 1913, 1913, 1929, 1932, 1934, 1935, 1937, 1941, 1943, 1943, 1944, 1981, 1984, 1993, 1999, 2004, 2004, 2014, 2014, 2015, 2034, 2038, 2041, 2047, 2050, 2057, 2062, 2065, 2069, 2071, 2076, 2081, 2092, 2098, 2099, 2107, 2117, 2118, 2127, 2128, 2142, 2160, 2166, 2168, 2170, 2175, 2179, 2185, 2197, 2197, 2204, 2220, 2226, 2227, 2231, 2233, 2236, 2239, 2244, 2248, 2255, 2273, 2280, 2288, 2293, 2298, 2298, 2313, 2323, 2324, 2325, 2331, 2337, 2346, 2354, 2360, 2361, 2361, 2367, 2383, 2394, 2395, 2395, 2403, 2411, 2416, 2426, 2427, 2430, 2436, 2453, 2474, 2484, 2486, 2487, 2508, 2510, 2511, 2517, 2523, 2523, 2523, 2530, 2531, 2531, 2531, 2539, 2541, 2547, 2558, 2587, 2599, 2609, 2614, 2618, 2636, 2636, 2638, 2639, 2644, 2645, 2659, 2660, 2673, 2678, 2679, 2686, 2694, 2702, 2717, 2727, 2735, 2737, 2742, 2744, 2759, 2765, 2773, 2774, 2781, 2792, 2795, 2799, 2807, 2822, 2830, 2834, 2845, 2845, 2855, 2864, 2868, 2872, 2887, 2896, 2898, 2898, 2921, 2923, 2935, 2959, 2973, 2978, 2983, 2985, 2992, 2992, 2992, 2997, 3011, 3016, 3020, 3024, 3024, 3026, 3073, 3084, 3086, 3091, 3095, 3106, 3111, 3120, 3120, 3123, 3139, 3139, 3148, 3163, 3183, 3183, 3185, 3210, 3210, 3220, 3223, 3233, 3234, 3236, 3267, 3276, 3284, 3286, 3291, 3297, 3332, 3336, 3338, 3338, 3348, 3357, 3369, 3390, 3399, 3431, 3435, 3444, 3447, 3451, 3453, 3466, 3470, 3472, 3485, 3504, 3524, 3534, 3550, 3572, 3573, 3579, 3585, 3600, 3617, 3641, 3649, 3652, 3671, 3678, 3686, 3720, 3720, 3728, 3728, 3765, 3777, 3799, 3799, 3823, 3833, 3835, 3864, 3884, 3912, 3927, 3936, 3938, 3955, 3963, 3963, 4011, 4040, 4051, 4066, 4083, 4110, 4139, 4149, 4179, 4196, 4238, 4252, 4295, 4296, 4365, 4394, 4399, 4424, 4512, 4527, 4580, 4640, 4683, 4796])
274