Now supports checking that the input files exist and are good

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@117 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2009-03-20 16:40:54 +00:00
parent f3f1b47808
commit 9b5e5e06f9
1 changed files with 8 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import os.path
import sys
import getopt
defaultCommands = ['CountLoci', 'Pileup']
defaultCommands = ['CountReads', 'Pileup']
def usage():
print "Optional arguments:"
@ -31,14 +31,20 @@ if __name__ == "__main__":
if opt in ("-e", "--ignoreExistingFiles"):
ignoreExistingFiles = True
directory = args[1]
for line in open(args[0]):
lane = line.strip()
if not os.path.exists(lane):
print 'Input SAM/BAM file: "', lane, '" does not exist, skipping...'
continue
head, lane_filename = os.path.split(lane)
filebase = os.path.splitext(lane_filename)[0]
# convert the fasta
for analysis in commandsList:
output = filebase + '.' + analysis + '.output'
output = os.path.join(directory, filebase + '.' + analysis + '.output')
if ignoreExistingFiles or not os.path.exists(output):
cmd = "java -jar ~/dev/GenomeAnalysisTK/trunk/dist/GenomeAnalysisTK.jar T=" + analysis + " I= " + lane + " R= /seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta "
print cmd