brentp/pyfasta — Issue #6: PyFasta - Splitting large headers
Author: quacksawbones
Created: 2012-01-03 02:48:09+00:00
State: open

I am receiving some strange issues with PyFasta concerning splitting large headers within a Python script.

This is the code:

```python
from pyfasta import Fasta

compare = Fasta('./test_pyfasta.fasta', key_fn=lambda key: key.split()[0])
print compare.keys()
```
when using the two sequences in my test dataset:
>Ch_kdna_pair1_1|Len:90
AAAGAAGTTATCACTGTGTTTATACGTAAGTTATCAGGCCTGCTACACGTAAAGTATCAGACTATTAAACAAGTCACCC
CGGGGTCAAAG
>Bx_kdna_pair1_4 Len:90
AAGCTGCGTCCTGACCGCGAAAAGACTTAGGCCCCGTTTGTTAGCTTAGTATTTTTAAAGTATTCTGAGAATACTACAT
TTTTTCAGATT

it will only split the space, NOT the pipe. I have some other files where I intend to (hopefully) split by "." rather than by " " or "|". Is there any way to specify the delimiting character, similar to the string.split function?