BradnerLab / pipeline

bradner lab computation pipeline scripts
Other
53 stars 47 forks source link

Error in bamToGFF.py #58

Closed gunjangala closed 7 years ago

gunjangala commented 7 years ago

Hi, I am trying to use bamToGFF.py but when run it I get the following error:

mapping to GFF and making a matrix with fixed bin number
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
bamToGFF.py in <module>()
    424
    425 if __name__ == "__main__":
--> 426     main()

bamToGFF.py in main()
    407         elif options.matrix:
    408             print('mapping to GFF and making a matrix with fixed bin number')
--> 409             newGFF = mapBamToGFF(bamFile,gffFile,options.sense,options.unique,int(options.extension),options.floor,options.density,options.rpm,25,None,options.matrix,False,options.jxn)
    410
    411         else:

bamToGFF.py in mapBamToGFF(bamFile, gff, sense, unique, extension, floor, density, rpm, binSize, clusterGram, matrix, raw, includeJxnReads)
    110         unique = False
    111         if rpm:
--> 112             MMR= round(float(bam.getTotalReads('mapped'))/1000000,4)
    113         else:
    114             MMR = 1

TypeError: float() argument must be a string or a number

Command used:

module unload python
module load python/2.7
python bamToGFF.py -b ${BAM_FILE} -i ${GFF_FILE} -o ${OUTPUT} -e 400 -m 25 -r 

Files to reproduce this error can be found here

Can you please help me fix this error?

Thanks, Gunjan

charlesylin commented 7 years ago

Hi Gunjan,

That error is usually caused when the initial bam is unsorted. If your bam is sorted and indexed, I'll take a look at your example files when I get a chance

Charles Y. Lin Assistant Professor Department of Molecular and Human Genetics Dan L. Duncan Cancer Center Baylor College of Medicine

On Mon, Aug 28, 2017 at 3:28 PM, Gunjan Sethia (Gala) < notifications@github.com> wrote:

Hi, I am trying to use bamToGFF.py but when run it I get the following error:

mapping to GFF and making a matrix with fixed bin number

TypeError Traceback (most recent call last) bamToGFF.py in () 424 425 if name == "main": --> 426 main()

bamToGFF.py in main() 407 elif options.matrix: 408 print('mapping to GFF and making a matrix with fixed bin number') --> 409 newGFF = mapBamToGFF(bamFile,gffFile,options.sense,options.unique,int(options.extension),options.floor,options.density,options.rpm,25,None,options.matrix,False,options.jxn) 410 411 else:

bamToGFF.py in mapBamToGFF(bamFile, gff, sense, unique, extension, floor, density, rpm, binSize, clusterGram, matrix, raw, includeJxnReads) 110 unique = False 111 if rpm: --> 112 MMR= round(float(bam.getTotalReads('mapped'))/1000000,4) 113 else: 114 MMR = 1

TypeError: float() argument must be a string or a number

Command used:

module unload python module load python/2.7 python bamToGFF.py -b ${BAM_FILE} -i ${GFF_FILE} -o ${OUTPUT} -e 400 -m 25 -r

Files to reproduce this error can be found here https://drive.google.com/file/d/0BwKNPkK6si-BOFRwWWJlSXZnUEU/view?usp=sharing

Can you please help me fix this error?

Thanks, Gunjan

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BradnerLab/pipeline/issues/58, or mute the thread https://github.com/notifications/unsubscribe-auth/AEXAr2lMU7D0Hnf59i8IaAvtx0qHCmvsks5scyLSgaJpZM4PFBdP .

gunjangala commented 7 years ago

Yes, the BAM files used are sorted and indexed.

charlesylin commented 7 years ago

is path to samtools "samtools" on your machine? what is your OS?

Charles Y. Lin Assistant Professor Department of Molecular and Human Genetics Dan L. Duncan Cancer Center Baylor College of Medicine

On Mon, Aug 28, 2017 at 8:34 PM, Gunjan Sethia (Gala) < notifications@github.com> wrote:

Yes, the BAM files used are sorted and indexed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BradnerLab/pipeline/issues/58#issuecomment-325528810, or mute the thread https://github.com/notifications/unsubscribe-auth/AEXAr6vy07xMtfHK8SX-dulkr4yn-uR_ks5sc2qdgaJpZM4PFBdP .

gunjangala commented 7 years ago

Yes, the path is "samtools". I am using SGE cluster (unix/linux).

gunjangala commented 7 years ago

The error got fixed. It works fine giving the desired output now.

gunjangala commented 7 years ago

The error was because of incorrect path of python module.

On Sat, Oct 21, 2017 at 4:23 PM, chlchan notifications@github.com wrote:

@gunjangala https://github.com/gunjangala Can you explain what the error was and how it was fixed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BradnerLab/pipeline/issues/58#issuecomment-338429830, or mute the thread https://github.com/notifications/unsubscribe-auth/APeuM6TjRAyalbj58XOtEUkO2ZbWFXZ_ks5sulLWgaJpZM4PFBdP .