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
Custodial workers that access the terminal area must have a fingerprint background check done and training unless they are escor
tensa zangetsu [6.8K]

Answer:

True they do. mark brainliest.!!!!! please

Explanation:

6 0
2 years ago
What device connects a lan's switch to the next network? qizzlets?
laila [671]
I think you can call it to a Network Switch, but LAN is always used device network: Hubs and Switch or maybe Connect Device or Cable.
6 0
2 years ago
Name the default<br><br>package of java​
melisa1 [442]
I think it should be Java of package instead
8 0
3 years ago
Whitespace consists of all of the following, except
nydimaria [60]
It is C: COMMAS!!!
i hope i helped you!
4 0
3 years ago
Read 2 more answers
What is the name of the first program created using Scratch?
disa [49]

Answer:

Weekend

Explanation:

Scratch is a type of programming language that is block-based and has children as its target audience. With this, users can make online projects using the program interface.

The name of the first program created using Scratch was created and named Weekend.

6 0
3 years ago
Other questions:
  • Which strategy are you using when you only read the title, section headings, and captions?
    12·2 answers
  • …………………..is made upof plastic or glass fibers that transmit data at very fastspeeds.
    10·1 answer
  • Although highly accurate navigational information from the GPS constellation is exploitable by adversary forces, it is unlikely
    5·1 answer
  • Type an SQL statement into the Record Source property of the report. The statement should select all fields (*) for employees wi
    5·1 answer
  • An address has a house number, a street, an optional apartment number, a city, a state and a postal code. Define the constructor
    5·1 answer
  • Why is simplicity important in navigation design?
    13·1 answer
  • 4.15 LAB: Password modifier
    14·1 answer
  • which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) short
    9·1 answer
  • Write a paragraph about ICT in personal life?
    12·1 answer
  • The email_list function receives a dictionary, which contains domain names as keys, and a list of users as values. Fill in the b
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!