comparison kmer_analysis.py @ 18:a121cce43f90 draft

Uploaded
author rlegendre
date Tue, 09 Jun 2015 09:06:17 -0400
parents 7c944fd9907e
children 385fc64fa988
comparison
equal deleted inserted replaced
17:c87c40e642af 18:a121cce43f90
365 (options, args) = parser.parse_args() 365 (options, args) = parser.parse_args()
366 sys.stdout.write("Begin kmer and phasing analysis at %s\n" % time.asctime( time.localtime( time.time() ) ) ) 366 sys.stdout.write("Begin kmer and phasing analysis at %s\n" % time.asctime( time.localtime( time.time() ) ) )
367 367
368 try: 368 try:
369 369
370 if os.path.exists(options.dirout): 370 if not os.path.exists(options.dirout):
371 raise 371 try:
372 try: 372 os.mkdir(options.dirout)
373 os.mkdir(options.dirout) 373 except Exception, e :
374 except: 374 stop_err('Error running make directory : ' + str(e))
375 raise
376 375
377 ##testing indexed bam file 376 ##testing indexed bam file
378 if os.path.isfile(options.bamfile+".bai") : 377 if os.path.isfile(options.bamfile+".bai") :
379 pass 378 pass
380 else : 379 else :
402 #GFF = store_gff(options.gff) 401 #GFF = store_gff(options.gff)
403 #GFF = ribo_functions.store_gtf(options.gff) 402 #GFF = ribo_functions.store_gtf(options.gff)
404 ## check gff reading 403 ## check gff reading
405 if not GFF['order'] : 404 if not GFF['order'] :
406 stop_err( 'Incorrect GFF file' ) 405 stop_err( 'Incorrect GFF file' )
407 406 for gene in GFF['order']:
407 if not GFF[gene]['exon'] :
408 del GFF[gene]
409 GFF['order'].remove(gene)
408 ## split bam 410 ## split bam
409 split_bam(options.bamfile,tmpdir) 411 split_bam(options.bamfile,tmpdir)
410 ################################### 412 ###################################
411 ## First analysis with 28mer : 413 ## First analysis with 28mer :
412 ################################### 414 ###################################