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

TypeError: expected str, bytes or os.PathLike object, not coo_matrix #178

Closed
farshadf opened this issue Dec 1, 2022 · 4 comments
Closed

Comments

@farshadf
Copy link

farshadf commented Dec 1, 2022

  • spladder version: 3.0.3
  • Python version: 3.10
  • Operating System: CentOS 7

Description

Hi,
I am trying to augment the annotation using "build" on STAR generated BAM files on the mouse reference genome, but spladder does not progress as expected although it seems to be starting fine.

What I Did

Script:

annotfile='/references/Mus_musculus/UCSC/mm10/Annotation/Genes/genes.gtf'
spladder build --bams alignment_list.txt \
               --annotation $annotfile \
               --outdir spladder_out \
               --ignore-mismatches \
               --parallel 20 \
               --sparse-bam \
               --set-mm-tag nM

This is the error message:

No information found for contig chr4_GL456216_random
No information found for contig chr1_GL456221_random
No information found for contig chr1_GL456211_random
No information found for contig chr4_JH584292_random
No information found for contig chrUn_JH584304
No information found for contig chrX_GL456233_random
Traceback (most recent call last):
  File "HOME/base3/bin/spladder", line 8, in <module>
    sys.exit(main())
  File "HOME/base3/lib/python3.10/site-packages/spladder/spladder.py", line 229, in main
    options.func(options)
  File "HOME/base3/lib/python3.10/site-packages/spladder/spladder_build.py", line 73, in spladder
    prep_sparse_bam_filtered(options)
  File "HOME/base3/lib/python3.10/site-packages/spladder/spladder_prep.py", line 57, in prep_sparse_bam_filtered
    P_IN = h5py.File(tmp[1], 'r')
  File "HOME/base3/lib/python3.10/site-packages/h5py/_hl/files.py", line 509, in __init__
    name = filename_encode(name)
  File "HOME/base3/lib/python3.10/site-packages/h5py/_hl/compat.py", line 19, in filename_encode
    filename = fspath(filename)
TypeError: expected str, bytes or os.PathLike object, not coo_matrix

This alignment_list.txt:

/test/STAR/2501_S1_R1_001.fastq-trimmedAligned.sortedByCoord.out.bam
/test/STAR/2501_S1_R2_001.fastq-trimmedAligned.sortedByCoord.out.bam
/test/STAR/2502_S2_R1_001.fastq-trimmedAligned.sortedByCoord.out.bam
/test/STAR/2502_S2_R2_001.fastq-trimmedAligned.sortedByCoord.out.bam
/test/STAR/2503_S3_R1_001.fastq-trimmedAligned.sortedByCoord.out.bam
/test/STAR/2503_S3_R2_001.fastq-trimmedAligned.sortedByCoord.out.bam
/test/STAR/2504_S4_R1_001.fastq-trimmedAligned.sortedByCoord.out.bam
/test/STAR/2504_S4_R2_001.fastq-trimmedAligned.sortedByCoord.out.bam
/test/STAR/2507_S5_R1_001.fastq-trimmedAligned.sortedByCoord.out.bam

Any help is appreciated! Thank you.

@MB571
Copy link

MB571 commented Jan 12, 2023

I'm getting the same/similar error

@MB571
Copy link

MB571 commented Jan 12, 2023

The error for

I'm getting the same/similar error

it seems to be coming from --sparse-bam for me

@akahles
Copy link
Member

akahles commented Feb 6, 2023

Dear @MB571 & @farshadf ,

Thanks a lot for reporting this and sorry for the late reply. Unfortunately, I sometimes fall behind on handling issues.

I have looked at the respective code part and I think I found the issue. In case of --sparse-bam and use of --parallel the encounter of unknown contig names was not cleanly handled. This should be better now. I have pushed a fix to the development branch and will make this available with the next release.

Best,
Andre

@akahles
Copy link
Member

akahles commented Feb 7, 2023

This fix is now available in the latest release, please reopen if this still causes problems.

@akahles akahles closed this as completed Feb 7, 2023
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

3 participants