Login and get coding
A very simple format to store biological sequence data is the (multi-)FASTA format.
The first line of each record starts with a > character and is followed by a name. The following lines contain the sequence information. A record ends when > character or the end of the file is encountered.
FASTA files downloaded from public databases such as the National Center for Biotechnology Information (NCBI) often contain line breaks after 60-80 characters which ensures sequences are not truncated in text editors.
However in many cases (think *nix command line tools,
wc, etc.), it is better if each sequence is exactly one line long.
Your job is to convert a multiline FASTA file to a 2-Line FASTA file.
Multiline FASTA format:>Sequence 1:
2-Line FASTA format:>Sequence 1:
This Bite has biopython enabled (check out module
convertfunction), but it can also be solved without this module.
42 out of 45 users completed this Bite.
Will you be Pythonista #43 to crack this Bite?
Resolution time: ~50 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.5 on a 1-10 difficulty scale.
» Up for a challenge? 💪