Last active
August 24, 2022 09:54
-
-
Save elowy01/67f38461ff8bf80c58304f2c543934c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bio.Seq import Seq | |
from Bio.SeqRecord import SeqRecord | |
record = SeqRecord( | |
Seq("MKQHKAMIVALIVICITAVVAALVTRKDLCEVHIRTGQTEVAVF"), | |
id="YP_025292.1", | |
name="HokC", | |
description="toxic membrane protein, small", | |
) | |
print(record) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Write list of SeqRecord objects to file""" | |
from Bio.SeqRecord import SeqRecord | |
from Bio import SeqIO | |
rec1 = SeqRecord( | |
seq=MutableSeq("ACCTTTGGGGGGGM"), | |
id="ex1", | |
name="ex1", | |
description="ex1", | |
) | |
rec2 = SeqRecord( | |
seq=MutableSeq("ACCTTTGGGGAAAGM"), | |
id="ex2", | |
name="ex2", | |
description="ex2", | |
) | |
records= [rec1, rec2] | |
SeqIO.write(records, "out.fa", "fasta") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment