From de9f2b11daf28d9fc67604cdef23a6731c58bf7c Mon Sep 17 00:00:00 2001 From: depristo Date: Fri, 25 Sep 2009 12:56:28 +0000 Subject: [PATCH] Detects unmapped (no bai) bam files and doesn't blow up git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1725 348d0f76-0448-11de-a6fe-93d51630548a --- python/Verify1KGArchiveBAMs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/Verify1KGArchiveBAMs.py b/python/Verify1KGArchiveBAMs.py index cc996e509..21e3c88a8 100644 --- a/python/Verify1KGArchiveBAMs.py +++ b/python/Verify1KGArchiveBAMs.py @@ -182,8 +182,10 @@ def readAlignmentIndex(file): files = set() if file <> None: for line in open(file): - files.add(line.split()[0]) - files.add(line.split()[4]) + parts = line.split() + files.add(parts[0]) + if len(parts) > 4: # we have an index, we're not unmapped + files.add(line.split()[4]) return files def compareAlignmentIndices(remoteAlignmentIndex, alignmentIndex):