void parseSeqs(string filename, SeqSet &data) { ifstream input; SeqStream input_stream(openSeqFile(filename, input)); if(!input_stream.good()) { throw("File stream is in a bad state"); } string format = guessFormat(input_stream); if(format == "fasta") { try { parseFasta(input_stream, filename, data); } catch(...) { input.close(); throw; } } else if(format == "fastq") { try { parseFastq(input_stream, filename, data); } catch(...) { input.close(); throw; } } else { input.close(); throw("Unrecognized format"); } input.close(); }
seqCache::seqCache(const char *filename, uint32 cachesize, bool verbose) { _fb = openSeqFile(filename); _idToGetNext = 0; _allSequencesLoaded = false; _reportLoading = verbose; _cacheMap = 0L; _cacheSize = 0; _cacheNext = 0; _cache = 0L; setCacheSize(cachesize); }
* 'Celera Assembler' (http://wgs-assembler.sourceforge.net) * the 'kmer package' (http://kmer.sourceforge.net) * both originally distributed by Applera Corporation under the GNU General * Public License, version 2. * * Canu branched from Celera Assembler at its revision 4587. * Canu branched from the kmer project at its revision 1994. * * Modifications by: * * File 'README.licenses' in the root directory of this distribution contains * full conditions and disclaimers for each license. */ { seqFile *SF = openSeqFile(argv[1]); fprintf(stdout, "source '%s' of type '%s' has "uint32FMT" sequences.\n", SF->getSourceName(), SF->getFileTypeName(), SF->getNumberOfSequences()); fprintf(stdout, "getSequenceLength() vs getSequence(full)\n"); { char *h = 0L; char *s = 0L; uint32 hLen=0, hMax=0; uint32 sLen=0, sMax=0; for (uint32 sid=0; sid<SF->getNumberOfSequences(); sid++) { SF->getSequence(sid, h, hLen, hMax, s, sLen, sMax); if ((strlen(s) != SF->getSequenceLength(sid)) ||