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
A type of memory that is expensive and therefore is often used only in cache memory applications.
tatuchka [14]
SRAM [STATIC] is a type of memory, it is five times faster than DRAM [which is found in most computers] and it depends on the use of electricity. It is designed in such a way that its constant refreshing is not require, it is much more expensive than the DRAM and it is therefore only used in cache memory application.<span />
6 0
3 years ago
Read 2 more answers
Illl give brainliest plzzzzzzzzzz
salantis [7]

The one paste symbol name is : paste settings

it consist of 'paste special' and 'set default paste if im not wrong'

3 0
3 years ago
Which button do you use to put data in a specific order
3241004551 [841]
<span>arrange a list of names in alphabetical order, compile a list of product inventory levels from highest to lowest, or order rows by colors or icons</span>
8 0
3 years ago
When using a NUMBERED list, you do not have to number each item. HTML automatically numbers each item in the order the items are
Oksi-84 [34.3K]

Answer:

hypertext markup language

Explanation:

i hope this helps, though im not sure weather your asking what HTML means, or a list of uses for HTML.

5 0
3 years ago
Dora electronically transferred $591.68 from her checking account to Matt's checking account. In what column of the check regist
Allisa [31]
The answer is D.Payment/Debit
4 0
3 years ago
Read 2 more answers
Other questions:
  • Two technicians are discussing using a lift to raise a vehicle. Technician A says to be sure the lift pads on the lift are conta
    10·2 answers
  • The opening of the throttle plate can be delayed as long as
    13·1 answer
  • Which statement is true
    12·1 answer
  • After a file downloads, you can do any of the following except
    13·1 answer
  • Which of the following statements isNOT true about abstract data types (ADTs)?A list is anexample of an ADT.ADTs hide theimpleme
    7·1 answer
  • How can you access the Help and Support system?
    12·2 answers
  • Which of the following is a Microsoft solution
    11·1 answer
  • Who here has a crush on jk from bts but feels more mature than him
    10·2 answers
  • Write a complete method to create an array of random integers. The method takes in three integer parameters: the array size, the
    9·1 answer
  • 3. What report shows what mobile devices were used to view a website?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!