How do you write a python script to take a .txt nucleotide file and convert it to an amino acid sequence?
-
THIS IS WHAT I CURRENTLY HAVE #! /usr/bin/env python #This program takes a nucleotide sequence #and converts it to an amino acid sequence #and determines the amino acid sequence molecular weight #open a nucleotide data file InFileName="nt.gene1.txt" #open the input file for reading InFile= open(InFileName, 'r') #Out file will be saved as a .txt file OutFileName=InFileName + ".txt" OutFile=open(OutFileName,'w') #Initialze the counter used to keep track of line LineCounter=0 NtList=[] #Loop through every odd line in the file one by one (excludes the accession number) for line in InFile: if (LineCounter%2)==1: NtList.append(line) LineCounter=LineCounter+1 Here is my dictionary file: #Dictionary of nucleotide combinations for amino acid Nt2proteinDict={ 'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M', 'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T', 'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K', 'AGC':'S', 'AGT':'S', 'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S', 'AGA':'R', 'AGG':'R', 'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R', 'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L', 'TTA':'L', 'TTG':'L', 'CCA':'P', 'CCC':'P', 
-
Answer:
Type the appropriate codings according to the format of the file.... Good luck!
Woan at Yahoo! Answers Visit the source
Other answers
Type the appropriate codings according to the format of the file.... Good luck!
Related Q & A:
- How do I make a python web program that is on a ubuntu server allow access to the server?Best solution by Yahoo! Answers
- how can I write this shell script in python?Best solution by Stack Overflow
- How do you submit a movie script?Best solution by Yahoo! Answers
- How to start creating a php script, that will be installed on many servers?Best solution by Stack Overflow
- How long should I give a prof to write a letter of recommendation for a graduate school application?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.