comparison picard_wrapper.py @ 143:b2ca2d181fb4 draft

fixed downsample sam in picard1106 (accept bam)
author Rayan Chikhi <chikhi@psu.edu>
date Mon, 16 Jun 2014 17:38:15 -0400
parents 1790970e47fe
children 767bcb0a06df
comparison
equal deleted inserted replaced
142:844fa42ad305 143:b2ca2d181fb4
798 elif pic.picname == 'SamFormatConverter': 798 elif pic.picname == 'SamFormatConverter':
799 cl.append('INPUT=%s' % opts.input) 799 cl.append('INPUT=%s' % opts.input)
800 cl.append('OUTPUT=%s' % tempout) 800 cl.append('OUTPUT=%s' % tempout)
801 pic.runPic(opts.jar, cl) 801 pic.runPic(opts.jar, cl)
802 haveTempout = True 802 haveTempout = True
803
803 elif pic.picname == "DownsampleSam": 804 elif pic.picname == "DownsampleSam":
804 cl.append('I=%s' % opts.input) 805 cl.append('I=%s' % opts.input)
805 mystring = opts.output 806 output_string = opts.output
806 mystringsam = mystring + ".sam" 807 if opts.datatype == 'sam':
807 cl.append('O=%s' % mystringsam) 808 output_string = output_string + ".sam"
809 cl.append('O=%s' % output_string)
808 if float(opts.probability) > 0: 810 if float(opts.probability) > 0:
809 cl.append('PROBABILITY=%s' % opts.probability) 811 cl.append('PROBABILITY=%s' % opts.probability)
810 if float(opts.seed) > 0: 812 if float(opts.seed) > 0:
811 cl.append('RANDOM_SEED=%s' % opts.seed) 813 cl.append('RANDOM_SEED=%s' % opts.seed)
812 stdouts,rval = pic.runPic(opts.jar, cl) 814 stdouts,rval = pic.runPic(opts.jar, cl)
813 myoutput = mystringsam.replace(".sam", "") 815 if opts.input.endswith(".sam"):
814 os.rename(mystringsam,myoutput) 816 renamed_output = output_string.replace(".sam", "")
817 os.rename(output_string,renamed_output)
815 818
816 elif pic.picname == 'MeanQualityByCycle': 819 elif pic.picname == 'MeanQualityByCycle':
817 isPDF = 'MeanQualityByCycle.pdf' 820 isPDF = 'MeanQualityByCycle.pdf'
818 pdfpath = os.path.join(opts.outdir,isPDF) 821 pdfpath = os.path.join(opts.outdir,isPDF)
819 histpdf = isPDF 822 histpdf = isPDF