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

IndexError: list index out of range #5

Closed
brianpenghe opened this issue Apr 19, 2017 · 3 comments
Closed

IndexError: list index out of range #5

brianpenghe opened this issue Apr 19, 2017 · 3 comments

Comments

@brianpenghe
Copy link
Owner

Traceback (most recent call last):
File "/../georgi/code/makewigglefromBAM-NH.py", line 413, in
run()
File "/../georgi/code/makewigglefromBAM-NH.py", line 186, in run
reads = int(fields[2])
IndexError: list index out of range

@brianpenghe
Copy link
Owner Author

Georgi:
Has the pysam version changed somehow by any chance?

This is what that function should output (it does that on the system here):

for chrStats in pysam.idxstats(BAM):
print chrStats

['chr10', '129993255', '3906907', '0']
....

This is what I get for this file on pongo:

c
h
r
1

1
9
7
1
9
5
4
3
2

9
3
7
5
4

0

@brianpenghe
Copy link
Owner Author

Henry:
The default output from samtools commands run via the dispatcher method has changed:

pysam-developers/pysam#245

This is actually a move in the right direction, I just wish that the packagers would have made a more vocal announcement of the change during the upgrade process.

The idea is that pysam command line tools which send to stdout and stderr break in environments where stdout and stderr is captured and potentially mangled in some way. By returning a string, for every tool, it unifies the output into one format that can be dealt with by the developer at presentation time.

Unfortunately, now a bunch of tools are probably broken and will need adjustments.

As a side note, samtools sort and as a consequence, pysam.sort() has changed the way it writes the sorted bam file. You now have to specify the output file name via the -o switch or redirect stdout to a file. They also enabled threading.

@brianpenghe
Copy link
Owner Author

This problem has been fixed now.

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