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:
parent
f3f1b47808
commit
9b5e5e06f9
|
|
@ -3,7 +3,7 @@ import os.path
|
||||||
import sys
|
import sys
|
||||||
import getopt
|
import getopt
|
||||||
|
|
||||||
defaultCommands = ['CountLoci', 'Pileup']
|
defaultCommands = ['CountReads', 'Pileup']
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print "Optional arguments:"
|
print "Optional arguments:"
|
||||||
|
|
@ -31,14 +31,20 @@ if __name__ == "__main__":
|
||||||
if opt in ("-e", "--ignoreExistingFiles"):
|
if opt in ("-e", "--ignoreExistingFiles"):
|
||||||
ignoreExistingFiles = True
|
ignoreExistingFiles = True
|
||||||
|
|
||||||
|
directory = args[1]
|
||||||
for line in open(args[0]):
|
for line in open(args[0]):
|
||||||
lane = line.strip()
|
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)
|
head, lane_filename = os.path.split(lane)
|
||||||
filebase = os.path.splitext(lane_filename)[0]
|
filebase = os.path.splitext(lane_filename)[0]
|
||||||
|
|
||||||
# convert the fasta
|
# convert the fasta
|
||||||
for analysis in commandsList:
|
for analysis in commandsList:
|
||||||
output = filebase + '.' + analysis + '.output'
|
output = os.path.join(directory, filebase + '.' + analysis + '.output')
|
||||||
if ignoreExistingFiles or not os.path.exists(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 "
|
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
|
print cmd
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue