Package: predict-phytolrr
An overview to the predict-phytolrr programThepredict-phytolrrprogram could identify LRRs effectively, especially forLRR motifs in plant LRR-RLKs.The program is based on the position specific scoring matrix (PSSM) algorithm and its training dataset are 4000 LRR motifs highly conserved sequences (HCSs) from LRR-RLKs of 17 land plant species. Please find detailed information athttps://www.phytolrr.com/about.Citation for Phyto-LRRIf the corresponding features in thepredict-phytolrrprogram were applied for your analysis, please cite the following paper:Chen, T. Identification and characterization of the LRR repeats in plant LRR-RLKs. BMC Mol and Cell Biol 22, 9 (2021).https://doi.org/10.1186/s12860-021-00344-yInstall the programpredict-phytolrrcan be installed usingpipONLYunder Python3 environment:$pipinstallpredict-phytolrrA virtual environment(virtutalenv e.g.) is recommended to prevent the damage of the system-wide Python environment.Run the programYou can run the program in two ways:run predict-phytolrr from the command lineimport the phytolrr_predictor module in the python source codePredict Plant LRRs from the command lineThepredict-phytolrrcould accept sequence(s) in either directly input from the command line or in fasta file(s), predict the LRRs, and print out the results either in the command line or in html files.Two ways to feed the sequencesFirst way:The sequence can be written directly through thecommand line:$predict-phytolrrMKLPHLLPFLTLILFAFAFSMTLPLMSESHLSLLNNRTDQQ....(verylong)PredictionresultforseqUnknown_from_cmd_line:
LRRoffset8,FLTLILFAFAFSMTLP,score5.68619738546084
LRRoffset81,VTYLNLTHTGLQGTLT,score17.662632191299593
LRRoffset105,LRVLALRNNSLQGSIP,score36.37469484306763
LRRoffset129,LQVLRVSQNQLEGKIP,score35.079609050990754
LRRoffset153,LQRLILSYNRLEGSIP,score39.13663517011341
...manyotherresultsfollowedSecond way:The sequences can also be read from fasta files. Assuming the filetest.fastacontains one or more sequences, to predict LRRs for all the sequences in the file, use the-foption to specify a fasta file:$predict-phytolrr-ftest.fasta
ThesequenceAL3G49070.t1containsunexpectedamino*,willnotbepredicted
ThesequenceAL3G41990.t1containsunexpectedamino*,willnotbepredicted
ThesequenceAL8G14250.t1containsunexpectedamino*,willnotbepredicted
PredictionresultforseqAL5G26370.t1:
LRRoffset82,VTGVDLGGLKLTGVVS,score20.609043937370146
LRRoffset106,LRSLNLADNFFRGAIP,score33.523950081875626
LRRoffset130,LQYLNMSNNFLGGVIP,score34.2935452040218
LRRoffset154,LSTLDLSSNHLEQGVP,score29.383744295363456
LRRoffset178,LVILSLGRNNLTGKFP,score34.567366699698404
...otherpredictedLRRsforseqAL5G26370.t1

PredictionresultforseqAL5G26330.t1:
LRRoffset74,VTRLDLGGLQLGGVIS,score24.76974498840441
LRRoffset98,LISLNLYDNSFGGTIP,score34.4857875432728
LRRoffset122,LQHLNMSYNFLGGGIP,score31.754313744552327
LRRoffset146,LLELDLISNHLGHCVP,score10.059227438374975

...manyotherresultsfollowedMore than one fasta files could also be accepted by using the-foption for each fasta file:$predict-phytolrr-ftest1.fasta-ftest2.fasta

...allpredictionresultsforallsequencesintest1.fastaandtest2.fastaNOTESequences with undefined amino acids read from fasta files, for instance "X", "*", will be skipped in the prediction process.The asterisk "*" at the end of the fasta sequence will be removed automatically during the prediction process.To display the results in htmlThe result can also be dumped to HTML files, so that they can be viewed in a browser. Using the-poption to specify the root path of the resulting HTML files:$predict-phytolrr-ftest1.fasta-p./
Warning:ThesequenceAL3G49070.t1containsunexpectedamino*,willnotbepredicted
Warning:ThesequenceAL3G41990.t1containsunexpectedamino*,willnotbepredicted
Warning:ThesequenceAL8G14250.t1containsunexpectedamino*,willnotbepredicted214sequenceswerepredictedandtheresultshavebeensavedinthefileresults.htmlThe program will generate two files:results.jsto save the prediction resultsresults.htmlto show the prediction resultsTo specify a self-defined training dataset(motifs)If you have some motifs, and you want to predict LRRs based on the PSSM matrix which is generated by the motifs,
you can use the option-t/--train-motifs-fileto specify a path to a file which contains self-defined training-motifs.
The training-motifs-file should contains multiple motifs, and each motif per line with the same length.
The motifs length is not necessary to be 16. For example, the content of the training-motifs-file may like:LEVLFLHGNQL
VTYLNLTHTGL
LQIFSIGGCHI
LKLLHLHHNFV
(More motifs follow)The length of the predicted motifs will be of the same length with the motifs of the training dataset.Predict Phyto LRRs in source codeThepredict-phytolrralso provides an API interface, so that it can be easily integrated into other python projects.To usepredict-phtolrrto predict phyto-LRRs, just importphytolrr_predictorand callpredict, which is defined as:defpredict(seq,matrix=None):"""Predict motifs from the `seq` str. If the `matrix` is None, using the built-in matrix to predict motifs"""Code example:>>> import phytolrr_predictor
>>> test_seq = 'MGILFFLFALTLTLSSLSSSVFGLTQDGEALLEMKRGLNDTKGLLSNWKDTDINPCNWTRISCHLHDQRVRVINLPFLRLGGTISPSIGKITRLHRLAIH'
>>> ms = phytolrr_predictor.predict(test_seq)
>>> print(len(ms))
2
>>> print(ms[0].offset)                             # Print the offset of the first predicted motif 
6
>>> print(test_seq[ms[0].offset:ms[0].offset+16])   # Print the first predicted motif
LFALTLTLSSLSSSVF
>>> print(ms[0].score)
10.774822491308072
>>> print(ms[0].probability)
0.0005707622379645206
>>> print(ms[0].fdr_probability)
0.04882352941176471To use self-defined matrix to predict motifs, the matrix should be generated using functionpssm_matrix.calc_pssm_matrix:defcalc_pssm_matrix(motif_seqs_str):"""Generate the PSSM matrix from baseline motifs `motif_seqs_str`"""Code example:>>> import phytolrr_predictor
>>> from phytolrr_predictor.tools import pssm_matrix
>>> baseline = [
'LEVLFLHGNQLENDPY',
'VTYLNLTHTGLQGTLT',
'LQIFSIGGCHIKGSIP', ....]
>>> matrix = pssm_matrix.calc_pssm_matrix(baseline)
>>> ms = phytolrr_predictor.predict(test_seq, matrix)
# other operations...