#!/usr/bin/env python
# coding: utf-8

# In[11]:



from Bio import SeqIO

def ReverseFasta(fastafile):
    order=0
    filenamefull=fastafile.split('.')
    filename=filenamefull[0]
    reversefile= filename + '_reverse_abridged.fasta'
    proteinsequences = SeqIO.parse(open(fastafile),'fasta')
    with open(reversefile, 'w') as reversef:
        for protein in proteinsequences:
            order=order+1
            strorder=str(order).zfill(6)
            name, sequence = protein.id, str(protein.seq)
            protein.id= 'REV_' + strorder + ' reversed'
            protein.seq=protein.seq[::-1]
            protein.description=''
            fastareverse=SeqIO.write(protein, reversef, 'fasta')



# In[12]:


fasta='dummy.fasta'
ReverseFasta(fasta)


# In[ ]:





48d9e3c81969ed980e1da8654724c9eec82fda62
<mask token>


def ReverseFasta(fastafile):
    order = 0
    filenamefull = fastafile.split('.')
    filename = filenamefull[0]
    reversefile = filename + '_reverse_abridged.fasta'
    proteinsequences = SeqIO.parse(open(fastafile), 'fasta')
    with open(reversefile, 'w') as reversef:
        for protein in proteinsequences:
            order = order + 1
            strorder = str(order).zfill(6)
            name, sequence = protein.id, str(protein.seq)
            protein.id = 'REV_' + strorder + ' reversed'
            protein.seq = protein.seq[::-1]
            protein.description = ''
            fastareverse = SeqIO.write(protein, reversef, 'fasta')


<mask token>

<mask token>


def ReverseFasta(fastafile):
    order = 0
    filenamefull = fastafile.split('.')
    filename = filenamefull[0]
    reversefile = filename + '_reverse_abridged.fasta'
    proteinsequences = SeqIO.parse(open(fastafile), 'fasta')
    with open(reversefile, 'w') as reversef:
        for protein in proteinsequences:
            order = order + 1
            strorder = str(order).zfill(6)
            name, sequence = protein.id, str(protein.seq)
            protein.id = 'REV_' + strorder + ' reversed'
            protein.seq = protein.seq[::-1]
            protein.description = ''
            fastareverse = SeqIO.write(protein, reversef, 'fasta')


<mask token>
ReverseFasta(fasta)

<mask token>


def ReverseFasta(fastafile):
    order = 0
    filenamefull = fastafile.split('.')
    filename = filenamefull[0]
    reversefile = filename + '_reverse_abridged.fasta'
    proteinsequences = SeqIO.parse(open(fastafile), 'fasta')
    with open(reversefile, 'w') as reversef:
        for protein in proteinsequences:
            order = order + 1
            strorder = str(order).zfill(6)
            name, sequence = protein.id, str(protein.seq)
            protein.id = 'REV_' + strorder + ' reversed'
            protein.seq = protein.seq[::-1]
            protein.description = ''
            fastareverse = SeqIO.write(protein, reversef, 'fasta')


fasta = 'dummy.fasta'
ReverseFasta(fasta)

from Bio import SeqIO


def ReverseFasta(fastafile):
    order = 0
    filenamefull = fastafile.split('.')
    filename = filenamefull[0]
    reversefile = filename + '_reverse_abridged.fasta'
    proteinsequences = SeqIO.parse(open(fastafile), 'fasta')
    with open(reversefile, 'w') as reversef:
        for protein in proteinsequences:
            order = order + 1
            strorder = str(order).zfill(6)
            name, sequence = protein.id, str(protein.seq)
            protein.id = 'REV_' + strorder + ' reversed'
            protein.seq = protein.seq[::-1]
            protein.description = ''
            fastareverse = SeqIO.write(protein, reversef, 'fasta')


fasta = 'dummy.fasta'
ReverseFasta(fasta)

#!/usr/bin/env python
# coding: utf-8

# In[11]:



from Bio import SeqIO

def ReverseFasta(fastafile):
    order=0
    filenamefull=fastafile.split('.')
    filename=filenamefull[0]
    reversefile= filename + '_reverse_abridged.fasta'
    proteinsequences = SeqIO.parse(open(fastafile),'fasta')
    with open(reversefile, 'w') as reversef:
        for protein in proteinsequences:
            order=order+1
            strorder=str(order).zfill(6)
            name, sequence = protein.id, str(protein.seq)
            protein.id= 'REV_' + strorder + ' reversed'
            protein.seq=protein.seq[::-1]
            protein.description=''
            fastareverse=SeqIO.write(protein, reversef, 'fasta')



# In[12]:


fasta='dummy.fasta'
ReverseFasta(fasta)


# In[ ]:




