brittneybrinsfield / pysam

Automatically exported from code.google.com/p/pysam
0 stars 0 forks source link

RPKM_count.py doesn't work with new pysam libraries #102

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run RPKM_count.py on any bam file

What is the expected output? What do you see instead?
I get this error
BAM/SAM file has no header section. Exit!
BAM/SAM file has no header section. Exit!

What version of the product are you using? On what operating system?
RSeQC 2.3.3 and pysam 0.6

Please provide any additional information below.
The class definition checks the length of the header

def __init__(self,inputFile):
        '''constructor. input could be bam or sam'''
        try:
                self.samfile = pysam.Samfile(inputFile,'rb')
                if len(self.samfile.header) ==0:
                        print >>sys.stderr, "BAM/SAM file has no header section. Exit!"
                        sys.exit(1)
                self.bam_format = True
        except:
                self.samfile = pysam.Samfile(inputFile,'r')
                if len(self.samfile.header) ==0:
                        print >>sys.stderr, "BAM/SAM file has no header section. Exit!"
                        sys.exit(1)
                self.bam_format = False

which is now a placeholder and it is an empty dictionary. 

Original issue reported on code.google.com by daweonline on 15 Oct 2012 at 10:19

GoogleCodeExporter commented 9 years ago
Thanks, can you please provide a sample bam file?

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 21 Nov 2012 at 3:12

GoogleCodeExporter commented 9 years ago
No update.

Original comment by andreas....@gmail.com on 27 Jun 2013 at 1:37