File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,16 @@ genomePath = cmo.util.genomes[args.genome]['fasta']
37
37
38
38
### Extract sample IDs from BAMs unless user provided a GBCMS precomputed fillout
39
39
bamString = []
40
+ dedupBams = dict () # To deduplicate BAMs with the same sample IDs
40
41
if args .fillout is None :
41
42
for bam in args .bams :
42
43
sam = pysam .AlignmentFile (bam , "rb" )
43
44
# In MSK DMP BAMs, the more appropriate sample ID is in "ID" not "SM" - use the shorter one
44
45
sample_id = sam .header ['RG' ][0 ]['ID' ] if len (sam .header ['RG' ][0 ]['ID' ]) < len (sam .header ['RG' ][0 ]['SM' ]) else sam .header ['RG' ][0 ]['SM' ]
45
46
sam .close ()
46
- bamString .append ('--bam ' + sample_id + ':' + bam )
47
+ if sample_id not in dedupBams :
48
+ bamString .append ('--bam ' + sample_id + ':' + bam )
49
+ dedupBams [sample_id ] = 1
47
50
bamString = string .join (bamString )
48
51
49
52
### Check if MAF has right genome
You can’t perform that action at this time.
0 commit comments