Skip to content

[results] After df2regulons(), gene name formatting in each regulon is weird #618

Open
@redbybeing

Description

@redbybeing

Hi,

I ran pyscenic successfully up to df2regulons() step and saved the result into pickle file. When I open the pickle file and try to access the gene names in each regulon, I get this weird formatting error. I don't know how to resolve this. I pasted the script and the output.

The script

with open(REGULONS, 'rb') as file:
    regulons = pickle.load(file)
print(type(regulons))
print(len(regulons))
first = regulons[0]
print(type(first))
print(dir(first))
print(first.name)
print(first.transcription_factor)
print(first.genes) # Output is weird because somehow it's printing out each character

The output

<class 'list'>
255
<class 'ctxcore.genesig.Regulon'>
['__annotations__', '__attrs_attrs__', '__class__', '__contains__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__len__', '__lt__', '__match_args__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__weakref__', 'add', 'annotation', 'context', 'copy', 'difference', 'from_gmt', 'from_grp', 'from_rnk', 'from_yaml', 'gene2occurrence', 'gene2weight', 'gene2weight_validator', 'genes', 'head', 'intersection', 'jaccard_index', 'metadata', 'name', 'name_validator', 'nes', 'non_empty', 'noweights', 'orthologous_identity', 'rename', 'score', 'similarity_qvalue', 'to_gmt', 'to_yaml', 'transcription_factor', 'union', 'weights', 'yaml_dumper', 'yaml_flow_style', 'yaml_loader', 'yaml_tag']
Arid3a(+)
Arid3a
('[', '(', "'", 'O', 's', 'g', 'i', 'n', '1', ',', ' ', 'p', '.', 'f', 'l', 'o', 'a', 't', '6', '4', '0', '5', '2', '9', '3', ')', 'D', 'd', 'x', '8', 'I', '7', 'A', 'r', 'b', ']')

So instead of readable gene names, I get this: ('[', '(', "'", 'O', 's', 'g', 'i', 'n', '1', ',', ' ', 'p', '.', 'f', 'l', 'o', 'a', 't', '6', '4', '0', '5', '2', '9', '3', ')', 'D', 'd', 'x', '8', 'I', '7', 'A', 'r', 'b', ']')

Does anyone have similar issue? Can anyone please help me?

Thank you.

For questions about using SCENIC, please use the Discussions: https://github.com/aertslab/SCENIC/discussions/

Create an issue only to report bugs.

Mote that most errors are due to the input from the user, and therefore should be treated as questions in the Discussions. Please, only report them as bugs if you are quite certain that they are not behaving as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions