Translation from fasta file which contains 6 sequences
1
0
Entering edit mode
4 months ago

i have a dna.fasta file which contains 6 sequences. i need to write the program should print out the following information; name, description, length, the reverse complement of the sequence

one sequence gene id is CUL3B which needs to translate into the protein sequence on the screen

DNA.FASTA:

>gi|334186320|ref|NM_001203732.1| Arabidopsis thaliana cullin 1 (CUL1) mRNA, complete cds
AAAAGGTAAGAAATTAAATTTGTTTAATATTATACTAATATATTAGTTGACATAAAATAAAAATAATTAA
ATCTATAAGACCTGAAAATAATAGAATAGAAGAGAACGAGTTTGTTTCCTGAGATATCTTTTCACCGCCC
TTCTCATAGCAGCTCTCGCCGATCCTGTGTAATCGGGAATCGGTAATCGTCAGGGTCTGTTTGGGGTTGA
GGAGAGCTTGAAAAGTTGTTTGTCAACATGGAGCGCAAGACTATTGACTTGGAGCAAGGATGGGACTATA
TGCAGACTGGAATTACTAAGCTGAAACGGATTCTGGAAGGATTGAATGAGCCAGCATTTGACTCTGAGCA
ATATATGATGCTTTATACGACTATCTACAACATGTGCACCCAGAAACCTCCTCATGATTACTCACAGCAG
CTTTATGACAAGTATCGGGAAGCATTTGAGGAATATATTAACTCAACAGTTTTGCCTGCGTTGAGGGAGA
AGCATGATGAGTTTATGCTGCGGGAGCTATTTAAAAGATGGTCAAACCATAAAGTAATGGTCAGATGGCT
ATCCCGCTTCTTCTACTACCTTGACCGTTACTTCATTGCTCGGAGATCACTTCCACCACTGAATGAAGTT
GGCCTGACATGCTTCCGTGACCTGGTTTATAATGAGCTACATTCTAAGGTCAAACAAGCTGTAATAGCTC
TTGTTGATAAAGAACGGGAGGGCGAGCAGATTGATAGGGCCCTGCTGAAAAACGTATTAGATATCTATGT
AGAGATTGGAATGGGGCAGATGGAGAGGTATGAAGAAGATTTTGAAAGCTTCATGCTTCAAGATACTTCT
TCGTATTATTCTCGCAAGGCATCAAGCTGGATTCAGGAAGATTCTTGCCCTGATTACATGTTGAAGTCTG
AAGAATGTCTAAAGAAGGAGAGGGAGAGAGTGGCTCACTACCTACACTCAAGCAGTGAGCCAAAGCTGGT
TGAGAAAGTACAACATGAATTGCTGGTTGTGTTTGCAAGTCAGCTTCTAGAAAAAGAACACTCAGGGTGC
CGTGCATTGCTAAGAGATGACAAGGTGGATGATCTCTCCAGGATGTACAGGCTTTACCATAAAATTTTGC
GAGGCTTGGAACCTGTTGCAAACATCTTTAAGCAGCATGTCACAGCAGAGGGTAACGCTCTTGTCCAACA
GGCCGAAGACACGGCTACTAATCAGGTTGCAAATACTGCTAGCGTCCAGGAACAGGTTCTTATCAGAAAA
GTGATTGAACTTCATGATAAATACATGGTATATGTCACCGAGTGTTTCCAGAACCACACCCTCTTCCATA
AGGCTTTGAAAGAGGCATTTGAGATTTTTTGTAACAAAACGGTTGCTGGAAGTTCAAGTGCAGAACTACT
TGCAACATTTTGCGACAATATTCTCAAAAAGGGGGGAAGTGAAAAGCTGAGTGATGAAGCTATCGAAGAT
ACGCTTGAGAAGGTTGTCAAATTGCTTGCATACATAAGTGACAAGGATCTTTTCGCTGAGTTCTACAGGA
AGAAGCTGGCCCGTAGGCTCTTATTTGATCGCAGTGCTAATGATGATCATGAGAGAAGTATCCTGACAAA
GCTCAAGCAACAATGTGGTGGACAGTTTACTTCTAAGATGGAGGGCATGGTGACGGATTTGACACTGGCA
AGAGAAAACCAAAACAGTTTCGAGGATTATCTAGGCAGTAACCCTGCTGCAAACCCAGGGATTGACTTGA
CCGTCACTGTTCTTACCACTGGTTTCTGGCCAAGTTACAAATCATTTGACATAAATCTACCCAGTGAAAT
GATCAAGTGTGTTGAAGTCTTCAAAGGGTTTTATGAAACGAAAACGAAACACAGGAAGCTTACGTGGATC
TATTCACTGGGAACTTGTCACATAAACGGGAAGTTTGATCAAAAGGCCATCGAGTTAATAGTGTCTACTT
ACCAGGCTGCTGTGCTTCTACTCTTTAACACAACTGACAAGTTAAGTTACACTGAGATCTTGGCTCAACT
GAACCTAAGCCATGAAGATCTAGTTAGGTTGCTTCATTCCTTGTCATGTGCTAAGTACAAGATACTCCTT
AAGGAGCCAAACACCAAGACTGTCTCCCAGAATGATGCCTTTGAGTTCAACTCCAAATTCACCGATAGAA
TGCGCAGAATCAAGATCCCTCTTCCCCCAGTTGATGAAAGGAAGAAAGTCGTTGAAGATGTCGATAAAGA
CAGAAGATATGCAATTGATGCTGCCATTGTCAGGATCATGAAGAGCAGGAAAGTATTGGGACATCAACAA
CTTGTTTCTGAGTGTGTTGAGCAACTTAGCCGAATGTTCAAGCCTGATATCAAAGCGATCAAGAAGCGTA
TGGAGGATTTAATAACCAGAGATTATTTGGAGAGGGACAAGGAGAATCCTAACATGTTTAGGTACTTGGC
TTAGGGCAAAAAAACAACAACTATGGAAGTGGTTGGCTCATGAAAGGAATCTGCTTGTATATTTAGAAGT
CCATATGGAGACTGTCCTAAAACAAATTTATCGCTTCATTTTCGCTATTTTTCTCTTTTAAAAAATATTC
GGTCTGTGCTTTTTTTTTGGGATGCAAATTTGCCTTGTGGATTTTTGTTTCTTAAATATTGAATGGAGAT
GGAGAAATGGCCTTAATGAATGAATCTCTGCTTTCTAATATATTTATCCTTGATCATATTATTTAAGTTT
TATGTATCTCTGTGTTATATTGACGGATGGGAAAGTCGTAACAAATAATATGAGATTTCTTAT

>gi|334183952|ref|NM_001198486.1| Arabidopsis thaliana F-box/LRR-repeat protein 5 (SKP2B) mRNA, complete cds
GTCGTCGAATTTGGAATATAATTTGTAATAGTACTGTATTCTCCTGTCAGTTTTAGACACGTGGCAGTTC
ACGTGTCATATAGTCATAACCCGTACGTTTACTCTTTGCCTCTTTCCCTTTTATATTCAAAACTCCTTTT
TGATTTTGTCTATCTTATCTCGTGAATCGTTAATTCGTTATCAAAAGAGCTTAAAAAGCTTTAAAAAATT
AACGGATTAGTAATAATTCAACCGAAGAGAAACCCAAGGCACCGAAGAACACGATTTCAGAGAATCAAAG
AAACCGCTTCAAGGATGGTGAGTGAAGGAGCAACAAGAAAAGAACTTAACCTCTGTTTCGAGAATATGAA
GATGGAAGGAGTTTTGATCTCTGAGTGGAAAGATATCCCTGTGGAGCTTCTCATGAAGATTTTAAACCTT
GTTGATGATCGGACTGTGATCATTGCTTCTTGTATTTGTAGTGGCTGGAGAGATGCTGTTTCCCTTGGCC
TCACTCGCCTCTCCCTCTCTTGGTGCAAGAAGAATATGAACAGTTTGGTTCTATCTCTTGCTCCCAAATT
CGTAAAGCTTCAGACTTTAGTACTGCGACAGGACAAACCGCAGCTTGAGGACAACGCGGTGGAAGCCATA
GCAAATCACTGTCATGAGCTACAAGATTTGGACTTAAGCAAAAGCTCGAAAATCACTGACCATTCCCTAT
ATTCACTTGCTCGTGGTTGTACTAACCTGACTAAACTCAACCTTAGCGGCTGCACTTCGTTCAGCGACAC
TGCTCTTGCGCATTTGACAAGATTTTGCAGGAAGCTCAAAATTCTGAATCTTTGTGGTTGTGTTGAAGCT
GTATCTGACAATACATTGCAGGCTATTGGAGAAAACTGCAATCAGTTGCAGTCACTAAACTTGGGATGGT
GTGAGAATATAAGTGATGATGGAGTTATGAGTTTAGCTTATGGTTGTCCTGATTTAAGAACTCTTGATCT
TTGTAGCTGTGTTCTAATCACAGATGAGAGTGTTGTGGCTTTGGCGAATCGGTGCATTCACTTGAGGTCA
TTGGGGTTATACTACTGCAGAAACATTACAGACAGAGCAATGTACTCTTTAGCTCAGAGCGGAGTCAAGA
ACAAACACGAGATGTGGCGAGCGGTAAAGAAAGGAAAATTCGATGAAGAAGGACTAAGAAGCCTTAACAT
TAGTCAATGCACTTACCTAACACCTTCAGCTGTTCAAGCTGTCTGTGATACATTCCCTGCTCTCCACACT
TGTTCAGGCAGACATTCACTTGTCATGAGCGGTTGTTTGAATCTACAATCTGTTCATTGTGCTTGTATCC
TTCAAGCTCACCGCACTCACACCGTTTACCCTCACCCGGCGCATTGAAACGGTGTGTGAGCCAGAGGGTC
TACTACTCTCTAGTATGTGTGTACATACATATAACCATATGGTGTTAATAAAGCTTCTTTGAGTTCCTTC
TTTGTCTTTGATGCAATCTTAAGATTTTAACATTACCTAGTCTTGAAAATCTTGTAATGAATCGCGAAAT
ACTTATTTCTTCTAACAATTTGTTTAAGTTGCATCCATCAATCAATAATCATATCATTA

>gi|186494183|ref|NM_105635.4| Arabidopsis thaliana cullin 3B (CUL3B) mRNA, complete cds
ATGAGTAATCAGAAGAAGAGAAATTTCCAGATTGAAGCGTTTAAGCAACGAGTCGTCGTTGATCCAAAAT
ACGCCGATAAAACTTGGAAGATCCTTGAACATGCGATTCATGAGATTTACAATCACAACGCTAGTGGTCT
CAGTTTCGAAGAGCTTTACAGAAACGCATACAACATGGTTCTACATAAGTATGGTGATAAGCTTTATACT
GGACTTGTTACCACTATGACATTTCATCTCAAAGAGATATGTAAGTCTATTGAAGAAGCTCAAGGAGGAG
CATTTTTAGAATTGCTTAATAGGAAATGGAATGATCATAACAAAGCGTTGCAAATGATTAGGGATATTCT
CATGTATATGGATCGTACTTACGTTTCTACTACTAAGAAAACTCATGTTCATGAGCTTGGACTTCATCTC
TGGAGAGATAATGTTGTGTATTCGAGTAAGATTCAGACTAGGCTATTGAATACGCTTCTTGATTTAGTTC
ATAAGGAACGGACTGGTGAAGTTATAGATAGGGTGTTGATGAGGAATGTGATTAAGATGTTTATGGATTT
AGGTGAATCTGTTTATCAAGATGATTTTGAGAAGCCGTTTTTGGAAGCTTCTGCTGAGTTTTATAAGGTT
GAGTCAATGGAGTTTATTGAGTCTTGTGATTGTGGTGAGTATTTGAAGAAAGCTGAGAAGCCTTTAGTGG
AAGAAGTCGAAAGGGTTGTGAATTATTTGGATGCTAAGAGCGAAGCGAAGATTACTAGTGTGGTTGAAAG
AGAGATGATTGCTAACCATGTGCAGAGACTAGTTCATATGGAGAATTCAGGTTTGGTTAATATGCTTTTG
AATGATAAGTATGAGGATATGGGTAGAATGTATAGTTTGTTCCGTAGGGTTGCTAATGGTCTTGTAACGG
TTAGAGATGTTATGACTTTGCATCTTAGGGAAATGGGAAAACAGTTGGTTACTGATCCAGAGAAATCAAA
GGATCCGGTTGAATTTGTGCAGCGTCTATTGGATGAGCGGGATAAGTATGACAGAATTATCAACATGGCA
TTTAACAACGATAAGACGTTCCAGAATGCGCTAAATTCTTCGTTTGAGTATTTCGTCAACTTGAACACAC
GTTCTCCTGAGTTTATCTCCCTGTTTGTTGATGATAAGCTACGAAAAGGACTAAAAGGTGTGGGAGAGGA
GGATGTCGATCTTATTCTTGATAAGGTGATGATGTTGTTTCGCTACTTACAGGAGAAAGACGTTTTTGAG
AAATATTACAAACAGCATCTGGCGAAAAGGCTTTTATCTGGAAAAACTGTGTCGGATGATGCAGAGAGGA
ATCTGATAGTGAAACTGAAGACGGAATGTGGGTATCAATTCACTTCGAAACTTGAAGGTATGTTCACTGA
CATGAAGACCTCACACGACACGCTGCTAGGATTTTATAATAGCCATCCCGAGCTTTCAGAAGGACCTACA
CTTGTTGTTCAGGTTCTCACAACCGGTTCTTGGCCCACACAGCCAACCATACAATGTAACCTACCTGCAG
AAGTTTCTGTTCTGTGTGAGAAGTTCAGGTCATATTACCTCGGGACTCACACCGGTAGGAGATTGTCTTG
GCAAACGAATATGGGAACAGCAGATATCAAAGCAGTGTTTGGAAAGGGTCAGAAGCATGAACTAAACGTT
TCGACTTTCCAAATGTGTGTCCTTATGTTGTTCAACAACTCTGATCGACTAAGCTACAAAGAGATCGAAC
AGGCAACTGAAATCCCCACCCCAGACCTAAAGCGTTGCTTGCAGTCAATGGCGTGTGTAAAAGGTAAAAA
CGTGCTAAGAAAAGAACCAATGAGCAAGGAGATAGCAGAGGAGGACTGGTTTGTTGTGAACGACAGGTTC
GCAAGCAAGTTCTACAAAGTGAAGATAGGAACTGTGGTGGCACAAAAGGAGACAGAACCAGAGAAGCAAG
AGACAAGACAGAGAGTAGAAGAAGACAGAAAACCTCAGATCGAAGCAGCCATCGTGAGGATAATGAAGTC
TAGACGAGTGTTGGATCACAACAACATAATCGCAGAGGTCACCAAACAGTTGCAGACGCGGTTCTTGGCA
AACCCAACAGAGATAAAGAAGAGAATTGAATCACTCATTGAGCGTGATTTCTTGGAGAGGGATAATACAG
ACCGGAAACTTTACCGCTATCTAGCGTAAAAAAGTCTGGATTGATTACACGGTCCCTCTGTTTATTTCGC
ATCGTTTCTTCTGTTAGTCAGCATTTCTTATTTGTTCTGTAGTCTGGTAAGTTATAAACATTTTGTTTCC
GTTTTGAAAAGAAAATATTGATTTGCC

>gi|238478497|ref|NM_001160872.1| Arabidopsis thaliana uncharacterized protein (AT1G15860) mRNA, complete cds
GATTATTTCCCCATCTAGAAGCTCTCTCTCGACTCTCTCGTCTGTTTCTATCTTTCGTGGTACCTCTTCT
CTTCTCTTTCCTTTTCTGAGTTTCTGTTAATTTTACTCTCTCTTTTTTTTTTTCTTCTCTGTTGCTTATA
TAATAAGATTTGTCTTTCTTTTCCAAAAACTCGTTTTCTCTAATTCTTCTCTGCGATTCTAATCAAATTC
CGTATAGATGCGTCGCTCTTCATCAAAGAAGAAATCAGGTCAATCAACTGAATCAGTCACCACGGATCTC
TTTCGCTCAGCTTCGAGCAAGGCCTCGAATAAAGAGATGGATCGAATTGATCACTTATTTAATCAGTATG
CCAATAAATCTTCCAGCCTGATTGATCCTGAAGGAATAGAGGAACTATGCTCCAATTTGGAAGTGTCACA
TACTGATATCAGAATCTTGATGCTTGCTTGGAAGATGAAAGCTGAGAAACAAGGTTACTTTACACATGAG
GAGTGGAGAAGAGGCCTCAAGGCTTTAAGAGCTGATACGATCAATAAGTTGAAGAAAGCCCTTCCGGAGC
TTGAGAAAGAGGTCAGGAGGCCATCAAATTTTGCAGATTTCTATGCTTATGCCTTCTGTTATTGTTTAAC
AGAGGAAAAACAGAAGAGCATAGACATAGAGACTATATGTCAACTCCTAGAGATCGTCATGGGATCTACA
TTTCGAGCCCAAGTTGACTACTTTGTTGAGTATTTAAAGATCCAAAACGACTACAAAGTGATAAACATGG
ACCAATGGATGGGACTTTACCGGTTCTGTAACGAGATAAGTTTCCCGGACATGGGGGACTATAATCCAGA
GCTTGCATGGCCATTGATTCTTGACAATTTTGTTGAGTGGATTCAAGAAAAACAAGCCTGAAATCATTTC
TGAGTCCCCTCAAGTCGAAGCTTCAAATCTCTGCAGGATGATCAGTGGGCTCTCTCATCAAACAGATTCA
GCACATTTTTACTTCAGTTTTCATCTTTCAAACATTAAAAAAAGACACATTATATGATTCTTGTTACATG
TGATTAACTTCAATAGAGGGAACACATAATGTTTGATTTATTACATCAAGTTCTGTTAGTAGTAACCAAT
GATTTCGAATTAGCTTGTAAACACGTTGTTACCAAATTTATAACCATCAGATTCATTCTGAA

>gi|238478760|ref|NM_103467.2| Arabidopsis thaliana cullin-like protein (AT1G43140) mRNA, complete cds
ATGGCTACAATCTTGTTCAAGGTCATAATGATGAAGGAGTTAATCCTATTGGAGGAAGGATGGTCTGTCA
TGAAGACTGGTGTTGCAAAGCTACAAAGGATTCTAGAAGATTTGTCTGAGCCACCGTTTGACCCCGGTCA
ATATATCAATCTGTACACGATTATCTACGATATGTGTCTCCAACAACCTCCTAATGATTACTCACAAGAG
CTTTATAATAAGTATCGTGGAGTGGTTGATCATTACAATAAAGAAACTGTTTTGCCGTCTATGAGGGAGA
GGCATGGTGAATATATGCTGAGAGAGCTTGTTAAGAGATGGGCTAACCATAAAATTCTGGTTAGATGGTT
ATCTCGCTTCTGCTTTTATCTTGACCGTTTCTATGTTGCTCGGAGAGGTCTTCCAACACTGAATGATGTT
GGCTTCACATCCTTTCACGACCTAGTTTATCAAGAGATACAGTCCGAGGCCAAAGATGTGCTACTAGCAC
TTATTCATAAAGAACGTGAAGGCGAACAGATTGATAGAACACTAGTGAAAAACGTAATAGATGTCTATTG
TGGGAATGGGGTTGGACAGATGGTAATATACGAAGAGGATTTTGAAAGCTTCTTGCTTCAAGATACTGCA
TCTTACTATTCTCGCAAGGCCTCAAGGTGGAGCCAGGAGGATTCTTGTCCTGATTACATGCTAAAGGCTG
AAGAGTGTCTTAAATTGGAGAAGGAAAGAGTCACTAACTACCTTCATTCTACCACTGAGCCCAAACTAGT
TGAGAAAGTACAAAATGAATTGTTGGTAGTGGTTGCAAAACAGCTTATAGAAAATGAGCACTCTGGGTGC
CTTGCATTGTTAAGAGATGACAAGATGGGTGATCTCTCGAGGATGTACAGGCTTTATCGTCTAATCCCGC
AAGGGTTGGAACCTATTGCAGACTTATTCAAGCAGCATGTTACTGCAGAAGGAAATGCCCTTATCAAACA
AGCCGCCGACGCAGCTACTAATCAAGATGCAAGTGCTAGTCAGGTGCTTGTCAGAAAAGAGATTGAACTA
CACGATAAATACATGGTCTATGTAGATGAGTGTTTTCAGAAACACAGCCTCTTCCATAAGCTATTAAAAG
AGGCGTTTGAAGTCTTCTGTAACAAAACAGTGGCTGGAGCGTCCAGTGCAGAAATACTTGCAACCTATTG
TGATAATATCCTCAAGACCAGAGGTGGAAGTGAGAAGCTTAGTGATGAAGCTACTGAAATTACGCTTGAG
AAAGTAGTTAATTTGCTTGTTTATATAAGTGACAAGGATCTTTTCGCCGAGTTTTACAGGAAGAAACAAG
CTCGTCGGCTCTTATTTGATCGCAGCGGAATCATGAAAGAAGTGACGGATATAACATTGGCAAGAGAACT
CCAAACCAACTTCGTGGATTATTTATCAGCAAACATGACAACAAAGCTGGGGATTGATTTTACTGTCACT
GTTCTTACTACTGGTTTTTGGCCAAGTTACAAAACAACAGACCTTAATCTACCCACTGAAATGGTCAACT
GTGTTGAAGCTTTTAAGGTCTTTTATGGAACAAAAACCAATTCCAGGAGACTTTCATGGATTTATTCTCT
TGGAACTTGTCACATTCTTGGAAAATTCGAGAAAAAAACAATGGAGTTAGTCGTTTCCACGTACCAGGCT
GCTGTGCTTTTGCTCTTCAACAACGCAGAGAGATTAAGCTACACCGAGATTTCAGAGCAGCTAAACCTCA
GCCATGAAGATCTTGTCAGGCTGCTTCATTCACTGTCATGCTTAAAGTACAAGATTCTTATAAAGGAACC
AATGTCGAGAACCATCTCGAAAACCGATACTTTCGAATTCAACTCCAAGTTCACAGATAAGATGCGGAAG
ATTAGGGTGCCTTTGCCTCCAATGGATGAGAGGAAGAAAGTAGTTGAAGATGTTGATAAAGATAGACGCT
ATGCAATAGATGCAGCTCTTGTTCGGATCATGAAGAGTAGAAAAGTGTTGGCGCATCAACAGTTAGTCTC
TGAATGTGTTGAGCATCTTAGCAAAATGTTCAAGCCTGATATAAAGATGATAAAGAAACGGATTGAGGAC
TTGATCAATAGAGATTATTTGGAGAGGGATACAGAAAATGCCAACACTTTCAAGTATGTAGCTTAG

>gi|334182604|ref|NM_001198077.1| Arabidopsis thaliana uncharacterized protein (AT1G15860) mRNA, complete cds
ATATAAGAAAGAAATCAATCGTATATCTTCCAATCAGGTGGCTTCGCCTTTCAGATTATTTCCCCATCTA
GAAGCTCTCTCTCGACTCTCTCGTCTGTTTCTATCTTTCGTGATGCGTCGCTCTTCATCAAAGAAGAAAT
CAGGTCAATCAACTGAATCAGTCACCACGGATCTCTTTCGCTCAGCTTCGAGCAAGGCCTCGAATAAAGA
GATGGATCGAATTGATCACTTATTTAATCAGTATGCCAATAAATCTTCCAGCCTGATTGATCCTGAAGGA
ATAGAGGAACTATGCTCCAATTTGGAAGTGTCACATACTGATATCAGAATCTTGATGCTTGCTTGGAAGA
TGAAAGCTGAGAAACAAGGTTACTTTACACATGAGGAGTGGAGAAGAGGCCTCAAGGCTTTAAGAGCTGA
TACGATCAATAAGTTGAAGAAAGCCCTTCCGGAGCTTGAGAAAGAGGTCAGGAGGCCATCAAATTTTGCA
GATTTCTATGCTTATGCCTTCTGTTATTGTTTAACAGAGGAAAAACAGAAGAGCATAGACATAGAGACTA
TATGTCAACTCCTAGAGATCGTCATGGGATCTACATTTCGAGCCCAAGTTGACTACTTTGTTGAGTATTT
AAAGGTTTGGATCACTCAAAAGTCTCACATTATCCAAAACGACTACAAAGTGATAAACATGGACCAATGG
ATGGGACTTTACCGGTTCTGTAACGAGATAAGTTTCCCGGACATGGGGGACTATAATCCAGAGCTTGCAT
GGCCATTGATTCTTGACAATTTTGTTGAGTGGATTCAAGAAAAACAAGCCTGAAATCATTTCTGAGTCCC
CTCAAGTCGAAGCTTCAAATCTCTGCAGGATGATCAGTGGGCTCTCTCATCAAACAGATTCAGCACATTT
TTACTTCAGTTTTCATCTTTCAAACATTAAAAAAAGACACATTATATGATTCTTGTTACATGTGATTAAC
TTCAATAGAGGGAACACATAATGTTTGATTTATTACATCAAGTTCTGTTAGTAGTAACCAATGATTTCGA
ATTAGCTTGTAAACACGTTGTTACCAAATTTATAACCATCAGATTCATTCTGAA

I have tried the following script to find CUL3B protein sequence:

from Bio.Seq import Seq
from Bio import Seq
fastaFile=open("dna_1.fasta")

for Line in fastaFile:
    header = fastaFile.readlines()
    if Line.find("CUL3B"):
        a= print(Line) 
        print(a)
        Translate= Seq.translate(Line)
        print(Translate)

But it gives me the error:

TranslationError: Codon '>GI' is invalid

The main problem is that how can I remove header file by just taking their record? Kindly help me

python DNA Translation • 276 views
ADD COMMENT
0
Entering edit mode
4 months ago
antonioggsousa ★ 2.1k

Hi,

In Biopython (see tutorial) you can parse fasta files in order to deal with the header plus the sequence of each fasta sequence.

So, assuming that you've 6 sequences in your file, and you'll need to loop over the file, for the particular problem that you had, you could just do:

from Bio import SeqIO # from biopython import this module
for seq_record in SeqIO.parse("dna_1.fasta", "fasta"):
   if "CUL3B" in seq_record.id:
      print(seq_record.seq.translate())

Here, the method .id is to retrieve the header and .seq the DNA/RNA/protein sequence and seq_record is the fasta sequence (header + sequence) of each record in the fasta file provided for the loop. The loop will read each fasta sequence as seq_record, if the name CUL3B appears in one of the headers, it will print the translated sequence of that record using the .translate method.

I hope this answers your question.

António

ADD COMMENT
0
Entering edit mode

but no output when I run this script although I have one gene with id CUL3B

ADD REPLY
0
Entering edit mode

Ok. Sorry, the function parses the fasta header to keep only the first "word", so in this case to keep only gi|186494183|ref|NM_105635.4|. Therefore, when it checks if contains the gene, it does not because there isn't from this id. That's why you can not print anything.

ADD REPLY
0
Entering edit mode

You might want to try the following code:

from Bio import Seq
fasta_file = open("dna_1.fasta", "r")
header = [] # save headers 
dna_seq = [] # save DNA sequences

# loop over the file to parse it
counter = -1
up_seq = 0
dna = ''
for fa in fasta_file: 
    if fa.startswith(">"): 
        header.append(fa.strip())
        counter = counter + 1 
    elif not fa.startswith(">") and fa != "\n":
        if up_seq == counter:
            dna = dna + fa.strip()
        else: 
            dna_seq.append(dna)
            dna = fa.strip()
            up_seq = counter
dna_seq.append(dna)
fasta_file.close()

# loop over the fasta sequences to retrieve 
#the sequence of interest and translate it
for seq in range(len(header)): 
    if "CUL3B" in header[seq]:
        print(header[seq])
        print(Seq.translate(dna_seq[seq]))

This code imports and parses a fasta file, if a header contains "CUL3B", it will print it and it will translate the fasta sequence and print it also.

I hope this answers your question.

António

ADD REPLY

Login before adding your answer.

Traffic: 1031 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6