By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

Genetics

P: 14
I have to write a genetics program:
This is the INPUT:

25 sets of genetic sequences are provided. Each sample is provided in a specific format so that my program may read in the genetic information for the purposes of processing. The following is the first genetic sequence provided:

Sample 0:CTACGCTATC
Sample 1:TTACGCTATC
Sample 2:TTACGCTATC
Sample 3:TTACGCTATC
Sample 4:TTACGCTATC
Sample 5:CTACGCTATC
Sample 6:ATACGCTATC
Sample 7:ATACGCTATC
Sample 8:ATACGCTATC
Sample 9:TTACGCTATC
Sample 10:CTACGCTATC
Sample 11:GTACGCTATC
Sample 12:ATACGCTATC
Sample 13:TTACGCTATC
Sample 14:GTACGCTATC
Sample 15:ATACGCTATC
Sample 16:TTACGCTATC
Sample 17:GTACGCTATC
Sample 18:ATACGCTATC
Sample 19:ATACGCTATC
Each line within sample file has the following format:
Sample<space>#:Genetic sequence

That is, the word "Sample", followed by a space, followed by a number (starting at 0), followed by a colon (:) followed by the genetic sequence. The genetic sequence length can vary. Each genetic sequence is terminated by a newline character (\n). Your program is required to open a data file containing genetic information in the above format. It will have read in the genetic information into data structures (probably a list) so that it can be processed.

OUTPUT:
Because the data sets within this assignment are so large, the correctness of my results will have to be checked automatically using the diff program. In order for the diff program to report your answers correctly, my output must match EXACTLY. Therefore, I cannot deviate from the output format defined here. My output must be in the following form:

Sequence:genetic sequence you found
Length:#
Amino Acid list

The following is an example output:

Sequence:TACGCTATC
Length:9
AUG : (Met/M)Methionine, Start[1]
CGA : (Arg/R)Arginine
UAG : Amber (Stop)
Nov 21 '06 #1
Share this Question
Share on Google+
2 Replies


bartonc
Expert 5K+
P: 6,596
Now, you know that we're not going to do you work for you.
Post some code here to show that you are making an effort.

Oh, and by the way, how did zellers congrunence turn out?
You have several threads on this forum that are left hanging because you nerver post back with so much as a "That works, thanks". We are here to help you, and like to feel appreciated for our trouble (we don't get paid to do this - it is out of the goodness of our hearts). So please show us that you are making an effort and show some appreciation. Thanks,
Barton (python forum moderator)
Nov 21 '06 #2

kudos
Expert 100+
P: 126
Expand|Select|Wrap|Line Numbers
  1. import sys
  2. filename = sys.argv[1]
  3. fd = open(filename,"r")
  4. filecontent = fd.readlines()
  5.  
  6. for entry in filecontent:
  7.  print (entry.split(":")[1]).strip("\n")
  8.  
Here is a simple snippet that will read the sequence. Now, could you explain how 'TACGCTATC' becomes

AUG : (Met/M)Methionine, Start[1]
CGA : (Arg/R)Arginine
UAG : Amber (Stop)[/quote]

(I sleept throught my genetics classes :)

-kudos





I have to write a genetics program:
This is the INPUT:

25 sets of genetic sequences are provided. Each sample is provided in a specific format so that my program may read in the genetic information for the purposes of processing. The following is the first genetic sequence provided:

Sample 0:CTACGCTATC
Sample 1:TTACGCTATC
Sample 2:TTACGCTATC
Sample 3:TTACGCTATC
Sample 4:TTACGCTATC
Sample 5:CTACGCTATC
Sample 6:ATACGCTATC
Sample 7:ATACGCTATC
Sample 8:ATACGCTATC
Sample 9:TTACGCTATC
Sample 10:CTACGCTATC
Sample 11:GTACGCTATC
Sample 12:ATACGCTATC
Sample 13:TTACGCTATC
Sample 14:GTACGCTATC
Sample 15:ATACGCTATC
Sample 16:TTACGCTATC
Sample 17:GTACGCTATC
Sample 18:ATACGCTATC
Sample 19:ATACGCTATC
Each line within sample file has the following format:
Sample<space>#:Genetic sequence

That is, the word "Sample", followed by a space, followed by a number (starting at 0), followed by a colon (:) followed by the genetic sequence. The genetic sequence length can vary. Each genetic sequence is terminated by a newline character (\n). Your program is required to open a data file containing genetic information in the above format. It will have read in the genetic information into data structures (probably a list) so that it can be processed.

OUTPUT:
Because the data sets within this assignment are so large, the correctness of my results will have to be checked automatically using the diff program. In order for the diff program to report your answers correctly, my output must match EXACTLY. Therefore, I cannot deviate from the output format defined here. My output must be in the following form:

Sequence:genetic sequence you found
Length:#
Amino Acid list

The following is an example output:

Sequence:TACGCTATC
Length:9
AUG : (Met/M)Methionine, Start[1]
CGA : (Arg/R)Arginine
UAG : Amber (Stop)
Nov 21 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.