53 SequenceDataEncoder* output,
54 const SequenceDataFile::Options& options) :
58 void push_back(
const char*
id,
const uint32 read_len,
const uint8* bp)
60 if (
m_quals.size() < size_t( read_len ))
61 m_quals.resize( read_len, 50u );
127 const char* read_file_name,
130 m_fasta_reader( read_file_name )
132 if (!m_fasta_reader.
valid()) {
162 FASTAHandler writer( output,
m_options );
164 return m_fasta_reader.
read( max_reads / read_mult, writer );
170 const char* file_name,
171 const char* compressor,
173 : m_file_name(file_name)
180 template <Alphabet ALPHABET>
190 sequence_data.
size() * 2 +
191 sequence_data.
bps() +
194 std::vector<char> buffer( buffer_len );
196 #pragma omp parallel for
199 const sequence_string
read = sequence_data.
get_read( i );
200 const name_string name = sequence_data.
get_name( i );
204 buffer[ buffer_offset++ ] =
'@';
206 for (
uint32 j = 0; j < name.size(); ++j)
207 buffer[ buffer_offset++ ] = name[j];
210 buffer[ buffer_offset++ ] =
'\n';
212 to_string<ALPHABET>( read.begin(), read.size(), &buffer[0] + buffer_offset );
214 buffer_offset += read.size();
216 buffer[ buffer_offset++ ] =
'\n';
219 if (output_file->
write( buffer_len, &buffer[0] ) == 0)