1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vovangra [49]
3 years ago
14

1. Extract title Write a function extract_title that takes one parameter, the filename of a GenBank formatted file, and returns

a string with the title of the dataset. The title is what follows the first occurrence of the tag "TITLE" and goes all the way before the tag "JOURNAL". Be aware that the title might extend in more than one lines; i

Computers and Technology
1 answer:
trapecia [35]3 years ago
6 0

Answer:

def extract_title(file):

   import re

   a =''

   with open(file,'r') as file:

       for line in file:

           a += line

       m = re.search("^(TITLE)(.*?)(JOURNAL)", a, re.M + re.S)

       print(m.groups()[1])

extract_title('new.txt')

Explanation:

The programming language used is python 3.

The function is first defined and the regular expression module is imported.

A variable is initialized to an empty string that will hold the content of the GenBank formatted file.

The file is opened and every line in the file is assigned to the string variable. The WITH statement allows files to be closed automatically.

Regular expression is used to capture all the files between TITLE and JOURNAL in a group.

The group is printed and the function is called.

I have attached a picture of the code in action.

You might be interested in
Directions: Give the shortcut key for the following commands: 1. Open 2. Save 3. New document 4. Copy 5. Undo 6. Redo 7. Paste 8
stepan [7]

Answer:

Explanation:

1 : Ctrl + X

2 Ctrl + C

3 Ctrl + L

4 Ctrl + V

5 Ctrl + B

6 Ctrl + R

7 Ctrl + I

8 Ctrl + E

9 Ctrl + U

10 Ctrl + Z

11 Ctrl + Y

12 Ctrl + N

End

13 Ctrl + A

Home

14 Ctrl + J

15 Ctrl + 2

16 Ctrl + S

17 Ctrl + 1

18 F12

19 Ctrl + W

-----------

20 Ctrl + K

21 Ctrl + ]

22 Ctrl + (left arrow)

23 Ctrl + (right arrow)

24 Ctrl + [

25 Ctrl + Del

26 Ctrl + 5

27 F1                                                         pls mark me as brainliest and              

                                                                   check all the short cuts

8 0
3 years ago
How can you get feedback on your presentation from someone who is far away?
My name is Ann [436]

Answer:

C. Record your presentation...

I think this because if you want feedback you would definetly talk and record your presentation so the person can give you a clear response

8 0
3 years ago
Read 2 more answers
Write a C++ console program to do the following: 1. Define an array of ints with the ten elements { 0, 1,2,3, 4, 5, 6, 7, 8, 9 }
Gemiola [76]

Answer:

#include<iostream>

#include <vector>

#include <list>

using namespace std;

int main(){

int a[10]={0,1,2,3, 4, 5, 6, 7, 8, 9 };

std::vector<int> v (&a[0],&a[0]+10);

std::list<int> l (&a[0],&a[0]+10);

int b[10];

for(int i=0;i<10;i++){

b[i]=a[i];

}

std::vector<int> v2(v);

std::list<int> l2(l);

for(int i=0;i<10;i++){

b[i]+=2;

}

for(int i=0;i<10;i++){

v2[i]+=3;

}

for (std::list<int>::iterator it = l2.begin(); it != l2.end(); it++)

*it=*it+5;

cout<<"Each containers value are: "<<endl;

cout<<"1st array: "<<endl;

for(int i=0;i<10;i++){

cout<<a[i]<<" ";

}

cout<<"\n 1st vector: \n";

for(int i=0;i<10;i++){

cout<<v[i]<<" ";

}

cout<<"\n 1st List is:\n";

for (std::list<int>::iterator it = l.begin(); it != l.end(); it++)

cout << *it << ' ';

cout<<"\n 2nd array: "<<endl;

for(int i=0;i<10;i++){

cout<<b[i]<<" ";

}

cout<<"\n 2nd vector:\n";

for(int i=0;i<10;i++){

cout<<v2[i]<<" ";

}

cout<<"\n 2nd list:\n";

for (std::list<int>::iterator it = l2.begin(); it != l2.end(); it++)

cout << *it << ' ';  

return 0;

}

Explanation:

  • Initialize an array, a vector and a list of type integer .
  • Create a 2nd array, vector, and list as a copy of the first array, vector, and list.
  • Increase the value of each element in the array by 2 , vector by 3 and list by 5.
  • Finally display the relevant results.
7 0
3 years ago
Your employer has the ability to protect you from cave-ins and other hazards by
djverab [1.8K]
Excavations are made entirely in stable rock; or ... Excavations are less than 5 feet (1.52 m) in depth and examination of the ground by a competent person provides no indication of a potential cave-in.
8 0
3 years ago
. the fact that a web app is written to be run within any of the standard
Evgen [1.6K]

The correct answer is C) ease of use.

The fact that a web app is written to be run within any of the standard browser and on any platform on which that browser operates is called "ease of use."

The ease of use concept indicates that the product is "amicable" or "friendly" to use by most people because it is not required andy technical knowledge to operate the product. In this case,  the app is written to be run within any of the standard browser and on any platform on which that browser operates, so it is "friendly" to operate bu most systems. App's companies and software companies created this "ease of use" concept for many of their products so they can sell most of them because people know they are easy to use and functional.

7 0
4 years ago
Other questions:
  • Jennifer has written a short story for children. What should be her last step before she submits the story for publication?
    11·1 answer
  • Tom's Art Supplies used to sell art supplies through mail order catalogs, but the company's order takers often had difficulty de
    5·1 answer
  • You know a Linux command will perform a desired function for you, but you cannot remember the full name of the command. You do r
    14·1 answer
  • If you ping a device, you are using the______protocol
    11·1 answer
  • To reduce inflation, the Federal Reserve _____ the money supply. This action also causes the economy to shrink.
    13·2 answers
  • Imagine the user types in a complete sentence, but we want to read only the first word and place it in the String variable word.
    11·1 answer
  • What is the best kernel synchronization solution on multicore systems when a lock is held for brief periods ?
    14·1 answer
  • at the bank there is 4 lines with 7 costumers and there are five customers left over. how many customers are there​
    12·1 answer
  • Justice wrote a program and forgot to put the steps in the correct order. Which step does she need to review?
    5·2 answers
  • A.Distance sensor<br> b.Programable microcontroller<br> c.Ambient light sensor<br> d.Wi-Fi
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!