Outputs#

To use one of the described component here, you have to import them from khloraascaf.outputs.

Type#

OrCT#

Oriented contig type.

Alias of:

tuple (IdCT, IndexT)

Constants#

For OrCT#

ORC_ID_IND = 0#

Index of the identifier for OrT

ORC_OR_IND = 1#

Index of the orientation for OrT

Orientation to string#

ORIENT_INT_STR = ('+', '-')#

Get orientation strings from orientation binaries.

Type:

tuple (str, str)

Files#

CONTIGS_OF_REGIONS_PREFIX = 'contigs_of_regions'#

Prefix of the contigs of regions file name.

CONTIGS_OF_REGIONS_EXT = 'tsv'#

Extension of the contigs of regions file

MAP_OF_REGIONS_PREFIX = 'map_of_regions'#

Prefix of the map of regions file name.

MAP_OF_REGIONS_EXT = 'tsv'#

Extension of the map of regions file

Functions#

Auto-generated output directory for result files#

generate_output_directory(instance_name)#

Return an single copy output directory path.

The output directory name respects the following format: <yyyy>-<mm>-<dd>_<HH>:<MM>:<SS>_<instance_name>

Parameters:

instance_name (str) – Instance’s name

Returns:

Output directory

Return type:

Path

Contigs of regions#

write_contigs_of_regions(result, contigs_of_regions_path, id_container=None)#

Write the regions’ contigs file.

#DOCU describe the output file here

Parameters:
  • result (ScaffoldingResult) – Previous scaffolding result

  • contigs_of_regions_path (Path) – Path of the future file containing the regions’ oriented contigs

  • id_container (MDCGraphIDContainer, optional) – Identifiers container for the graph, by default None

read_contigs_of_regions(contigs_of_regions_path)#

Read the regions’ contigs file.

Parameters:

contigs_of_regions_path (Path) – List of oriented contigs for each region

Yields:

tuple of OrCT – List of oriented contigs for one region

fmt_contigs_of_regions_filename(instance_name, ilp_combination)#

Format the contigs of regions filename.

Parameters:
  • instance_name (str) – Instance name

  • ilp_combination (iterable of RegionIDT) – ILP string code combination

Returns:

Formatted filename

Return type:

str

write_map_of_regions(result, map_of_regions_path)#

Write the region map file.

# DOCU describe the output file here

Parameters:
  • result (ScaffoldingResult) – Scaffolding result

  • map_of_regions_path (Path) – Path of the future file containing the regions’ oriented contigs

read_map_of_regions(map_of_regions_path)#

Write the region map file.

Parameters:

map_of_regions_path (Path) – Map of regions

Yields:

IndOrT – The index and the orientation of the region

fmt_map_of_regions_filename(instance_name, ilp_combination)#

Format map of the regions filename.

Parameters:
  • instance_name (str) – Instance name

  • ilp_combination (iterable of str) – ILP string code combination

Returns:

Formatted filename

Return type:

str