From fa8cfd30319badb83cf7f2ac08b607e594ccb89a Mon Sep 17 00:00:00 2001 From: chartl Date: Sun, 19 Sep 2010 02:45:16 +0000 Subject: [PATCH] Adding this to get around lsf/csh issues (see recent help message). Also seems like a good time to reiterate http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4309 348d0f76-0448-11de-a6fe-93d51630548a --- python/gatherIndelsToVCF.py | 20 ++++++++++---------- python/lsf_post_touch.py | 10 ++++++++++ python/splitIntervalsByContig.py | 1 + 3 files changed, 21 insertions(+), 10 deletions(-) create mode 100755 python/lsf_post_touch.py diff --git a/python/gatherIndelsToVCF.py b/python/gatherIndelsToVCF.py index 3a2a45a19..c69a05701 100755 --- a/python/gatherIndelsToVCF.py +++ b/python/gatherIndelsToVCF.py @@ -5,7 +5,6 @@ import sys input_verbose_beds = sys.argv[1].split(",") output_vcf_name = sys.argv[2] -reference_file = sys.argv[3] vcf_header = ["#CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"] format = "GT:FT" @@ -119,11 +118,13 @@ def fixAlts(alts_in): return ",".join(fixed_alts) def fixChrom(chrom): + if ( chrom == 0 ): + return "chrM") if ( chrom == "23" ): - return "X" + return "chrX" if ( chrom == "24" ): - return "Y" - return chrom + return "chrY" + return "chr"+chrom def writeVCFLine(out_stream,indel_list,sample_list): alts = getAlts(indel_list) @@ -175,10 +176,13 @@ def parseIndels(filePath,sampleName): for line in f.readlines(): if ( not line.startswith("[") ): spline = line.split("\t") - if ( spline[0] != "X" and spline[0] != "Y" ): + spline[0] = spline[0].split("chr")[1] + if ( spline[0] != "X" and spline[0] != "Y" and spline[0] != "M"): chrom = int(spline[0]) else: - if ( spline[0] == "X"): + if ( spline[0] == "M" ): + chrom = 0 + elif ( spline[0] == "X"): chrom = 23 else: chrom = 24 @@ -225,7 +229,3 @@ def writeVCF(verbose_bed_list): writeVCF(input_verbose_beds) -## now dumb hacky thing - -cmd = "java -jar /humgen/gsa-scr1/chartl/sting/dist/GenomeAnalysisTK.jar -T VCFReferenceFixer -B fixme,VCF,"+output_vcf_name+"_BAD_REFERENCE.vcf -o "+output_vcf_name+" -R "+reference_file+" -l INFO" -os.system(cmd) diff --git a/python/lsf_post_touch.py b/python/lsf_post_touch.py new file mode 100755 index 000000000..47cc259be --- /dev/null +++ b/python/lsf_post_touch.py @@ -0,0 +1,10 @@ +import sys +import os +status = sys.argv[1] +directories = list() + +for j in range(2,len(sys.argv)) : + directories.append(sys.argv[j]) + +if ( status == "0" ): + os.system("touch "+" ".join(directories)) diff --git a/python/splitIntervalsByContig.py b/python/splitIntervalsByContig.py index 351fa1320..6ad4fee1a 100644 --- a/python/splitIntervalsByContig.py +++ b/python/splitIntervalsByContig.py @@ -1,3 +1,4 @@ +#!/usr/bin/python import sys input_file = sys.argv[1] file_index = 1