MCPcopy Create free account
hub / github.com/arq5x/bedtools2 / GetHeader

Method GetHeader

src/utils/bedFile/bedFile.cpp:169–198  ·  view source on GitHub ↗

Extract and store the header for the file.

Source from the content-addressed store, hash-verified

167
168// Extract and store the header for the file.
169void BedFile::GetHeader(void) {
170 while(getline(*_bedStream, _bedLine))
171 {
172 _lineNum++;
173 // look for header lines. ^# headers can span multiple lines,
174 // but ^[browser|track|chrom] headers must occur on the 1st line.
175 if ( (_bedLine.find("#") == 0) ||
176 (_bedLine.find("browser") == 0) ||
177 (_bedLine.find("track") == 0)
178 )
179 {
180 _header += _bedLine + '\n';
181
182 if (_bedLine.find("##fileformat=VCF") == 0) {
183 _typeIsKnown = true;
184 setFileType(VCF_FILETYPE);
185 setGff(false);
186 setVcf(true);
187 }
188 }
189 // we are done with the header. stop looking
190 // and indicate that the first data line has been read
191 // (i.e., _bedLine now houses the first data line)
192 else
193 {
194 _firstLine = true;
195 break;
196 }
197 }
198}
199
200// Dump the header
201void BedFile::PrintHeader(void) {

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected