1 //========================================================================
3 // Name : ReadBioFile.cpp
5 // Created on : Jun 4, 2013
7 // Copyright : The Broad Institute
8 // SOFTWARE COPYRIGHT NOTICE AGREEMENT
9 // This software and its documentation are copyright (2013)
10 // by the Broad Institute. All rights are reserved.
12 // This software is supplied without any warranty or
13 // guaranteed support whatsoever. The Broad Institute cannot
14 // be responsible for its use, misuse, or functionality.
16 //========================================================================
18 #include "ReadBioFile.h"
20 /** Retrieve num records (header, read, qual) from fastq file pointed by
23 void add_fq_reads (std::vector
<fqtuple_t
>& seq
, int num
,
24 bio::fastq_input_iterator
<>& iter
, bio::fastq_input_iterator
<> end
){
26 for (; iter
!= end
; ++ iter
) {
27 seq
.push_back (*iter
);
36 void add_fq_reads_only (strvec_t
& seq
, int num
,
37 bio::fastq_input_iterator
<>& iter
, bio::fastq_input_iterator
<> end
){
39 for (; iter
!= end
; ++ iter
) {
40 seq
.push_back (std::get
<1>(*iter
));
49 void add_fa_reads (std::vector
<strpair_t
>& seq
, int num
,
50 bio::fasta_input_iterator
<>& iter
, bio::fasta_input_iterator
<> end
){
52 for (; iter
!= end
; ++ iter
) {
53 seq
.push_back (*iter
);
62 void add_fa_reads_only (strvec_t
& seq
, int num
,
63 bio::fasta_input_iterator
<>& iter
, bio::fasta_input_iterator
<> end
){
65 for (; iter
!= end
; ++ iter
) {
66 seq
.push_back (iter
->second
);