-
Notifications
You must be signed in to change notification settings - Fork 45
HW4_Sapozhnikov #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
HW4_Sapozhnikov #22
Changes from all commits
d98ccaf
42c89b3
873f7d7
86f281b
231efcc
09d4711
1e98426
d6f1bfd
f5e4308
c80ea15
3e337f7
197d0a4
c318a3a
96e209d
ca4847a
703249c
1ba062b
b21741c
463dbf3
f19c48e
2d5e2de
a29692d
6ce8cf8
5cc5a9b
3d32430
e359ad1
be1abc5
05caf3c
1bdbb2f
3d76bb5
f32641a
9d6f687
9563f39
597f21b
f6a34ef
f6e10e8
fc97f7d
ca5cf54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/* |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,109 @@ | ||||||||||||||||||||||
# HW 4. Functions 2 | ||||||||||||||||||||||
> *This is the repo for the fourth homework of the BI Python 2023 course* | ||||||||||||||||||||||
|
||||||||||||||||||||||
### Prototool | ||||||||||||||||||||||
`prototool.py` is a special script for working with polyaminoacid sequences | ||||||||||||||||||||||
|
||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
### Overview | ||||||||||||||||||||||
`prototool.py` includes 7 methods to treatment of polyaminoacid sequences. | ||||||||||||||||||||||
`prototool.py` can be used for the following purposes: | ||||||||||||||||||||||
- recoding 1-letter coded polyaminoacid seqeunces into 3-letter coded and vice versa; | ||||||||||||||||||||||
- polyaminoacid sequences aligment with Smith-Waterman algorithm [^1]; | ||||||||||||||||||||||
- finding possinle RNA sequences for given polyaminoacid sequences; | ||||||||||||||||||||||
- determining polyaminoacid isoelectric point; | ||||||||||||||||||||||
- calculating polyaminoacid molecular weight; | ||||||||||||||||||||||
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
- finding possinle DNA sequences for given polyaminoacid sequences; | ||||||||||||||||||||||
- determining GC-content of a corresponding DNA sequence to a given polyaminoacid sequence | ||||||||||||||||||||||
|
||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
### Usage | ||||||||||||||||||||||
This tool can be used both standalone and as module. | ||||||||||||||||||||||
- to use `prototool` standalone you will have to add these lines in the code | ||||||||||||||||||||||
 | ||||||||||||||||||||||
- where *args are sequences you want to process and method is a specified algorithm to use | ||||||||||||||||||||||
- your result will be written in a variable (test on a picture) | ||||||||||||||||||||||
- to use `prototool` as module (recomended) you should import it as any other module (check the path: prototools.py should be in the same directory as your script). Then you can freely use any of its functions (see examples). | ||||||||||||||||||||||
|
||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
### Options | ||||||||||||||||||||||
Arguments: | ||||||||||||||||||||||
- `*args[str]` sequences to work with. You can pass several arguments into all functions | ||||||||||||||||||||||
- `method` - a method to use | ||||||||||||||||||||||
|
||||||||||||||||||||||
output: All functions return a dict, where keys are original sequenses, values are results after using a corresponding method. | ||||||||||||||||||||||
|
||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
### Examples | ||||||||||||||||||||||
|
||||||||||||||||||||||
def recode allows to translate 1-letter to 3-letters polyaminoacids code | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
- `main('AlaValTyr', 'DNT', method = 'recode')` | ||||||||||||||||||||||
- `recode('AlaValTyr', 'DNT')` | ||||||||||||||||||||||
-  | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Круто что вы вставили скриншоты! Тем не менее, в реальных тулах и README в таком случае лучше переключаться на светлую тему |
||||||||||||||||||||||
*** | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Тут между примерами имхо эти линии не нужны, а то совсем README получается рсчерченым в линеечку |
||||||||||||||||||||||
|
||||||||||||||||||||||
def local_alignmen perform a local alignment of 2 given sequences. Needs at least two sequences to be passed | ||||||||||||||||||||||
- `main('MetAsnTrp', 'MNT', method='local_alignment')` | ||||||||||||||||||||||
- `local_alignmen('MetAsnTrp', 'MNT')` | ||||||||||||||||||||||
- Note that local_alignment function has a flag prettify (default = True) that prints out aligned sequences on each another | ||||||||||||||||||||||
-  | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
def from_proteins_seqs_to_rna allows to decode polyaminoacid sequences in RNA sequences | ||||||||||||||||||||||
- `main('AlaValTyr', 'DNT', method = 'from_proteins_seqs_to_rna')` | ||||||||||||||||||||||
- `from_proteins_seqs_to_rna('AlaValTyr', 'DNT')` | ||||||||||||||||||||||
-  | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
def isoelectric_point_determination allows to determine isoelectric point of polyaminoacid sequences | ||||||||||||||||||||||
- `main('AlaValTyr', 'DNT', method = 'isoelectric_point_determination')` | ||||||||||||||||||||||
- `isoelectric_point_determination('AlaValTyr', 'DNT')` | ||||||||||||||||||||||
-  | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
def back_transcribe allows to decode polyaminoacid sequences in DNA sequences | ||||||||||||||||||||||
- `main('AlaValTyr', 'DNT', method = 'back_transcribe')` | ||||||||||||||||||||||
- `back_transcribe('AlaValTyr', 'DNT')` | ||||||||||||||||||||||
-  | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
def count_gc_content allows to count the ratio of GC in the entire DNA sequence | ||||||||||||||||||||||
- `main('AlaValTyr', 'DNT', method = 'count_gc_content')` | ||||||||||||||||||||||
- `count_gc_content('AlaValTyr', 'DNT')` | ||||||||||||||||||||||
-  | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
def count_protein_molecular_weight allows to calculate the molecular weight of the polyaminoacid | ||||||||||||||||||||||
- `main('AlaValTyr', 'DNT', method = 'count_protein_molecular_weight')` | ||||||||||||||||||||||
- `count_protein_molecular_weight('AlaValTyr', 'DNT')` | ||||||||||||||||||||||
-  | ||||||||||||||||||||||
|
||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
### Troubleshooting | ||||||||||||||||||||||
If you have `ValueError("No input defined.")` it means, that you have an empty input. Please, enter the correct input. | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
If you have `ValueError(method, " is not a valid method.")` it means, that your tool is not correct. Please, enter the right tool. | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
If you have `ValueError('Non-protein aminoacids in sequence')` it means, that your sequences contain non-protein aminoacids. Please, check your sequences and enter the correct input. | ||||||||||||||||||||||
|
||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
### Contributions and contacts | ||||||||||||||||||||||
|
||||||||||||||||||||||
Feel free to report any bugs and problems encountered. | ||||||||||||||||||||||
Email: [email protected] developed recode(), prettify_alignment(), local_alignmen(), check_input() | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
[email protected] developed from_proteins_seqs_to_rna(), isoelectric_point_determination() | ||||||||||||||||||||||
*** | ||||||||||||||||||||||
[email protected] developed back_transcribe(), count_gc_content(), count_protein_molecular_weight() | ||||||||||||||||||||||
Comment on lines
+99
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
||||||||||||||||||||||
*** | ||||||||||||||||||||||
|
||||||||||||||||||||||
### References | ||||||||||||||||||||||
|
||||||||||||||||||||||
[^1]: T.F. Smith, M.S. Waterman, (1981). [Identification of common molecular subsequences](https://doi.org/10.1016/0022-2836(81)90087-5). Journal of Molecular Biology. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.