Write GCT

Transform profiles into a gct (Gene Cluster Text) file A gct is a tab deliminted text file that traditionally stores gene expression data File Format Description: https://clue.io/connectopedia/gct_format

Modified from cytominer_scripts “write_gcg” written in R https://github.com/broadinstitute/cytominer_scripts/blob/master/write_gct.R

pycytominer.cyto_utils.write_gct.write_gct(profiles: DataFrame, output_file: str, features: str | list[str] = 'infer', meta_features: str | list[str] = 'infer', feature_metadata: DataFrame | None = None, version: str = '#1.3')

Convert profiles to a .gct file

Parameters:
  • profiles (pd.DataFrame) – DataFrame of profiles.

  • output_file (str) – If provided, will write gct to file.

  • features (list) – A list of strings corresponding to feature measurement column names in the profiles DataFrame. All features listed must be found in profiles. Defaults to “infer”. If “infer”, then assume features are from CellProfiler output and prefixed with “Cells”, “Nuclei”, or “Cytoplasm”.

  • meta_features (list) – A list of strings corresponding to metadata column names in the profiles DataFrame. All features listed must be found in profiles. Defaults to “infer”. If “infer”, then assume metadata features are those prefixed with “Metadata”

  • feature_metadata (pd.DataFrame, default None)

  • version (str, default "#1.3") – Important for gct loading into Morpheus

Returns:

Writes gct to file

Return type:

None