valpas.io.write_outfile#

valpas.io.write_outfile(data, file_handle, idx, output_type='sorted_list', overwrite=False, association_type='correlation')#

Takes a pandas.DataFrame object and writes it to a file handle. This can be either a file or sys.stdout.

Parameters:
  • data (tuple[pandas.DataFrame, pandas.DataFrame]) – Touple of two pandas.DataFrame, one containing calculated association values the other counts for how many values were used for the association value calculation between two omics data points.

  • file_handle (str | PathLike | Path | TextIOBase) – Path to the outfile that should be written.

  • idx (tuple[str, str]) – Touple of two pandas.Index objects containing the index for the two omics types which were used to calculate association values.

  • output_type ({'sorted_list', 'correlation_matrix'}, default='sorted_list') – The type of output file that should be written.

  • overwrite (bool, default=False) – Defines if the output file / sheet should be overwritten if it already exists.

  • association_type (str, default='correlation') – Optional argument that is used to describe the association type in the output.

Raises:

ValueError – If the supplied file_handle is not an instance of a ‘legal’ type.

Return type:

None