Computational-Biology Lab 6-Solution

$30.00 $24.00

— Regular Expressions Task 1 Answer the questions below first by just looking at the online material without testing the regexp, record your answers. The, try to see whether your answers are correct by testing each question using https://regexr.com. Save your pre-test and post-test answers in the table below. Multiple answers are possible for each…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

Regular Expressions

Task 1

Answer the questions below first by just looking at the online material without testing the regexp, record your answers. The, try to see whether your answers are correct by testing each question using https://regexr.com. Save your pre-test and post-test answers in the table below. Multiple answers are possible for each question.

1. Which of the following matches regexp `a(ab)*a`

1) `abababa`

2) `aaba`

3) `aabbaa`

4) `aba`

5) `aabababa`

2. Which of the following matches regexp `ab+c?`

1) `abc`

2) `ac`

3) `abbb`

4) `bbc`

3. Which of the following matches regexp `a.[bc]+`

1) `abc`

2) `abbbbbbbb`

3) `azc`

4) `abcbcbcbc`

5) `ac`

6) `asccbbbbcbcccc`

4. Which of the following matches regexp `abc|xyz`

1) `abc`

2) `xyz`

3) `abc|xyz`

5. Which of the following matches regexp `[a-z]+[\.\?!]`

1) `battle!`

2) `Hot`

3) `green`

4) `swamping.`

5) `jump up.`

6) `undulate?`

7) `is.?`

6. Which of the following matches regexp `[a-zA-Z]*[^,]=`

1) `Butt=`

2) `BotHEr,=`

3) `Ample`

4) `FIdDlE7h=`

5) `Brittle =`

6) `Other.=`

7. Which of the following matches regexp `[a-z][\.\?!]\s+[A-Z]`

1) `A. B`

2) `c! d`

3) `e f`

4) `g. H`

5) `i? J`

6) `k L`

8. Which of the following matches regexp `(very )+(fat )?(tall|ugly) man`

1) `very fat man`

2) `fat tall man`

3) `very very fat ugly man`

4) `very very very tall man`

9. Which of the following matches regexp `<[^>]+>`

1) `<an xml tag>`

2) `<opentag> <closetag>`

3) `</closetag>`

4) `<>`

5) `<with attribute=”77”>`

# Answers

| no | pre-test | post-test |

|—–|:——–:|:———:|

| 1 | 2,5 | 2,5 |

| 2 | 1 | 1 |

| 3 |1,2,3,4,6 | 1,2,3,4,6 |

| 4 | 1,2 | 1,2 |

| 5 | 1,4,6 | 1,4,6 |

| 6 | 2 | 1,5,6 |

| 7 | 4,5 | 4,5 |

| 8 | 3,4 | 3,4 |

| 9 | NA | 1,2,3,5 |

Push

The only file that you need to push is the `README.md` file.

Task 2

Go to http://play.inginf.units.it scroll down, select `novice`, enter your information, click on Next. Read the information, select all boxes and click on `Start the test!`.

Complete the first 5 tasks. Write the answers in the table below.

# Answers

| no | regexp | F-measure |

|—–|:——:|:———:|

| 1 | \d | 100 |

| 2 | ([0-9\|a-z]+:[0-9\|a-z]+){5} | 100 |

| 3 | [a-z]{3}://(\w)+.[a-z]*.FreeBSD.org/pub/FreeBSD/ | 100 |

| 4 | \$[^$]+\$ | 100 |

| 5 | [0-9]+(\.[0-9]+){3} | 100 |

| 6 | href=(“[^”]+”\|'[^’]+’) | 100 |

| 7 | http://[^\s\|^>\|]+[^=>\s\.] | 100 |

Task 3

Write below a regex to find bacterial ORFs in a DNA string that has minimum 300 and maximum 1500 nucleotides. Note that ORF has to start with the start codon (ATG) and ends with one of the three stop codons (TAG, TAA, TGA), start and stop codons must be in “frame”.

“`

ATG.{297,1497}(TAG|TAA|TGA)

“`

Homework

Find out how to use regex in Python. Apply your regex to find all ORFs in the [`E. coli` genome](ftp://ftp.ensemblgenomes.org/pub/bacteria/release-45/fasta/bacteria_0_collection/escherichia_coli_str_k_12_substr_mg1655/dna/Escherichia_coli_str_k_12_substr_mg1655.ASM584v2.dna.chromosome.Chromosome.fa.gz).

Hint: use `re` package. Here is the [documentation](https://docs.python.org/3/library/re.html).

Push your script and a file including all ORFs you found to the same repository by the end of the week **Friday 11:59pm**.

Computational-Biology Lab 6-Solution
$30.00 $24.00