Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading 'precise1k.json.gz' #1

Open
PaulVillain opened this issue Mar 8, 2024 · 0 comments
Open

loading 'precise1k.json.gz' #1

PaulVillain opened this issue Mar 8, 2024 · 0 comments

Comments

@PaulVillain
Copy link

Hello,

I would like to compare my RNAseq data to Precise 1K, but I am struggling to load the 'precise1k.json.gz' using the jupyter notebook code.

When running this line in jupyter lab:
p1k = load_json_model(Path(DATA_PATH, 'precise1k.json.gz').as_posix())

I get this error:

ValueError Traceback (most recent call last)
Cell In[3], line 1
----> 1 p1k = load_json_model(Path(DATA_PATH, 'precise1k.json.gz').as_posix())
2 p1k_log_tpm_qc = pd.read_csv(Path(DATA_PATH, 'log_tpm_qc.csv'), index_col=0)

File ~/miniconda3/envs/Precise_bis-env/lib/python3.8/site-packages/pymodulon/io.py:124, in load_json_model(filename)
121 if arg in serial_data.keys():
122 serial_data.pop(arg)
--> 124 data = IcaData(**serial_data)
125 data._cutoff_optimized = cutoff_optimized
126 data._dagostino_cutoff = dagostino_cutoff

File ~/miniconda3/envs/Precise_bis-env/lib/python3.8/site-packages/pymodulon/core.py:108, in IcaData.init(self, M, A, X, log_tpm, gene_table, sample_table, imodulon_table, trn, dagostino_cutoff, optimize_cutoff, thresholds, threshold_method, motif_info, imodulondb_table, gene_links, tf_links)
106 # Convert column names of M to int if possible
107 try:
--> 108 M.columns = M.columns.astype(int)
109 except TypeError:
110 pass

File ~/miniconda3/envs/Precise_bis-env/lib/python3.8/site-packages/pandas/core/indexes/base.py:1027, in Index.astype(self, dtype, copy)
1023 new_values = cls._from_sequence(self, dtype=dtype, copy=copy)
1025 else:
1026 # GH#13149 specifically use astype_array instead of astype
-> 1027 new_values = astype_array(values, dtype=dtype, copy=copy)
1029 # pass copy=False because any copying will be done in the astype above
1030 result = Index(new_values, name=self.name, dtype=new_values.dtype, copy=False)

File ~/miniconda3/envs/Precise_bis-env/lib/python3.8/site-packages/pandas/core/dtypes/astype.py:187, in astype_array(values, dtype, copy)
184 values = values.astype(dtype, copy=copy)
186 else:
--> 187 values = _astype_nansafe(values, dtype, copy=copy)
189 # in pandas we don't store numpy str dtypes, so convert to object
190 if isinstance(dtype, np.dtype) and issubclass(values.dtype.type, str):

File ~/miniconda3/envs/Precise_bis-env/lib/python3.8/site-packages/pandas/core/dtypes/astype.py:138, in _astype_nansafe(arr, dtype, copy, skipna)
134 raise ValueError(msg)
136 if copy or is_object_dtype(arr.dtype) or is_object_dtype(dtype):
137 # Explicit copy, or required since NumPy can't view from / to object.
--> 138 return arr.astype(dtype, copy=True)
140 return arr.astype(dtype, copy=copy)

ValueError: invalid literal for int() with base 10: 'Sugar Diacid'

Could you please help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant