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

[BUG] speficying unstranded data ('no') leads to error #153

Open
pinin4fjords opened this issue Mar 14, 2024 · 3 comments
Open

[BUG] speficying unstranded data ('no') leads to error #153

pinin4fjords opened this issue Mar 14, 2024 · 3 comments

Comments

@pinin4fjords
Copy link
Contributor

  • ribotricer version: 1.3.3
  • Operating System: Linux

Description

Just experimenting with --stranded

What I Did

ribotricer detect-orfs \
    --bam SRX11780888_chr20.bam \
    --ribotricer_index homo_sapiens_chr20_candidate_orfs.tsv \
    --stranded no \
    --prefix test \
    --phase_score_cutoff 0.05

Error:

Mar 14 10:56:30 ..... started ribotricer detect-orfs
Mar 14 10:56:30 ... started parsing ribotricer index file
Mar 14 10:56:30 ... started reading bam file                                                                                                                                               
[W::hts_idx_load3] The index file is older than the data file: SRX11780888_chr20.bam.bai
  0%|                                                                                                                                                        | 0/566761 [00:00<?, ?reads/s][W::hts_idx_load3] The index file is older than the data file: SRX11780888_chr20.bam.bai
no
Traceback (most recent call last):                                                                                                                                                         
  File "/path/to/mambaforge/envs/ribotricer/bin/ribotricer", line 10, in <module>
    sys.exit(cli())
  File "/path/to/mambaforge/envs/ribotricer/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/path/to/mambaforge/envs/ribotricer/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/path/to/mambaforge/envs/ribotricer/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/path/to/mambaforge/envs/ribotricer/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/path/to/mambaforge/envs/ribotricer/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/path/to/mambaforge/envs/ribotricer/lib/python3.10/site-packages/ribotricer/cli.py", line 244, in detect_orfs_cmd
    detect_orfs(
  File "/path/to/mambaforge/envs/ribotricer/lib/python3.10/site-packages/ribotricer/detect_orfs.py", line 400, in detect_orfs
    alignments, read_length_counts = split_bam(bam, protocol, prefix, read_lengths)
  File "/path/to/mambaforge/envs/ribotricer/lib/python3.10/site-packages/ribotricer/bam.py", line 122, in split_bam
    alignments[length][strand][(chrom, pos + 1)] += 1
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Without looking too hard it seems that pos does not get defined for unstranded data here.

Input files:

test_files.zip

@saketkc
Copy link
Collaborator

saketkc commented Mar 14, 2024

Hi @pinin4fjords, we currently do not support unstranded data (and should probably make it explicit until we do). For now, my suggestion would be to use either of the strands and proceed with downstream tasks.

@pinin4fjords
Copy link
Contributor Author

OK- but documentation states:

You can directly assign the strandedness using option --stranded, it can be 'yes', 'no', or 'reverse'. 

So you might want to get rid of the 'no' there.

@saketkc
Copy link
Collaborator

saketkc commented Mar 14, 2024

Indeed, that's right. Thanks for pointing it out.

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

2 participants