|
vg
tools for working with variation graphs
|
#include <gaf_sorter.hpp>
Public Member Functions | |
| GAFSorterFile () | |
| Default constructor that creates a compressed temporary file. More... | |
| GAFSorterFile (const std::string &name, std::unique_ptr< std::vector< std::string >> header_lines, const std::string &gbwt_file, bool bidirectional_gbwt) | |
| ~GAFSorterFile () | |
| If the file is temporary, the destructor removes the file. More... | |
| GAFSorterFile (const GAFSorterFile &)=delete | |
| GAFSorterFile & | operator= (const GAFSorterFile &)=delete |
| GAFSorterFile (GAFSorterFile &&)=default | |
| GAFSorterFile & | operator= (GAFSorterFile &&)=default |
| std::pair< std::ostream *, std::unique_ptr< std::ostream > > | open_output () |
| void | write (const GAFSorterRecord &record, std::ostream &out) |
| std::pair< std::istream *, std::unique_ptr< std::istream > > | open_input () |
| void | read (GAFSorterRecord &record, std::istream &in) |
| bool | is_std_in_out () const |
| void | remove_temporary () |
| Removes the file if it is temporary. More... | |
Public Attributes | |
| std::string | name |
| File name. More... | |
| std::unique_ptr< std::vector< std::string > > | header_lines |
| Header lines that should be written to a raw GAF file. More... | |
| std::string | gbwt_file |
| File name for the GBWT index, if any. More... | |
| bool | bidirectional_gbwt |
| Should the GBWT index be bidirectional? More... | |
| size_t | records |
| Number of records. More... | |
| bool | temporary |
| Is this a temporary file created with temp_file::create()? More... | |
| bool | compressed |
| Is this file compressed? More... | |
| bool | raw_gaf |
| Is this a raw GAF file? More... | |
| bool | removed |
| Has the file been removed? More... | |
| bool | ok |
| Success flag. More... | |
A file of GAFSorterRecords or GAF lines.
The records are sorted in increasing order by key. The object is movable but not copyable.
| vg::GAFSorterFile::GAFSorterFile | ( | ) |
Default constructor that creates a compressed temporary file.
| vg::GAFSorterFile::GAFSorterFile | ( | const std::string & | name, |
| std::unique_ptr< std::vector< std::string >> | header_lines, | ||
| const std::string & | gbwt_file, | ||
| bool | bidirectional_gbwt | ||
| ) |
Constructor that creates a raw GAF file with the given name, header, and a GBWT index that may be bidirectional. Takes ownership of the header lines.
| vg::GAFSorterFile::~GAFSorterFile | ( | ) |
If the file is temporary, the destructor removes the file.
|
delete |
|
default |
|
inline |
Returns true if the file is actually stdin/stdout. In that case, open_input() should not be called.
| std::pair< std::istream *, std::unique_ptr< std::istream > > vg::GAFSorterFile::open_input | ( | ) |
Returns an input stream to the file. The first return value is the actual stream. The second return value is a unique pointer which may contain a newly created stream. Sets the success flag.
| std::pair< std::ostream *, std::unique_ptr< std::ostream > > vg::GAFSorterFile::open_output | ( | ) |
Returns an output stream to the file. The first return value is the actual stream. The second return value is a unique pointer which may contain a newly created stream. If this is a raw GAF file, header lines are written to the output. Sets the success flag.
|
delete |
|
default |
|
inline |
Reads the next record from the file, assuming that this is not a raw GAF file. Sets the success flag.
| void vg::GAFSorterFile::remove_temporary | ( | ) |
Removes the file if it is temporary.
|
inline |
Writes the record to the file. Updates the number of records and sets the success flag.
| bool vg::GAFSorterFile::bidirectional_gbwt |
Should the GBWT index be bidirectional?
| bool vg::GAFSorterFile::compressed |
Is this file compressed?
| std::string vg::GAFSorterFile::gbwt_file |
File name for the GBWT index, if any.
| std::unique_ptr<std::vector<std::string> > vg::GAFSorterFile::header_lines |
Header lines that should be written to a raw GAF file.
| std::string vg::GAFSorterFile::name |
File name.
| bool vg::GAFSorterFile::ok |
Success flag.
| bool vg::GAFSorterFile::raw_gaf |
Is this a raw GAF file?
| size_t vg::GAFSorterFile::records |
Number of records.
| bool vg::GAFSorterFile::removed |
Has the file been removed?
| bool vg::GAFSorterFile::temporary |
Is this a temporary file created with temp_file::create()?
1.8.17