Add FASTQ splitting by sample id to qiime.util

This is needed for qiita.  @antgonza and @gregcaporaso suggested adding the functionality to QIIME instead, so here it is!
Thanks @adamrp

Yoshiki Vázquez-Baeza

> On Sep 18, 2014, at 5:08 PM, adamrp <notifications@github.com> wrote:
> 
> In qiime/util.py:
> 
> > @@ -479,10 +480,30 @@ def write_seqs_to_fasta(fp, seqs, write_mode='w'):
> >          seqs: list of (seq_id,seq) tuples, as obtained from
> >           parse_fasta
> >      """
> > -    f = open(fp, write_mode)
> > -    for s in seqs:
> > -        f.write('>%s\n%s\n' % (s))
> > -    f.close()
> > +    with open(fp, write_mode) as f:
> > +        for s in seqs:
> > +            f.write('>%s\n%s\n' % (s))
> > +
> > +
> > +def write_seqs_to_fastq(fp, seqs, write_mode='w', write_qual_id=False):
> Created #1676
> 
> —
> Reply to this email directly or view it on GitHub.