rfmix_reader.create_binaries¶
- rfmix_reader.create_binaries(file_prefix, binary_dir='./binary_files')[source]¶
Create binary files from fullband (FB) TSV files.
This function identifies FB TSV files based on a given prefix, creates a directory for binary files if it doesn’t exist, and converts the identified TSV files to binary format.
- Parameters:
(str) (file_prefix) – The prefix used to identify the relevant FB TSV files.
(str (binary_dir) – The directory where the binary files will be stored. Defaults to “./binary_files”.
optional) – The directory where the binary files will be stored. Defaults to “./binary_files”.
- Return type:
None
- Raises:
FileNotFoundError – If no files matching the given prefix are found.:
PermissionError – If there are insufficient permissions to create: the binary directory.
IOError – If there’s an error during the file conversion process.:
Example
create_binaries(”data_”, “./output_binaries”)
Notes
This function relies on helper functions get_prefixes and _generate_binary_files.
Ensure that the necessary permissions are available to create directories and files.
Creates a directory for binary files if it doesn’t exist.
Converts identified FB TSV files to binary format.
Prints messages about the creation process.
Dependencies¶
get_prefixes: Function to get file prefixes.
_generate_binary_files: Function to convert TSV files to binary format.
os.makedirs: For creating directories.