TypeError: float() argument must be a string or a number while running ROSE_main.py
Hi I am trying to run ROSE_main.py to call super enhancers on sample data provided by ROSE itself but getting following error related to TypeError: float() argument must be a string or a number. Has anybody faced the same issue and can help or guide how can I resolve this bug.
mapping to GFF and making a matrix with fixed bin number
Traceback (most recent call last):
File "ROSE_bamToGFF.py", line 247, in <module>
main()
File "ROSE_bamToGFF.py", line 238, in main
newGFF = mapBamToGFF(bamFile,gffFile,options.sense,int(options.extension),options.floor,options.rpm,options.matrix)
File "ROSE_bamToGFF.py", line 40, in mapBamToGFF
MMR= round(float(bam.getTotalReads('mapped'))/1000000,4)
TypeError: float() argument must be a string or a number
{'matrix': '1', 'extension': '200', 'floor': '1', 'sense': 'both', 'output': './mappedGFF/HG18_MM1S_MED1_MM1S_WCE.hg18.bwt.sorted.bam_MAPPED.gff', 'bam': '../ROSE_DATA/data/MM1S_WCE.hg18.bwt.sorted.bam', 'rpm': True, 'input': '../ROSE_DATA/data/HG18_MM1S_MED1.gff'}
For reference, my command looks like this:
python ROSE_main.py -g HG18 -i ../ROSE_DATA/data/HG18_MM1S_MED1.gff -r ../ROSE_DATA/data/MM1S_MED1.hg18.bwt.sorted.bam -o ./ -c ../ROSE_DATA/data/MM1S_WCE.hg18.bwt.sorted.bam
Comments (2)
-
-
I managed to solve this by adding samtools 0.1.18 to my PATH.
ROSE_utils.py calls samtools, expecting it to be available.
If it is not available, it does not seem to rapidly error out, but instead indicates
TypeError: float() argument must be a string or a numberand then waits a long time for a step to complete when it has already failed.
This was previously reported here.
A clearer error message at this stage and a test for samtools before ROSE running could be very beneficial here.
- Log in to comment
Hi,
I have also faced the same problem… Have you solved that and if so, could you give me some suggestions? And although it will report error for this line, the program can still run in my Macbook pro… Pretty strange