comparison bwa_wrapper.py @ 2:3a001705dc94 draft default tip

Uploaded
author evan
date Fri, 06 Jun 2014 12:55:09 -0400
parents 8d92246f41bb
children
comparison
equal deleted inserted replaced
1:2ba834228e9b 2:3a001705dc94
74 parser.add_option( '', '--rgsm', dest='rgsm', help='Sample' ) 74 parser.add_option( '', '--rgsm', dest='rgsm', help='Sample' )
75 parser.add_option( '-D', '--dbkey', dest='dbkey', help='Dbkey for reference genome' ) 75 parser.add_option( '-D', '--dbkey', dest='dbkey', help='Dbkey for reference genome' )
76 parser.add_option( '-X', '--do_not_build_index', dest='do_not_build_index', action='store_true', help="Don't build index" ) 76 parser.add_option( '-X', '--do_not_build_index', dest='do_not_build_index', action='store_true', help="Don't build index" )
77 parser.add_option( '-H', '--suppressHeader', dest='suppressHeader', help='Suppress header' ) 77 parser.add_option( '-H', '--suppressHeader', dest='suppressHeader', help='Suppress header' )
78 parser.add_option( '-I', '--illumina1.3', dest='illumina13qual', help='Input FASTQ files have Illuina 1.3 quality scores' ) 78 parser.add_option( '-I', '--illumina1.3', dest='illumina13qual', help='Input FASTQ files have Illuina 1.3 quality scores' )
79 parser.add_option( '', '--meta_tsv', dest='metadata_tsv', help='Meta data for filling things like sequencing center' )
79 (options, args) = parser.parse_args() 80 (options, args) = parser.parse_args()
80 81
81 # output version # of tool 82 # output version # of tool
82 try: 83 try:
83 tmp = tempfile.NamedTemporaryFile().name 84 tmp = tempfile.NamedTemporaryFile().name
202 else: 203 else:
203 gen_alignment_cmds = '' 204 gen_alignment_cmds = ''
204 if options.metadata_tsv: 205 if options.metadata_tsv:
205 f = open(options.metadata_tsv, 'r') 206 f = open(options.metadata_tsv, 'r')
206 cols = f.readline().split('\t') 207 cols = f.readline().split('\t')
207 readGroup = '@RG\tID:1\tDS:%s\tPU:%s\tLB:%s\tCN:BMGC\tDT:%s\tFR:%s\tRR:%s\tPL:ILLUMINA' % ( cols[4], cols[16], cols[14], cols[1], cols[19], cols[20] ) 208 readGroup = '@RG\tID:%s\tDS:%s\tPU:%s\tLB:%s\tCN:BMGC\tDT:%s\tFR:%s\tRR:%s\tPL:ILLUMINA\tSM:%s' % ( cols[0], cols[4], cols[16], cols[14], cols[1], cols[19], cols[20], cols[18] )
208 gen_alignment_cmds += ' -r "%s"' % readGroup 209 gen_alignment_cmds += ' -r "%s"' % readGroup
209 print readGroup 210 print readGroup
210 if options.rgid: 211 if options.rgid:
211 if not options.rglb or not options.rgpl or not options.rgsm: 212 if not options.rglb or not options.rgpl or not options.rgsm:
212 stop_err( 'If you want to specify read groups, you must include the ID, LB, PL, and SM tags.' ) 213 stop_err( 'If you want to specify read groups, you must include the ID, LB, PL, and SM tags.' )