Majiq psi - AttributeError: 'str' object has no attribute 'dtype'

129 views
Skip to first unread message

aykut sen

unread,
Feb 7, 2021, 1:00:39 PM2/7/21
to majiq_voila
Hi,

I have recently installed the MAJIQ using its source code on "git+https://bitbucket.org/biociphers/majiq_stable.git#egg=majiq" following this post.

I am following the quick start guide on this website. I was able to run the majiq builder i.e. majiq build. However, during the quantification step via "majiq psi" I run into an error  as shown below (highlighted in gray). It seems like it is having some issues when trying to create an hdf5 dataset to store the sample names. I have tried to see what it is using as an input to create the hdf5 dataset and it turns out to be only the sample names stored in a NumPy array (data=arr) which is highlighted in yellow below. 

I am using Python 3.7 and it runs on a Centos 7 linux operating system. I would really appreciate any help with regards to solving this issue. 

Best regards,
Aykut

2021-02-07 14:00:39,534 (PID:12848) - INFO - Majiq psi v2.1-05c9c32 2021-02-07 14:00:39,534 (PID:12848) - INFO - Command: /gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/bin/majiq psi /gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_1_sorted.majiq /gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_2_sorted.majiq /gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_3_sorted.majiq -j 6 -o /gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/psi_out -n wt_embryo 2021-02-07 14:00:39,534 (PID:12848) - INFO - Running Psi ... 2021-02-07 14:00:39,534 (PID:12848) - INFO - GROUP: ['/gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_1_sorted.majiq', '/gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_2_sorted.majiq', '/gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_3_sorted.majiq'] 2021-02-07 14:00:39,534 (PID:12848) - INFO - Parsing file: /gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_1_sorted.majiq 2021-02-07 14:00:39,663 (PID:12848) - INFO - Parsing file: /gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_2_sorted.majiq 2021-02-07 14:00:39,762 (PID:12848) - INFO - Parsing file: /gpfs/home/vas20xhu/RNA-seq/data/AA_RNAseq_DATA_analysis/splicing_analysis/results/AA_N2_Embryo_3_sorted.majiq 2021-02-07 14:00:39,869 (PID:12848) - INFO - Group wt_embryo: 747 LSVs Event 0/747 Event 222/747 Event 444/747 Event 666/747 Event 370/747 Event 148/747 Event 592/747 Event 74/747 Event 296/747 Event 518/747 Event 740/747 2021-02-07 14:00:40,621 (PID:12848) - INFO - Computation done, saving results....
<HDF5 file "wt_embryo.psi.voila" (mode r+)> 
 [['AA_N2_Embryo_1_sorted' 'AA_N2_Embryo_2_sorted' 'AA_N2_Embryo_3_sorted'] ['' '' '']] Traceback (most recent call last): File "majiq/src/calc_psi.pyx", line 100, in majiq.src.calc_psi._core_calcpsi File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/lib/python3.7/site-packages/voila/api/matrix_hdf5.py", line 302, in experiment_names bar = self.create_dataset('metadata/experiment_names', data=arr) File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/lib/python3.7/site-packages/voila/api/matrix_hdf5.py", line 378, in create_dataset self.h.create_dataset(*args, **kwargs) File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/lib/python3.7/site-packages/h5py/_hl/group.py", line 148, in create_dataset dsid = dataset.make_new_dset(group, shape, dtype, data, name, **kwds) File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/lib/python3.7/site-packages/h5py/_hl/dataset.py", line 140, in make_new_dset dset_id.write(h5s.ALL, h5s.ALL, data) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5d.pyx", line 232, in h5py.h5d.DatasetID.write File "h5py/_proxy.pyx", line 145, in h5py._proxy.dset_rw File "h5py/_conv.pyx", line 773, in h5py._conv.ndarray2vlen AttributeError: 'str' object has no attribute 'dtype' 
During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/bin/majiq", line 8, in <module> sys.exit(main()) File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/lib/python3.7/site-packages/majiq/run_majiq.py", line 204, in main args.func(args) File "majiq/src/calc_psi.pyx", line 28, in majiq.src.calc_psi.calcpsi File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/lib/python3.7/site-packages/majiq/src/basic_pipeline.py", line 11, in pipeline_run return pipeline.run() File "majiq/src/calc_psi.pyx", line 127, in majiq.src.calc_psi.CalcPsi.run File "majiq/src/calc_psi.pyx", line 96, in majiq.src.calc_psi._core_calcpsi File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/lib/python3.7/site-packages/voila/api/matrix_hdf5.py", line 52, in __exit__ self.close() File "/gpfs/home/vas20xhu/.conda/envs/rna-seq-splicing/lib/python3.7/site-packages/voila/api/matrix_hdf5.py", line 59, in close self._tsv_file.close() AttributeError: 'NoneType' object has no attribute 'close'

Paul Jewell

unread,
Feb 10, 2021, 4:19:36 PM2/10/21
to majiq_voila
Aykut, 

I've not seen this issue before, so I imagine there could be a few high level debugging steps to try first. 

1) Did the build take quite a long time to run? It's possible with intensive I/O programs like this, there is the potential for some data corruption to take place. Would you be able to run the build and quantification once more on any other storage volume / hard disk to rule out this possibility?
2) Can you try using the standard python3.8 venv + pip install for the attempt, instead of conda?

If the result is still reproducible I may need to take a look at a data subset to see if I can reproduce the issue on my end. 

Thanks, 
-Paul

aykut sen

unread,
Feb 15, 2021, 8:14:02 AM2/15/21
to majiq_voila
Hi Paul,

Thank you for your response and recommendations. The build command took about 4-5 minutes to run which printed at the end that "MAJIQ Builder is ended successfully!". 

Just for future reference in case anyone else encounters the same error, I repeated running the build and PSI quantification (MAJIQ version 2.0) with Python 3.7 and 3.8 (within conda, in separate environments), and the resulting error message was exactly the same. I then installed the academic version of MAJIQ (version 2.1) and this worked perfectly fine with both Python 3.7 and 3.7 within the conda environment. 

I performed all these before you replied to this thread. Thus, I cannot tell what would have been the outcome if I was to repeat the MAJIQ build and PSI quantification (with version 2.0) in a python 3.8 virtual environment independently of conda environment.

Best regards,
Aykut

Reply all
Reply to author
Forward
0 new messages