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

list index out of range #5

Closed
ghost opened this issue Jul 2, 2014 · 8 comments
Closed

list index out of range #5

ghost opened this issue Jul 2, 2014 · 8 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2014

Hi, I'm trying to analyze sequenced reads from a virus and getting the following error:
(shorah.py -b ergebnisse.sorted.bam -f sequence.2133.fasta)


Traceback (most recent call last):
File "../Programme/shorah-master/shorah.py", line 142, in
keep_files=options.k, alpha=options.a)
File "/home/artur/Programme/shorah-master/dec.py", line 347, in main
r = aligned_reads.keys()[0]
IndexError: list index out of range


My dec.log looks like this:


INFO 2014-07-02 13:58:41,711 main 322 ../Programme/shorah-master/shorah.py -b ergebnisse.sorted.bam -f sequence.2133.fasta
DEBUG 2014-07-02 13:58:57,795 windows 129 Finished making windows
DEBUG 2014-07-02 13:58:57,796 windows 130 b2w returned 0
INFO 2014-07-02 13:58:57,796 parse_aligned_reads 94 Using file reads.fas of aligned reads
DEBUG 2014-07-02 13:58:57,796 parse_aligned_reads 97 Parsing aligned reads


I suppose it has something to do with the fact that no reads are found.
But why ? Is there a threshold to the frequency of variants?
Because the frequencies are very low.
Furthermore i wanted to specify the region for the haplotypes with the -r parameter.
Is this right ? If its right, then what is the chromosome name of a virus genome?
(-r chr:start-stop)

@ozagordi
Copy link
Collaborator

ozagordi commented Jul 2, 2014

Hi,
it looks to me that your first problem is the same reported in issue #4, i.e. a region with few or no reads. See what the other user reported to solve it.

As for your second question, the chromosome name is simply the id of the sequence you are using as reference. Please let me know if this is fine for you. I'll close the issue in a few days.

@ghost
Copy link
Author

ghost commented Jul 3, 2014

Thanks for the fast answer,
but its still not working.
I resized the region for reconstruct, but all windows contain 0 reads.
I suppose its because my SNVs are too rare.
Average frequencies are 2-3*10^-4.
=> But well the Issue is not the program but my reads

@ozagordi
Copy link
Collaborator

ozagordi commented Jul 3, 2014

Reads are assigned to windows based only on their alignment, regardless of SNVs. Check that your alignment is working by inspecting the BAM file (with samtools tview, for example).

That said, I'm not sure you will be able to reliably detect SNVs at frequency 10^-4.

@ghost
Copy link
Author

ghost commented Jul 4, 2014

hmm the alignment looks fine, if I get it right.
well i just don't have alignments of the reverse strand cause i do several filtering steps and realignments.
Does shorah consider the base quality?

@ozagordi
Copy link
Collaborator

ozagordi commented Jul 4, 2014

No. What is your average read length again? And what is your window size?

@ghost
Copy link
Author

ghost commented Jul 4, 2014

window size is 201 didn't change it.
the read length varies from 10 to 107 but the average should be 90

@ozagordi
Copy link
Collaborator

ozagordi commented Jul 4, 2014

The window size should be slightly smaller than the read length. I would run with 90.

@ghost
Copy link
Author

ghost commented Jul 4, 2014

Ah didn't read the local part.
Thanks a lot it seems to work, but there is a warning :


/usr/local/lib/python2.7/dist-packages/Bio/Seq.py:302: BiopythonDeprecationWarning: This method is obsolete; please use str(my_seq) instead of my_seq.tostring().
BiopythonDeprecationWarning)


But its probably the problem of Biopython
Thanks a lot again!

ozagordi pushed a commit that referenced this issue Apr 23, 2018
Fixed Build Warning: Layout 'none' requested in feed.xml does not exist. Added footer settings.
DrYak pushed a commit that referenced this issue Feb 23, 2023
* [Added] Cpp bindings [Fixed] Mem leaks in dpm_sampler

* [Added] Old b2w with Cpp interface, long_deletion test [Fixed] All tests

* [Added] Workflow, [Removed] Examples that were converted to tests

* [Fixed] Missing deps

* [Fixed] GHA yaml

* [Fixed] Upload wheel

* [Fixed] tar gz

* [Added] Release flow

* [Added] Release without tag

* [Fix] Use short SHA as tag

* [Fix] setuptools

* [Fixed] docs
[Fixed] Version bump numpy ndarray issue

* [Fix] Cleanup files and file names

* [Fix] GH file naming convention

* [Fix] Release notes

* [Fix] CI tagging

* [Fix] CI tagging

* [Fix] CI restructured

* [Fix] CI name

* [Add] conda env

* [Fix] conda pin versions

* [Add] Bump versions [Remove] Dead code __future__

* [Changed] trimer tiling (triple)

* [Fix] Tuple vs list issue in tiling

* [Fix] Windows for primer tiling

* [Add] todos for incomplete code refactoring

* [Draft] shorah snv rewrite to more flexible windows

* [Removed] Release action because pip allows installs from branch

* [Added] Shorah shotgun -r is now optional

* [Fixed] Without region flag -r
DrYak pushed a commit that referenced this issue Feb 23, 2023
* impl(b2w): use pileup for insert and del search
ci(docker): remove entrypoint

* impl(b2w): Rewrite to indel map, conformance to tests

* ci(GHA): attempt to fix

* ci(GHA): attempt to fix

* ci(GHA): attempt to fix

* ci(GHA): attempt to fix

* ci(GHA): attempt to fix

* ci(GHA): attempt to fix

* ci(GHA): attempt to fix

* ci(GHA): attempt to fix

* ci(GHA): attempt to fix
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