Last active
November 28, 2017 03:21
-
-
Save hyphaltip/210be02b1dad204eebc256da3f1889f1 to your computer and use it in GitHub Desktop.
biopython fasta parser
This file contains 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
>tr|E3Q6S8|E3Q6S8_COLGM RNAse P Rpr2/Rpp21/SNM1 subunit domain-containing protein OS=Colletotrichum graminicola (strain M1.001 / M2 / FGSC 10212) GN=GLRG_02386 PE=4 SV=1 | |
MAKPKSESLPNRHAYTRVSYLHQAAAYLATVQSPTSDSTTNSSQPGHAPHAVDHERCLET | |
NETVARRFVSDIRAVSLKAQIRPSPSLKQMMCKYCDSLLVEGKTCSTTVENASKGGKKPW | |
ADVMVTKCKTCGNVKRFPVSAPRQKRRPFREQKAVEGQDTTPAVSEMSTGAD |
This file contains 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
#!/usr/bin/env python3 | |
import sys | |
from Bio import SeqIO | |
from Bio.Seq import Seq | |
filename = "input.fasta" | |
for seq_record in SeqIO.parse( filename , "fasta"): | |
print(seq_record.id) | |
print(repr(seq_record.seq)) | |
print(seq_record.seq) | |
print(len(seq_record)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment