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
What are video games and what have they meant for society?
Paraphin [41]

video games are a source of entertainment for people especially children.

it helps relieve stress for adults or grown ups.

society sees video games as a negative impact on children and that it wastes their time.

8 0
3 years ago
Read 2 more answers
A .jpg file is an example is an example of which if the following file types
Setler79 [48]
Answer chooses would help but a .jpg is a picture
4 0
3 years ago
When Brittany practiced her presentation, she gave a trusted adult a presentation checklist to use to critique her each time she
alexdok [17]
Track her improvement.

She can compare the checklists from each time she has practiced to see what she needs to work on.
5 0
3 years ago
A ____ is commonly a single device or server that attaches to a network and uses TCP/IP-based protocols and communications metho
Andrews [41]

Answer: Network-attached storage

Explanation:

Network-attached storage is the data storage server that is  attached with computing system for providing accessing ability to different client groups and various other users .

  • They can recollect the data the main location that holds the file-level data .
  • This device is connected with the network and uses TCP/IP-related and other file sharing protocol for functioning of data and file access in online data storage connection

7 0
3 years ago
Can anyone give me the code for 3.9.6: Colorful Bracelet (CodeHS)
andreyandreev [35.5K]

Answer:

what?

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • ​_____ describes the process of using computer software to extract large amounts of data from websites. A. Sentiment analysis B.
    10·1 answer
  • The collaborative team responsible for creating a film is in the process of creating advertisements for it and of figuring out h
    15·1 answer
  • Which option of ms-word is used o represent data in an organised manner?
    10·1 answer
  • A "want" is very different than a "need'. What is a want?
    9·2 answers
  • How would you like your social media profiles/personas to be treated in the event of your death? why?
    6·2 answers
  • Who was the mvp of the 1989 nba regular season
    13·1 answer
  • What does it mean by “Your circles should shrink by half” sorry if this isn’t a clear picture.
    7·1 answer
  • Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character o
    8·1 answer
  • Which are characteristics of a video with a higher
    13·1 answer
  • Write a static method that takes a String and returns an integer. Return the number of characters in the passed in, String param
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!