Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
percolator committed Aug 14, 2023
1 parent 8cef3fd commit a247279
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions prog/p1/labp1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Edit this function to return the amino acid sequence of a provided DNA sequence
def dna2aa(dna_str):
aa_str = ''
aa_str = 'WAITING FOR IMPLEMENTATION'
return aa_str

# A dictionary converting codons to amino acids
Expand Down Expand Up @@ -75,6 +75,6 @@ def dna2aa_fasta(dna_filename, protein_filename):
# Test code for the dna2aa function.
# Will only be executed if this file is run directly e.g. with "python labp1.py"
if __name__ == "__main__":
dna2aa("ATGATGATG")
print(dna2aa("ATGATGATG"))
dna2aa_fasta('cdna.faa', 'output.faa')

18 changes: 8 additions & 10 deletions prog/p1/readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Programming Lab P1

This is an introductory lab for the programming part of the course.
Your task is to write a function that can convert DNA sequence to amino acid sequence.
To your help you have a scaffold of python code that you should use as to validate your code and also to make sure you follow a standard that the TAs can automatically validate.
This is an introductory lab for the programming part of the course. Your task is to write a function that can convert DNA sequence to amino acid sequence. To your help you have a scaffold of python code that you should use as to validate your code and also to make sure you follow a standard that the TAs can automatically validate.

## Preparations

Expand All @@ -12,10 +10,10 @@ If you are not yet familiar with the VScode software, watch for example this [sh

### Code Installation

Begin with downloading the project to your local computer by using this [link](https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2Fkth-gt%2Fcb2442%2Ftree%2Fmain%2Fprog%2Fp1).
Begin with downloading the project to your local computer by using this [link](https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2Fkth-gt%2Fcb2442%2Ftree%2Fmain%2Fprog%2Fp1).

Unzip the files into a directory and open the directory in VScode.

Unzip the files into a directory and open the directory in VScode.
```bash
$ unzip 'kth-gt cb2442 main prog-p1.zip'
$ code .
Expand All @@ -34,16 +32,16 @@ Also, set the list `authors` to contain all the group members names.

### Test

You can make an initial execution of your `dna2aa` function by running the ain function of the python file itself by executing the line,
You can make an initial execution of your `dna2aa` function by running the python file itself directly as top-level code by executing the line,

```bash
$ python3 labp1.py
$ python labp1.py
```

However ther final test of the code is done by executing the `runner.py` executable, which can be exected from command line as,
However ther final test of the code is done by executing the `runner.py` executable, which can be exected from command line as,

```bash
$ python3 runner.py
$ python runner.py
```

or just
Expand All @@ -57,4 +55,4 @@ If you implemented the function right, you will see your names apearing.

### Extra excercise

Change the behaviour of `dna2aa` so that it tries all thre possible frames of translation, and selects the amino acid sequence that has the longest orf of the three alternatives.
Change the behaviour of `dna2aa` so that it tries all thre possible frames of translation, and selects the amino acid sequence that has the longest orf of the three alternatives.

0 comments on commit a247279

Please sign in to comment.