From 925bd123a43076992e034139dd1c91591952ee21 Mon Sep 17 00:00:00 2001 From: caleblareau Date: Mon, 21 May 2018 03:33:48 -0400 Subject: [PATCH] v0.3.7 should fix termini --- Pypkg/mgatk/mgatk/bin/python/filterClipBam.py | 2 +- Pypkg/mgatk/mgatk/bin/python/sumstatsBP.py | 1 + Pypkg/mgatk/mgatk/cli.py | 9 ++++++--- Pypkg/mgatk/setup.py | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Pypkg/mgatk/mgatk/bin/python/filterClipBam.py b/Pypkg/mgatk/mgatk/bin/python/filterClipBam.py index 4e2a383..074919c 100755 --- a/Pypkg/mgatk/mgatk/bin/python/filterClipBam.py +++ b/Pypkg/mgatk/mgatk/bin/python/filterClipBam.py @@ -24,6 +24,7 @@ keepCount = 0 filtCount = 0 +#proper_pair = "False" def filterReadTags(intags): ''' @@ -49,7 +50,6 @@ def pairing(read): def processRead(read): global keepCount global filtCount - if(filterReadTags(read.tags) and read.reference_name == mtchr and pairing(read)): keepCount += 1 out.write(read) diff --git a/Pypkg/mgatk/mgatk/bin/python/sumstatsBP.py b/Pypkg/mgatk/mgatk/bin/python/sumstatsBP.py index 9607e8b..7aae78e 100755 --- a/Pypkg/mgatk/mgatk/bin/python/sumstatsBP.py +++ b/Pypkg/mgatk/mgatk/bin/python/sumstatsBP.py @@ -33,6 +33,7 @@ def writeSparseMatrix2(mid, vec1, vec2): V.write(str(i+1)+","+sample+","+str(vec1[i])+","+str(vec2[i])+"\n") n = int(maxBP) + # BAQ # initialize with a pseudo count to avoid dividing by zero countsA = [0.00000001] * n diff --git a/Pypkg/mgatk/mgatk/cli.py b/Pypkg/mgatk/mgatk/cli.py index dc1d4af..34bf12a 100644 --- a/Pypkg/mgatk/mgatk/cli.py +++ b/Pypkg/mgatk/mgatk/cli.py @@ -117,7 +117,6 @@ def main(mode, input, output, name, mito_genome, ncores, # Handle fasta requirements fastaf, mito_genome, mito_length = handle_fasta_inference(mito_genome, supported_genomes, script_dir, mode, of) - # Actually call the external script based on user input if(barcode_known): bc1py = script_dir + "/bin/python/bc1_known.py" @@ -196,6 +195,9 @@ def main(mode, input, output, name, mito_genome, ncores, sys.exit('ERROR: in `one` mode, the input should be an individual .bam file.') if not os.path.exists(input): sys.exist('ERROR: No file found called "' + input + '"; please specify a valid .bam file') + + # Define input samples + sampleregex = re.compile(r"^[^.]*") samples = [re.search(sampleregex, os.path.basename(input)).group(0)] samplebams = [input] @@ -239,10 +241,10 @@ def main(mode, input, output, name, mito_genome, ncores, #------------------- # Handle .fasta file #------------------- - if(mode == "call" and wasbcall == False): + if((mode == "call" and wasbcall == False) or mode == "one"): fastaf, mito_genome, mito_length = handle_fasta_inference(mito_genome, supported_genomes, script_dir, mode, of) click.echo(gettime() + "Found designated mitochondrial chromosome: %s" % mito_genome, logf) - + #---------------- # Determine cores #---------------- @@ -294,6 +296,7 @@ def main(mode, input, output, name, mito_genome, ncores, with open(y_s, 'w') as yaml_file: yaml.dump(dict1, yaml_file, default_flow_style=False, Dumper=yaml.RoundTripDumper) + # Call the python script oneSample_py = script_dir + "/bin/python/oneSample.py" pycall = " ".join(['python', oneSample_py, y_s, inputbam, outputbam, sample]) diff --git a/Pypkg/mgatk/setup.py b/Pypkg/mgatk/setup.py index 64caaa7..db3f2b6 100644 --- a/Pypkg/mgatk/setup.py +++ b/Pypkg/mgatk/setup.py @@ -7,7 +7,7 @@ setup( name='mgatk', - version='0.3.6', + version='0.3.7', url='https://github.com/aryeelab/mgatk', license='MIT', author='Caleb Lareau',