write_gmtx_forgems

besca.tl.sig.write_gmtx_forgems(signature_dict, GMT_file)[source]

Writes a gmtx file that can later be uploaded to GeMS. The input should be standardised, as facilitated by bc.tl.sig.make_gmtx.

Parameters:
  • signature_dict (dictionary) – the dictionary containing the signatures to be outputed to a gmtx file prepared with bc.tl.sig.make_gmtx, each signature is itself a dictionary

  • GMT_file (str) – gmt file location containing the geneset

Example

>>> signature_dict = {'setName': 'Th17Tcell_mc38_user', 'desc': 'T-helper 17 cell markers; coefs are log2FC', 'User': 'user', 'Source': 'internal scseq', 'Subtype': 'onc', 'geneset': 'Pembro_MC38-tumor_dblabel', 'domain': 'cell marker', 'studyID': 'Pembro_MC38-tumor', 'analysisID': 'sw_besca24', 'genes|score': 'Cd163l1 | 10.67    Gm9961 | 10.49  Cdh10'}
>>> outgmtfile='Celltypemarkers.gmtx'
>>> write_gmtx_forgems(signature_dict, outgmtfile)