Reading Stockholm files
Reading the Stockholm format
Write a script that reads a Stockholm-formatted file and writes the number of sequences in it, followed by the accessions of the sequences. See examples below!
To present:
- The code of your program and a demonstration of it running.
- Explain the general structure of a Stockholm file. What is an "accession"?
Examples
For example, if the input is
# STOCKHOLM 1.0 PROT1_PIG ACGT PROT1_DOG AGTG PROT1_BUNNY TATA // |
then the output should be
3 PROT1_PIG PROT1_DOG PROT1_BUNNY |
You should get the same output also if the input is
# STOCKHOLM 1.0 #=GF CC This is a trivial made-up example! #=GS PROT1_PIG OS Sus scrofa #=GS PROT1_DOG OS Canis familiaris #=GS PROT1_PIG OS Oryctolagus cuniculus PROT1_PIG ACGT PROT1_DOG AGTG PROT1_BUNNY TATA // |