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
Rewrite following program using for loop no=3456 while no>0 : print(no%10) no=no/10
PtichkaEL [24]

Answer:

no=3456  

for x in reversed(str(no)):

 print(x)

Explanation:

If you turn the number into a string and then reverse it, you can achieve the same output.

8 0
3 years ago
Read 2 more answers
Given six memory partitions of 300 KB, 600 KB, 350 KB, 200 KB, 750 KB, and 125 KB (in order). The memory allocation algorithm th
Makovka662 [10]

Answer:

The memory allocation algorithm that is used to place the processes given is the <u>First Fit Algorithm </u>

Explanation:

The First Fit Management Algorithm works by ensuring that the pointer keeps track of all the free spaces in the memory and accepts and executes all instructions to allocate a memory block to the coming process as long as it is big enough to hold the size of the process.

For example, the First Fit algorithm will allocate the processes in the first block that fits (that is, if it can fit the memory bock in the queue, then the process will be store)

It will work as follows (recall that the memory partitions are in order and must remain so):

A) 115 KB is stored in 300KB block, leaving the following free spaces (185KB, 600KB, 350KB, 200KB, 750KB, 125KB), next

B) 500 KB is store in a 600KB block leaving the following free spaces (185 KB, 100  KB, 350 KB, 200 KB, 750 KB, 125 KB), next  

C) 358 KB is stored in 750KB block, leaving the following free spaces (185KB, 100KB, 350KB, 200KB, 392KB, 125KB)  next

D) 200 KB is stored in 350KB block, leaving the following free spaces (185 KB, 100 KB, 150KB, 200KB, 392KB, 125KB)  next

E) 375KB is stored in 392KB block leaving (185KB, 100KB, 150KB,  200KB, 17KB, 125KB)

One of the demerits of this Algorithm is that, as shown above, memory is not maximized. It however is one of the easiest algorithms amongst all the other memory allocation processes.

Cheers

5 0
3 years ago
Select all True statements! Question 1 options: a) Host A is sending Host B a large file over a TCP connection. Assume Host B ha
VikaD [51]

<u>Solution:</u>

a)   False. Piggyback is used only for efficiency. If there's no data packet to be piggybacked to, then B will just send the acknowledgement packet.

b)  False. It is the size of the receiver's buffer that's never changed. RcvWindow is the part of the receiver's buffer that's changing all the time depending on the processing capability at the receiver's side and the network traffic.

c)  The given statement is True.

 d) False. The sequence number of the subsequent segment depends on the number of 8-byte characters in the current segment.

e)  True. Every TCP segment has a current value of rwnd in the receive window.

f)  False. Next_RTT = alpha * last_estimated_RTT + (1-alpha)*newly_collected_RTT_sample. In this case even though the last sampleRTT which is the newly_collected_RTT_sample is 1sec, the next_RTT still depends on alpha and last_estimated_RTT. Therefore, the next_RTT is not necessarily greater than 1sec.

g) False. The acknowledgement number has nothing to do with the sequence number. The ack. number indicates the next sequence number A is expecting from B.

5 0
4 years ago
When you save data on a disk, the os places it in an available storage area, or?
creativ13 [48]
<span>When you save data on a disk, the OS places it in an available storage area, or a "Sector".
Usually the computer places that data in sectors in an order and usually next to each other but that is not the case always, sometimes part/s of that data can be scattered at different places which actually slows down the computer, for which we need to </span><span>Defragment </span>the disk space.   
7 0
3 years ago
Which of the following statements is true concerning the Internet of Things (IoT)? Wearable technologies are the only devices th
zvonat [6]

Answer:

i was looking and i think the answer would be growth slowing down but i might be wrong

Explanation:

3 0
3 years ago
Other questions:
  • To include all fields in a sql query, use the ____ symbol after the word select.
    7·1 answer
  • Dani wants to create a web page to document her travel adventures. Which coding language should she use? HTML Java Python Text
    15·1 answer
  • We will pass in a value N. Ouput every even value between 0 and N. Tip: you may remember the modulo operator. 10 % 3 returns the
    5·1 answer
  • What can you say about the following Java class definition?
    10·1 answer
  • What are the different components of the cloud architecture? The of the cloud architecture is the cloud, which is a collection o
    11·1 answer
  • What is the Documenter?
    10·1 answer
  • You want to boot a linux system into singer user mode/ what options might you add to a linux kernel options list in a boot loade
    9·1 answer
  • 1. Write a program that uses String method regionMatches to compare two strings input by the user. The program should prompt the
    8·1 answer
  • 16
    10·1 answer
  • Using language c, find the nth Fibonacci, knowing that nth Fibonacci is calculated by the following formula: - If n = 1 Or n = 2
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!