Last active
August 29, 2015 14:06
-
-
Save tbrittoborges/d4704b71edcfb4ff847c to your computer and use it in GitHub Desktop.
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
def remove_description_from_fasta(input, output, regex): | |
with open(input,) as input_stream, open(output , 'w') as output_stream: | |
for line in input_stream: | |
if line.startswith('>'): | |
if regex in line: | |
output_stream.write(line) | |
write = True | |
else: | |
write = False | |
elif write: | |
output_stream.write(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment