Py Protein Inference Module
ProteinInferencePipeline
Bases: object
This is the main Protein Inference class which houses the logic of the entire data analysis pipeline. Logic is executed in the execute method.
Attributes: |
|
---|
Source code in pyproteininference/pipeline.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 |
|
__init__(parameter_file, database_file=None, target_files=None, decoy_files=None, combined_files=None, target_directory=None, decoy_directory=None, combined_directory=None, output_directory=None, output_filename=None, id_splitting=False, append_alt_from_db=True)
Parameters: |
|
---|
Returns: |
|
---|
Example
pipeline = pyproteininference.pipeline.ProteinInferencePipeline( parameter_file=yaml_params, database_file=database, target_files=target, decoy_files=decoy, combined_files=combined_files, target_directory=target_directory, decoy_directory=decoy_directory, combined_directory=combined_directory, output_directory=dir_name, output_filename=output_filename, append_alt_from_db=append_alt, )
Source code in pyproteininference/pipeline.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
create_from_gui_config(queue, config)
classmethod
Creates the ProteinInferencePipeline from a Config object passed from the graphical user interface.
Source code in pyproteininference/pipeline.py
113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
execute()
This method is the main driver of the data analysis for the protein inference package. This method calls other classes and methods that make up the protein inference pipeline. This includes but is not limited to:
This method sets the data DataStore Object and digest Digest Object.
- Parameter file management.
- Digesting Fasta Database (Optional).
- Reading in input Psm Files.
- Initializing the DataStore Object.
- Restricting Psms.
- Creating Protein objects/scoring input.
- Scoring Proteins.
- Running Protein Picker.
- Running Inference Methods/Grouping.
- Calculating Q Values.
- Exporting Proteins to filesystem.
Example
pipeline = pyproteininference.pipeline.ProteinInferencePipeline( parameter_file=yaml_params, database_file=database, target_files=target, decoy_files=decoy, combined_files=combined_files, target_directory=target_directory, decoy_directory=decoy_directory, combined_directory=combined_directory, output_directory=dir_name, output_filename=output_filename, append_alt_from_db=append_alt, ) pipeline.execute()
Source code in pyproteininference/pipeline.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
|
ProteinInferenceParameter
Bases: object
Class that handles data retrieval, storage, and validation of Protein Inference Parameters.
Attributes: |
|
---|
Source code in pyproteininference/parameters.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 |
|
__init__(yaml_param_filepath, configuration=None, validate=True)
Class to store Protein Inference parameter information as an object.
Parameters: |
|
---|
Returns: |
|
---|
Example
pyproteininference.parameters.ProteinInferenceParameter( yaml_param_filepath = "/path/to/pyproteininference_params.yaml", validate=True )
Source code in pyproteininference/parameters.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
convert_from_gui_configuration(configuration)
Function that takes a Protein Inference GUI configuration object and converts it into a ProteinInferenceParameter object by assigning all Attributes of the ProteinInferenceParameter object.
If no parameter filepath is supplied the parameter object will be loaded with default params.
This function gets ran in the initialization of the ProteinInferenceParameter object.
Returns: |
|
---|
Source code in pyproteininference/parameters.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
|
convert_to_object()
Function that takes a Protein Inference parameter file and converts it into a ProteinInferenceParameter object by assigning all Attributes of the ProteinInferenceParameter object.
If no parameter filepath is supplied the parameter object will be loaded with default params.
This function gets ran in the initialization of the ProteinInferenceParameter object.
Returns: |
|
---|
Source code in pyproteininference/parameters.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
|
fix_parameters_from_datastore(data)
ProteinInferenceParameter method to override restriction values in the parameter file if those scores do not exist in the input files.
Parameters: |
|
---|
Source code in pyproteininference/parameters.py
970 971 972 973 974 975 976 977 978 979 980 981 982 |
|
override_custom_restrict(data)
ProteinInferenceParameter method to override restrict_custom if the input data does not contain custom score values.
Parameters: |
|
---|
Source code in pyproteininference/parameters.py
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 |
|
override_pep_restrict(data)
ProteinInferenceParameter method to override restrict_pep if the input data does not contain pep values.
Parameters: |
|
---|
Source code in pyproteininference/parameters.py
933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 |
|
override_q_restrict(data)
ProteinInferenceParameter method to override restrict_q if the input data does not contain q values.
Parameters: |
|
---|
Source code in pyproteininference/parameters.py
917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 |
|
validate_parameters()
Class method to validate all parameters.
Returns: |
|
---|
Source code in pyproteininference/parameters.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
|
GenericReader
Bases: Reader
The following class takes a percolator like target file and a percolator like decoy file and creates standard Psm objects.
Percolator Like Output is formatted as follows: with each entry being tab delimited.
| PSMId | score | q-value | posterior_error_prob | peptide | proteinIds | | | | # noqa E501 W605 |-------------------------------|----------|-------------|-----------------------|--------------------------------|---------------------|----------------------|----------------------|-------------------------| # noqa E501 W605 | 116108.15139.15139.6.dta | 3.44016 | 0.000479928 | 7.60258e-10 | K.MVVSMTLGLHPWIANIDDTQYLAAK.R | CNDP1_HUMAN|Q96KN2 | B4E180_HUMAN|B4E180 | A8K1K1_HUMAN|A8K1K1 | J3KRP0_HUMAN|J3KRP0 | # noqa E501 W605
Custom columns can be added and used as scoring input. Please see package documentation for more information.
Attributes: |
|
---|
Source code in pyproteininference/reader.py
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 |
|
__init__(digest, parameter_file_object, append_alt_from_db=True, target_file=None, decoy_file=None, combined_files=None, directory=None, top_hit_per_psm_only=False)
Parameters: |
|
---|
Returns: |
|
---|
Example
pyproteininference.reader.GenericReader(target_file = "example_target.txt", decoy_file = "example_decoy.txt", digest=digest, parameter_file_object=pi_params)
Source code in pyproteininference/reader.py
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 |
|
read_psms()
Method to read psms from the input files and to transform them into a list of Psm objects.
This method sets the psms
variable. Which is a list of Psm objets.
This method must be ran before initializing DataStore object.
Example
reader = pyproteininference.reader.GenericReader(target_file = "example_target.txt", decoy_file = "example_decoy.txt", digest=digest, parameter_file_object=pi_params) reader.read_psms()
Source code in pyproteininference/reader.py
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 |
|
IdXMLReader
Bases: Reader
The following class takes a idXML like file and creates standard Psm objects.
Attributes: |
|
---|
Source code in pyproteininference/reader.py
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 |
|
__init__(digest, parameter_file_object, append_alt_from_db=True, target_file=None, decoy_file=None, combined_files=None, directory=None, top_hit_per_psm_only=False)
Parameters: |
|
---|
Returns: |
|
---|
Example
pyproteininference.reader.IdXMLReader(combined_file = "example_file.idXML", digest=digest, parameter_file_object=pi_params)
Source code in pyproteininference/reader.py
1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 |
|
PercolatorReader
Bases: Reader
The following class takes a percolator target file and a percolator decoy file or combined files/directory and creates standard Psm objects. This reader class is used as input for DataStore object.
Percolator Output is formatted as follows: with each entry being tab delimited.
| PSMId | score | q-value | posterior_error_prob | peptide | proteinIds | | | | # noqa E501 W605 |-------------------------------|----------|-------------|-----------------------|--------------------------------|---------------------|----------------------|----------------------|-------------------------| # noqa E501 W605 | 116108.15139.15139.6.dta | 3.44016 | 0.000479928 | 7.60258e-10 | K.MVVSMTLGLHPWIANIDDTQYLAAK.R | CNDP1_HUMAN|Q96KN2 | B4E180_HUMAN|B4E180 | A8K1K1_HUMAN|A8K1K1 | J3KRP0_HUMAN|J3KRP0 | # noqa E501 W605
Attributes: |
|
---|
Source code in pyproteininference/reader.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 |
|
__init__(digest, parameter_file_object, append_alt_from_db=True, target_file=None, decoy_file=None, combined_files=None, directory=None, top_hit_per_psm_only=False)
Parameters: |
|
---|
Returns: |
|
---|
Example
pyproteininference.reader.PercolatorReader(target_file = "example_target.txt", decoy_file = "example_decoy.txt", digest=digest,parameter_file_object=pi_params)
Source code in pyproteininference/reader.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
read_psms()
Method to read psms from the input files and to transform them into a list of Psm objects.
This method sets the psms
variable. Which is a list of Psm objets.
This method must be ran before initializing DataStore object.
Example
reader = pyproteininference.reader.PercolatorReader(target_file = "example_target.txt", decoy_file = "example_decoy.txt", digest=digest, parameter_file_object=pi_params) reader.read_psms()
Source code in pyproteininference/reader.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 |
|
ProteologicPostSearchReader
Bases: Reader
This class is used to read from post processing proteologic logical object.
Attributes: |
|
---|
Source code in pyproteininference/reader.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
|
__init__(proteologic_object, search_id, postsearch_id, digest, parameter_file_object, append_alt_from_db=True, top_hit_per_psm_only=False)
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/reader.py
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
|
read_psms()
Method to read psms from the input files and to transform them into a list of Psm objects.
This method sets the psms
variable. Which is a list of Psm objets.
This method must be ran before initializing DataStore object.
Source code in pyproteininference/reader.py
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
|
Reader
Bases: object
Main Reader Class which is parent to all reader subclasses.
Attributes: |
|
---|
Source code in pyproteininference/reader.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
__init__(target_file=None, decoy_file=None, combined_files=None, directory=None, top_hit_per_psm_only=False)
Parameters: |
|
---|
Source code in pyproteininference/reader.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
get_alternative_proteins_from_input(row)
Method to get the alternative proteins from the input files.
Source code in pyproteininference/reader.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
DataStore
Bases: object
The following Class serves as the data storage object for a protein inference analysis The class serves as a central point that is accessed at virtually every PI processing step
Attributes: |
|
---|
Source code in pyproteininference/datastore.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 |
|
__init__(reader, digest, validate=True)
Parameters: |
---|
Example
pyproteininference.datastore.DataStore(reader = reader, digest=digest)
Source code in pyproteininference/datastore.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
calculate_q_values(regular=True)
Method calculates Q values FDR on the lead protein in the group on the protein_group_objects
instance variable.
FDR is calculated As (2*decoys)/total if regular is set to True and is
(decoys)/total if regular is set to False.
This method updates the protein_group_objects
for the DataStore object by updating
the q_value variable of the ProteinGroup objects.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest)
Data must be scored first
data.calculate_q_values()
Source code in pyproteininference/datastore.py
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 |
|
check_data_consistency()
Method that checks for data consistency.
Source code in pyproteininference/datastore.py
1124 1125 1126 1127 1128 1129 |
|
create_scoring_input()
Method to create the scoring input. This method initializes a list of Protein objects to get them ready to be scored by Score methods. This method also takes into account the inference type and aggregates peptides -> proteins accordingly.
This method sets the scoring_input
and score
Attributes for the DataStore object.
The score selected comes from the protein inference parameter object.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) data.create_scoring_input()
Source code in pyproteininference/datastore.py
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 |
|
exclude_non_distinguishing_peptides(protein_subset_type='hard')
Method to Exclude peptides that are not distinguishing on either the search or database level.
The method sets the scoring_input
and restricted_peptides
variables for the DataStore object.
Parameters: |
|
---|
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) data.exclude_non_distinguishing_peptides(protein_subset_type="hard")
Source code in pyproteininference/datastore.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 |
|
generate_fdr_vs_target_hits(fdr_max=0.2)
Method for calculating FDR vs number of Target Proteins.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/datastore.py
1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 |
|
get_pep_values()
Method to retrieve a list of all posterior error probabilities for all PSMs.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) pep = data.get_pep_values()
Source code in pyproteininference/datastore.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|
get_protein_data()
Method to retrieve a list of Protein objects. Retrieves picked and scored data if the data has been picked and scored or just the scored data if the data has not been picked.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest)
Data must ben ran through a pyproteininference.scoring.Score method
protein_data = data.get_protein_data()
Source code in pyproteininference/datastore.py
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
get_protein_identifiers(data_form)
Method to retrieve the protein string identifiers.
Parameters: |
|
---|
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) protein_strings = data.get_protein_identifiers(data_form="main")
Source code in pyproteininference/datastore.py
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 |
|
get_protein_identifiers_from_psm_data()
Method to retrieve a list of lists of all possible protein identifiers from the psm data.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) protein_strings = data.get_protein_identifiers_from_psm_data()
Source code in pyproteininference/datastore.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
|
get_protein_information(protein_string)
Method to retrieve attributes for a specific scored protein.
Parameters: |
|
---|
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) protein_attr = data.get_protein_information(protein_string="RAF1_HUMAN|P04049")
Source code in pyproteininference/datastore.py
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 |
|
get_protein_information_dictionary()
Method to retrieve a dictionary of scores for each peptide.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) protein_dict = data.get_protein_information_dictionary()
Source code in pyproteininference/datastore.py
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
|
get_protein_objects(false_discovery_rate=None, fdr_restricted=False)
Method retrieves protein objects. Either retrieves FDR restricted list of protien objects, or retrieves all objects.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/datastore.py
1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 |
|
get_psm_data()
Method to retrieve a list of Psm objects. Retrieves restricted data if the data has been restricted or all of the data if the data has not been restricted.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) psm_data = data.get_psm_data()
Source code in pyproteininference/datastore.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|
get_q_values()
Method to retrieve a list of all q values for all PSMs.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) q = data.get_q_values()
Source code in pyproteininference/datastore.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
|
get_sorted_identifiers(scored=True)
Retrieves a sorted list of protein strings present in the analysis.
Parameters: |
|
---|
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) sorted_proteins = data.get_sorted_identifiers(scored=True)
Source code in pyproteininference/datastore.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
higher_or_lower()
Method to determine if a higher or lower score is better for a given combination of score input and score type.
This method sets the high_low_better
Attribute for the DataStore object.
This method depends on the output from the Score class to be sorted properly from best to worst score.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) high_low = data.higher_or_lower()
Source code in pyproteininference/datastore.py
659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 |
|
input_has_custom()
Method that checks to see if the input data has custom score values.
Source code in pyproteininference/datastore.py
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 |
|
input_has_pep()
Method that checks to see if the input data has pep values.
Source code in pyproteininference/datastore.py
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 |
|
input_has_q()
Method that checks to see if the input data has q values.
Source code in pyproteininference/datastore.py
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 |
|
peptide_to_protein_dictionary()
Method that returns a map of peptide strings to sets of protein strings and is essentially half of a
BiPartite graph.
This method sets the peptide_protein_dictionary
Attribute for the DataStore object.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) peptide_protein_dict = data.peptide_to_protein_dictionary()
Source code in pyproteininference/datastore.py
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 |
|
protein_picker()
Method to run the protein picker algorithm.
Proteins must be scored first with score_psms.
The algorithm will match target and decoy proteins identified from the PSMs from the search. If a target and matching decoy is found then target/decoy competition is performed. In the Target/Decoy pair the protein with the better score is kept and the one with the worse score is discarded from the analysis.
The method sets the picked_proteins_scored
and picked_proteins_removed
variables for
the DataStore object.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) data.protein_picker()
Source code in pyproteininference/datastore.py
918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 |
|
protein_to_peptide_dictionary()
Method that returns a map of protein strings to sets of peptide strings and is essentially half
of a BiPartite graph.
This method sets the protein_peptide_dictionary
Attribute for the DataStore object.
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) protein_peptide_dict = data.protein_to_peptide_dictionary()
Source code in pyproteininference/datastore.py
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
|
restrict_psm_data(remove1pep=True)
Method to restrict the input of Psm objects. This method is central to the pyproteininference module and is able to restrict the Psm data by: Q value, Pep Value, Percolator Score, Peptide Length, and Custom Score Input. Restriction values are pulled from the ProteinInferenceParameter object.
This method sets the main_data_restricted
and restricted_peptides
Attributes for the DataStore object.
Parameters: |
|
---|
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) data.restrict_psm_data(remove1pep=True)
Source code in pyproteininference/datastore.py
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 |
|
sort_protein_group_objects(protein_group_objects, higher_or_lower)
classmethod
Class Method to sort a list of ProteinGroup objects by score and number of peptides.
Parameters: |
|
---|
Returns: |
|
---|
Example
list_of_group_objects = pyproteininference.datastore.DataStore.sort_protein_group_objects( protein_group_objects=list_of_group_objects, higher_or_lower="higher" )
Source code in pyproteininference/datastore.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
sort_protein_objects(grouped_protein_objects, higher_or_lower)
classmethod
Class Method to sort a list of Protein objects by score and number of peptides.
Parameters: |
|
---|
Returns: |
|
---|
Example
scores_grouped = pyproteininference.datastore.DataStore.sort_protein_objects( grouped_protein_objects=scores_grouped, higher_or_lower="higher" )
Source code in pyproteininference/datastore.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
sort_protein_strings(protein_string_list, sp_proteins, decoy_symbol)
classmethod
Target Reviewed, Decoy Reviewed, Target Unreviewed,
Decoy Unreviewed.
Parameters: |
|
---|
Returns: |
|
---|
Example
list_of_group_objects = datastore.DataStore.sort_protein_strings( protein_string_list=protein_string_list, sp_proteins=sp_proteins, decoy_symbol="##" )
Source code in pyproteininference/datastore.py
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 |
|
sort_protein_sub_groups(protein_list, higher_or_lower)
classmethod
Method to sort protein sub lists.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/datastore.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
|
unique_to_leads_peptides()
Method to retrieve peptides that are unique based on the data from the searches (Not based on the database digestion).
Returns: |
|
---|
Example
data = pyproteininference.datastore.DataStore(reader = reader, digest=digest) unique_peps = data.unique_to_leads_peptides()
Source code in pyproteininference/datastore.py
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 |
|
validate_digest()
Method that validates the Digest object.
Source code in pyproteininference/datastore.py
1117 1118 1119 1120 1121 1122 |
|
validate_psm_data()
Method that validates the PSM data.
Source code in pyproteininference/datastore.py
1110 1111 1112 1113 1114 1115 |
|
Digest
Bases: object
The following class handles data storage of in silico digest data from a fasta formatted sequence database.
Attributes: |
|
---|
Source code in pyproteininference/in_silico_digest.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
PyteomicsDigest
Bases: Digest
This class represents a pyteomics implementation of an in silico digest.
Source code in pyproteininference/in_silico_digest.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
__init__(database_path, digest_type, missed_cleavages, reviewed_identifier_symbol, max_peptide_length, id_splitting=True)
The following class creates protein to peptide, peptide to protein, and reviewed protein mappings.
The input is a fasta database, a protein inference parameter object, and whether or not to split IDs.
This class sets important attributes for the Digest object such as: peptide_to_protein_dictionary
,
protein_to_peptide_dictionary
, and swiss_prot_protein_set
.
Parameters: |
|
---|
Example
digest = pyproteininference.in_silico_digest.PyteomicsDigest( database_path=database_file, digest_type='trypsin', missed_cleavages=2, reviewed_identifier_symbol='sp|', max_peptide_length=7, id_splitting=False, )
Source code in pyproteininference/in_silico_digest.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
digest_fasta_database()
This method reads in and prepares the fasta database for database digestion and assigns
the several attributes for the Digest object: peptide_to_protein_dictionary
,
protein_to_peptide_dictionary
, and swiss_prot_protein_set
.
Returns: |
|
---|
Example
digest = pyproteininference.in_silico_digest.PyteomicsDigest( database_path=database_file, digest_type='trypsin', missed_cleavages=2, reviewed_identifier_symbol='sp|', max_peptide_length=7, id_splitting=False, ) digest.digest_fasta_database()
Source code in pyproteininference/in_silico_digest.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
Exclusion
Bases: Inference
Exclusion Inference class. This class contains methods that support the initialization of an Exclusion inference method.
Attributes: |
|
---|
Source code in pyproteininference/inference.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
__init__(data, digest)
Initialization method of the Exclusion Class.
Parameters: |
|
---|
Source code in pyproteininference/inference.py
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
|
infer_proteins()
This method performs the Exclusion inference/grouping method.
For the exclusion inference method groups cannot be created because all shared peptides are removed.
This method assigns the variables: grouped_scored_proteins
and protein_group_objects
.
These are both variables of the DataStore Object and are
lists of Protein objects
and ProteinGroup objects.
Source code in pyproteininference/inference.py
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
FirstProtein
Bases: Inference
FirstProtein Inference class. This class contains methods that support the initialization of a FirstProtein inference method.
Attributes: |
|
---|
Source code in pyproteininference/inference.py
1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 |
|
__init__(data, digest)
FirstProtein Inference initialization method.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/inference.py
1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 |
|
infer_proteins()
This method performs the First Protein inference method.
This method assigns the variables: grouped_scored_proteins
and protein_group_objects
.
These are both variables of the DataStore object and are
lists of Protein objects
and ProteinGroup objects.
Source code in pyproteininference/inference.py
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 |
|
Inclusion
Bases: Inference
Inclusion Inference class. This class contains methods that support the initialization of an Inclusion inference method.
Attributes: |
|
---|
Source code in pyproteininference/inference.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
|
__init__(data, digest)
Initialization method of the Inclusion Inference method.
Parameters: |
|
---|
Source code in pyproteininference/inference.py
219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
infer_proteins()
This method performs the grouping for Inclusion.
Inclusion actually does not do grouping as all peptides get assigned to all possible proteins and groups are not created.
This method assigns the variables: grouped_scored_proteins
and protein_group_objects
.
These are both variables of the DataStore Object and are
lists of Protein objects
and ProteinGroup objects.
Source code in pyproteininference/inference.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
Inference
Bases: object
Parent Inference class for all inference/grouper subset classes. The base Inference class contains several methods that are shared across the Inference sub-classes.
Attributes: |
|
---|
Source code in pyproteininference/inference.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
__init__(data, digest)
Initialization method of Inference object.
Parameters: |
|
---|
Source code in pyproteininference/inference.py
65 66 67 68 69 70 71 72 73 74 75 76 |
|
run_inference(data, digest)
classmethod
This class method dispatches to one of the five different inference classes/models based on input from the ProteinInferenceParameter object. The methods are "parsimony", "inclusion", "exclusion", "peptide_centric", and "first_protein".
Parameters: |
|
---|
Example
pyproteininference.inference.Inference.run_inference(data=data,digest=digest)
Source code in pyproteininference/inference.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
Parsimony
Bases: Inference
Parsimony Inference class. This class contains methods that support the initialization of a Parsimony inference method.
Attributes: |
|
---|
Source code in pyproteininference/inference.py
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 |
|
__init__(data, digest)
Initialization method of the Parsimony object.
Parameters: |
|
---|
Source code in pyproteininference/inference.py
401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
|
infer_proteins()
This method performs the Parsimony inference method and uses pulp for the LP solver.
This method assigns the variables: grouped_scored_proteins
and protein_group_objects
.
These are both variables of the DataStore object and are
lists of Protein objects
and ProteinGroup objects.
Source code in pyproteininference/inference.py
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 |
|
PeptideCentric
Bases: Inference
PeptideCentric Inference class. This class contains methods that support the initialization of a PeptideCentric inference method.
Attributes: |
|
---|
Source code in pyproteininference/inference.py
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 |
|
__init__(data, digest)
PeptideCentric Inference initialization method.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/inference.py
1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 |
|
infer_proteins()
This method performs the Peptide Centric inference method.
This method assigns the variables: grouped_scored_proteins
and protein_group_objects
.
These are both variables of the DataStore object and are
lists of Protein objects
and ProteinGroup objects.
Returns: |
|
---|
Source code in pyproteininference/inference.py
1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 |
|
Score
Bases: object
Score class that contains methods to do a variety of scoring methods on the Psm objects contained inside of Protein objects.
Methods in the class loop over each Protein object and creates a protein "score" variable using the Psm object scores.
Methods score all proteins from scoring_input
from DataStore object.
The PSM score that is used is determined from
create_scoring_input.
Each scoring method will set the following attributes for the DataStore object.
score_method
; This is the full name of the score method.short_score_method
; This is the short name of the score method.scored_proteins
; This is a list of Protein objects that have been scored.
Attributes: |
|
---|
Source code in pyproteininference/scoring.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
|
__init__(data)
Initialization method for the Score class.
Parameters: |
|
---|
Raises: |
|
---|
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
Source code in pyproteininference/scoring.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
additive()
This method uses an additive scoring scheme. The method can only be used if a larger PSM score is a better PSM score such as the Percolator score.
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.additive()
Source code in pyproteininference/scoring.py
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 |
|
best_peptide_per_protein()
This method uses a best peptide per protein scoring scheme. The top scoring Psm for each protein is selected as the overall Protein object score.
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.best_peptide_per_protein()
Source code in pyproteininference/scoring.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
down_weighted_multiplicative_log()
This method uses a Multiplicative Log scoring scheme. The selected PSM score from all the peptides per protein are multiplied together and then this number is divided by the set PSM scores mean raised to the number of peptides for that protein then we take -Log(X) of the following value.
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.down_weighted_multiplicative_log()
Source code in pyproteininference/scoring.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
|
down_weighted_v2()
This method uses a Downweighted Multiplicative Log scoring scheme. Each peptide is iteratively downweighted by raising the peptide QValue or PepValue to the following power (1/(1+index_number)). Where index_number is the peptide number per protein. Each score for a protein provides less and less weight iteratively.
We also take -Log(X) of the final score here.
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.down_weighted_v2()
Source code in pyproteininference/scoring.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
|
fishers_method()
This method uses a fishers method scoring scheme. Examples: >>> score = pyproteininference.scoring.Score(data=data) >>> score.fishers_method()
Source code in pyproteininference/scoring.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
geometric_mean_log()
This method uses a Geometric Mean scoring scheme.
We also take -Log(X) of the final score here.
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.geometric_mean_log()
Source code in pyproteininference/scoring.py
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
|
iterative_down_weighted_log()
This method uses a Downweighted Multiplicative Log scoring scheme. Each peptide is iteratively downweighted by multiplying the peptide QValue or PepValue to the following (1+index_number). Where index_number is the peptide number per protein. Each score for a protein provides less and less weight iteratively.
We also take -Log(X) of the final score here.
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.iterative_down_weighted_log()
Source code in pyproteininference/scoring.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
|
iterative_down_weighted_v2()
The following method is an experimental method essentially used for future development of potential scoring schemes.
Source code in pyproteininference/scoring.py
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
|
multiplicative_log()
This method uses a Multiplicative Log scoring scheme. The selected Psm score from all the peptides per protein are multiplied together and we take -Log(X) of the multiplied Peptide scores.
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.multiplicative_log()
Source code in pyproteininference/scoring.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
score_psms(score_method='multiplicative_log')
This method dispatches to the actual scoring method given a string input that is defined in the ProteinInferenceParameter object.
Parameters: |
|
---|
Raises: |
|
---|
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.score_psms(score_method="best_peptide_per_protein")
Source code in pyproteininference/scoring.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
top_two_combied()
This method uses a Top Two scoring scheme. The top two scores for each protein are multiplied together and we take -Log(X) of the multiplied value. If a protein only has 1 score/peptide, then we only do -Log(X) of the 1 peptide score.
Examples:
>>> score = pyproteininference.scoring.Score(data=data)
>>> score.top_two_combied()
Source code in pyproteininference/scoring.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
|
Export
Bases: object
Class that handles exporting protein inference results to filesystem as csv files.
Attributes: |
|
---|
Source code in pyproteininference/export.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
|
__init__(data)
Initialization method for the Export class.
Parameters: |
|
---|
Example
export = pyproteininference.export.Export(data=data)
Source code in pyproteininference/export.py
46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
csv_export_all_restricted(filename_out)
Method that outputs a subset of the passing proteins based on FDR.
This method returns a non-square CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
csv_export_comma_sep_restricted(filename_out)
Method that outputs a subset of the passing proteins based on FDR. Only Proteins that pass FDR will be output and only Lead proteins will be output. Proteins in the groups of lead proteins will also be output in the same row as the lead.
This method returns a non-square CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
|
csv_export_leads_restricted(filename_out)
Method that outputs a subset of the passing proteins based on FDR. Only Proteins that pass FDR will be output and only Lead proteins will be output
This method returns a non-square CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
csv_export_q_value_all(filename_out)
Method that outputs all proteins with Q values. Non Lead proteins are also output - entire group gets output. Proteins in the groups of lead proteins will also be output in the same row as the lead.
This method returns a non-square CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 |
|
csv_export_q_value_comma_sep(filename_out)
Method that outputs all lead proteins with Q values. Proteins in the groups of lead proteins will also be output in the same row as the lead.
This method returns a non-square CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
|
csv_export_q_value_leads(filename_out)
Method that outputs all lead proteins with Q values.
This method returns a non-square CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
|
csv_export_q_value_leads_long(filename_out)
Method that outputs all lead proteins with Q values.
This method returns a long formatted result file with one peptide on each row.
Parameters: |
|
---|
Source code in pyproteininference/export.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
|
csv_export_q_value_leads_peptides(filename_out, peptide_delimiter=' ')
Method that outputs all lead proteins with Q values in rectangular format. This method outputs unique peptides per protein.
This method returns a rectangular CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
|
csv_export_q_value_leads_psm_ids(filename_out, peptide_delimiter=' ')
Method that outputs all lead proteins with Q values in rectangular format. Psms are output as the psm_id value. So sequence information is not output.
This method returns a rectangular CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
|
csv_export_q_value_leads_psms(filename_out, peptide_delimiter=' ')
Method that outputs all lead proteins with Q values in rectangular format. This method outputs all PSMs for the protein not just unique peptide identifiers.
This method returns a rectangular CSV file.
Parameters: |
|
---|
Source code in pyproteininference/export.py
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 |
|
export_to_csv(output_filename=None, directory=None, export_type='q_value')
Method that dispatches to one of the many export methods given an export_type input.
filepath is determined based on directory arg and information from DataStore object.
This method sets the filepath
variable.
Parameters: |
|
---|
Example
export = pyproteininference.export.Export(data=data) export.export_to_csv(output_filename=None, directory="/path/to/output/dir/", export_type="psms")
Source code in pyproteininference/export.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
Protein
Bases: object
The following class is a representation of a Protein that stores characteristics/attributes of a protein for the entire analysis. We use slots to predefine the attributes the Protein Object can have. This is done to speed up runtime of the PI algorithm.
Attributes: |
|
---|
Source code in pyproteininference/physical.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
__init__(identifier)
Initialization method for Protein object.
Parameters: |
|
---|
Example
protein = pyproteininference.physical.Protein(identifier = "PRKDC_HUMAN|P78527")
Source code in pyproteininference/physical.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
get_num_peptides()
Retrieves the number of peptides.
Returns: int: Number of peptides.
Source code in pyproteininference/physical.py
136 137 138 139 140 141 142 143 144 145 |
|
get_num_psms()
Retrieves the number of Psms.
Returns: int: Number of Psms.
Source code in pyproteininference/physical.py
125 126 127 128 129 130 131 132 133 134 |
|
get_psm_identifiers()
Retrieves a list of Psm identifiers.
Returns: list: List of Psm identifiers.
Source code in pyproteininference/physical.py
81 82 83 84 85 86 87 88 89 90 |
|
get_psm_ids()
Retrieves the Psm Ids.
Returns: list: List of Psm Ids.
Source code in pyproteininference/physical.py
147 148 149 150 151 152 153 154 155 156 |
|
get_psm_scores()
Retrieves psm scores for a given protein.
Returns: |
|
---|
Source code in pyproteininference/physical.py
70 71 72 73 74 75 76 77 78 79 |
|
get_stripped_psm_identifiers()
Retrieves a list of Psm identifiers that have had mods removed and flanking AAs removed.
Returns: list: List of Psm identifiers that have no mods or flanking AAs.
Source code in pyproteininference/physical.py
92 93 94 95 96 97 98 99 100 101 |
|
get_unique_peptide_identifiers()
Retrieves the unique set of peptides for a protein.
Returns: set: Set of peptide strings.
Source code in pyproteininference/physical.py
103 104 105 106 107 108 109 110 111 112 |
|
get_unique_stripped_peptide_identifiers()
Retrieves the unique set of peptides for a protein that are stripped.
Returns: set: Set of peptide strings that are stripped of mods and flanking AAs.
Source code in pyproteininference/physical.py
114 115 116 117 118 119 120 121 122 123 |
|
ProteinGroup
Bases: object
The following class is a physical Protein Group class that stores characteristics of a Protein Group for the entire analysis. We use slots to predefine the attributes the Psm Object can have. This is done to speed up runtime of the PI algorithm.
Attributes: |
|
---|
Source code in pyproteininference/physical.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
|
__init__(number_id)
Initialization method for ProteinGroup object.
Parameters: |
|
---|
Example
pg = pyproteininference.physical.ProteinGroup(number_id = 1)
Source code in pyproteininference/physical.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
|
Psm
Bases: object
The following class is a physical Psm class that stores characteristics of a psm for the entire analysis. We use slots to predefine the attributes the Psm Object can have. This is done to speed up runtime of the PI algorithm.
Attributes: |
|
---|
Source code in pyproteininference/physical.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
|
__init__(identifier)
Initialization method for the Psm object.
This method also initializes the stripped_peptide
and non_flanking_peptide
attributes.
Parameters: |
|
---|
Example
psm = pyproteininference.physical.Psm(identifier = "K.DLIDEGHAATQLVNQLHDVVVENNLSDK.Q")
Source code in pyproteininference/physical.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
|
assign_main_score(score)
This method takes in a score type and assigns the variable main_score for a given Psm based on the score type.
Parameters: |
|
---|
Source code in pyproteininference/physical.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
|
remove_peptide_mods(peptide_string)
classmethod
This class method takes a string and uses a MOD_REGEX
to remove mods from peptide strings.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/physical.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
|
split_peptide(peptide_string, delimiter='.')
classmethod
This class method takes a peptide string with flanking AAs and removes them from the peptide string. This method uses string splitting and if the method produces a faulty peptide the method split_peptide_pro will be called.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/physical.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
|
split_peptide_pro(peptide_string, delimiter='.')
classmethod
This class method takes a peptide string with flanking AAs and removes them from the peptide string. This is a specialized method of split_peptide that uses regex identifiers to replace flanking AAs as opposed to string splitting.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/physical.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
|
HeuristicPipeline
Bases: ProteinInferencePipeline
This is the Protein Inference Heuristic class which houses the logic to run the Protein Inference Heuristic method to determine the best inference method for the given data. Logic is executed in the execute method.
Attributes: |
|
---|
Source code in pyproteininference/heuristic.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
|
__init__(parameter_file=None, database_file=None, target_files=None, decoy_files=None, combined_files=None, target_directory=None, decoy_directory=None, combined_directory=None, output_directory=None, output_filename=None, id_splitting=False, append_alt_from_db=True, pdf_filename=None, output_type='all')
Parameters: |
|
---|
Returns: |
|
---|
Example
heuristic = pyproteininference.heuristic.HeuristicPipeline( parameter_file=yaml_params, database_file=database, target_files=target, decoy_files=decoy, combined_files=combined_files, target_directory=target_directory, decoy_directory=decoy_directory, combined_directory=combined_directory, output_directory=dir_name, output_filename=output_filename, append_alt_from_db=append_alt, pdf_filename=pdf_filename, output_type="all" )
Source code in pyproteininference/heuristic.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
determine_number_stdev_from_mean(false_discovery_rate)
This method calculates the mean of the number of proteins identified at a specific FDR of all 4 methods and then for each method calculates the number of standard deviations from the previous calculated mean.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/heuristic.py
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
|
determine_optimal_inference_method(false_discovery_rate_threshold=0.05, upper_empirical_threshold=1, lower_empirical_threshold=0.5, pdf_filename=None)
This method determines the optimal inference method from Inclusion, Exclusion, Parsimony, Peptide-Centric.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/heuristic.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
|
execute(fdr_threshold=0.05)
This method is the main driver of the heuristic method. This method calls other classes and methods that make up the heuristic pipeline. This includes but is not limited to:
- Loops over the main inference methods: Inclusion, Exclusion, Parsimony, and Peptide Centric.
- Determines the optimal inference method based on the input data as well as the database file.
- Outputs the results and indicates the optimal results.
Parameters: |
|
---|
Returns: |
|
---|
Example
heuristic = pyproteininference.heuristic.HeuristicPipeline( parameter_file=yaml_params, database_file=database, target_files=target, decoy_files=decoy, combined_files=combined_files, target_directory=target_directory, decoy_directory=decoy_directory, combined_directory=combined_directory, output_directory=dir_name, output_filename=output_filename, append_alt_from_db=append_alt, pdf_filename=pdf_filename, output_type="all" ) heuristic.execute(fdr_threshold=0.05)
Source code in pyproteininference/heuristic.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
generate_density_plot(number_stdevs_from_mean, pdf_filename=None)
This method produces a PDF Density Plot plot overlaying the 4 inference methods part of the heuristic algorithm.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/heuristic.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 |
|
generate_roc_plot(fdr_max=0.2, pdf_filename=None)
This method produces a PDF ROC plot overlaying the 4 inference methods apart of the heuristic algorithm.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pyproteininference/heuristic.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
|
LogElementHandler
Bases: Handler
A logging handler that emits messages to a log element.
Source code in pyproteininference/gui/gui.py
26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
run_inference_analysis_async(q, config)
Run some heavy computation that updates the progress bar through the queue.
Source code in pyproteininference/gui/gui.py
41 42 43 44 45 |
|