48 if (!
is_ok() || reads_to_load == 0)
57 batch_bps ==
uint32(-1) ? batch_size * AVG_READ_LENGTH : batch_bps );
62 while (info->
size() < reads_to_load &&
63 info->
bps() < batch_bps)
67 const uint32 chunk_bps = batch_bps - info->
bps();
69 const int n =
nextChunk( encoder , chunk_reads, chunk_bps );
70 assert(n <= (
int) chunk_reads);
74 assert(info->
size() <= reads_to_load);
86 const char * sequence_file_name,
89 const uint32 max_sequence_len,
96 bool is_gzipped =
false;
102 options.
flags = flags;
103 options.
trim3 = trim3;
104 options.
trim5 = trim5;
107 if (len >= strlen(
".gz"))
109 if (strcmp(&sequence_file_name[len - strlen(
".gz")],
".gz") == 0)
112 len =
uint32(len - strlen(
".gz"));
117 if (len >= strlen(
".fasta"))
119 if (strncmp(&sequence_file_name[len - strlen(
".fasta")],
".fasta", strlen(
".fasta")) == 0)
127 if (len >= strlen(
".fa"))
129 if (strncmp(&sequence_file_name[len - strlen(
".fa")],
".fa", strlen(
".fa")) == 0)
138 if (len >= strlen(
".fastq"))
140 if (strncmp(&sequence_file_name[len - strlen(
".fastq")],
".fastq", strlen(
".fastq")) == 0)
149 if (len >= strlen(
".fq"))
151 if (strncmp(&sequence_file_name[len - strlen(
".fq")],
".fq", strlen(
".fq")) == 0)
160 if (len >= strlen(
".txt"))
162 if (strncmp(&sequence_file_name[len - strlen(
".txt")],
".txt", strlen(
".txt")) == 0)
171 if (len >= strlen(
".sam"))
173 if (strncmp(&sequence_file_name[len - strlen(
".sam")],
".sam", strlen(
".sam")) == 0)
181 if (ret->
init() ==
false)
192 if (len >= strlen(
".bam"))
194 if (strncmp(&sequence_file_name[len - strlen(
".bam")],
".bam", strlen(
".bam")) == 0)
202 if (ret->
init() ==
false)
213 log_warning(stderr,
"could not determine file type for %s; guessing %sfastq\n", sequence_file_name, is_gzipped ?
"compressed " :
"");
230 const char* sequence_file_name,
236 return load_pac( alphabet, sequence_data, sequence_file_name, load_flags, qualities );
240 if (sequence_file == NULL || sequence_file->is_ok() ==
false)
257 const char* sequence_file_name,
262 if (
load_sequence_file( alphabet, ret, sequence_file_name, load_flags, qualities ) ==
false)
277 const char* sequence_file_name,
282 const char* gz =
"gz";
283 const char* lz4 =
"lz4";
284 const char* compressor = NULL;
287 if (len >= strlen(
".gz"))
289 if (strcmp(&sequence_file_name[len - strlen(
".gz")],
".gz") == 0)
292 len =
uint32(len - strlen(
".gz"));
297 if (len >= strlen(
".lz4"))
299 if (strcmp(&sequence_file_name[len - strlen(
".lz4")],
".lz4") == 0)
302 len =
uint32(len - strlen(
".lz4"));
307 if (len >= strlen(
".fastq"))
309 if (strncmp(&sequence_file_name[len - strlen(
".fastq")],
".fastq", strlen(
".fastq")) == 0)
319 if (len >= strlen(
".fq"))
321 if (strncmp(&sequence_file_name[len - strlen(
".fq")],
".fq", strlen(
".fq")) == 0)
331 if (len >= strlen(
".fasta"))
333 if (strncmp(&sequence_file_name[len - strlen(
".fasta")],
".fasta", strlen(
".fasta")) == 0)
343 if (len >= strlen(
".fa"))
345 if (strncmp(&sequence_file_name[len - strlen(
".fa")],
".fa", strlen(
".fa")) == 0)
355 if (len >= strlen(
".txt"))
357 if (strncmp(&sequence_file_name[len - strlen(
".txt")],
".txt", strlen(
".txt")) == 0)
367 log_warning(stderr,
"could not determine file type for %s; guessing fastq\n", sequence_file_name);