diff --git a/GenomonSV b/GenomonSV index 3b9fc30..4a30c99 100755 --- a/GenomonSV +++ b/GenomonSV @@ -7,7 +7,7 @@ import argparse # top level parser parser = argparse.ArgumentParser(prog = "GenomonSV", formatter_class=argparse.ArgumentDefaultsHelpFormatter) -parser.add_argument("--version", action = "version", version = "GenomonSV-0.4.1") +parser.add_argument("--version", action = "version", version = "GenomonSV-0.4.2rc") subparsers = parser.add_subparsers() diff --git a/lib/genomonsv/realignmentFunction.py b/lib/genomonsv/realignmentFunction.py index 3848f18..a23043b 100644 --- a/lib/genomonsv/realignmentFunction.py +++ b/lib/genomonsv/realignmentFunction.py @@ -213,6 +213,8 @@ def getRefAltForSV(outputFilePath, juncChr1, juncPos1, juncDir1, juncChr2, juncP for item in pysam.faidx(reference_genome, juncChr1 + ":" + str(int(juncPos1) - validate_sequence_length) + "-" + str(int(juncPos2) + validate_sequence_length)): if item[0] == ">": continue seq = seq + item.rstrip('\n').upper() + seq = seq.replace('>', '') + seq = seq.replace(juncChr1 + ":" + str(int(juncPos1) - validate_sequence_length) + "-" + str(int(juncPos2) + validate_sequence_length), '') print >> hOUT, '>' + ','.join([juncChr1, str(juncPos1), juncDir1, juncChr2, str(juncPos2), juncDir2]) + "_ref" print >> hOUT, seq @@ -224,12 +226,16 @@ def getRefAltForSV(outputFilePath, juncChr1, juncPos1, juncDir1, juncChr2, juncP for item in pysam.faidx(reference_genome, juncChr1 + ":" + str(int(juncPos1) - validate_sequence_length) + "-" + str(juncPos1)): if item[0] == ">": continue seq = seq + item.rstrip('\n').upper() + seq = seq.replace('>', '') + seq = seq.replace(juncChr1 + ":" + str(int(juncPos1) - validate_sequence_length) + "-" + str(juncPos1), '') seq = seq + juncSeq for item in pysam.faidx(reference_genome, juncChr2 + ":" + str(juncPos2) + "-" + str(int(juncPos2) + validate_sequence_length)): if item[0] == ">": continue seq = seq + item.rstrip('\n').upper() + seq = seq.replace('>', '') + seq = seq.replace(juncChr2 + ":" + str(juncPos2) + "-" + str(int(juncPos2) + validate_sequence_length), '') print >> hOUT, '>' + ','.join([juncChr1, str(juncPos1), juncDir1, juncChr2, str(juncPos2), juncDir2]) + "_alt" print >> hOUT, seq @@ -240,12 +246,16 @@ def getRefAltForSV(outputFilePath, juncChr1, juncPos1, juncDir1, juncChr2, juncP for item in pysam.faidx(reference_genome, juncChr2 + ":" + str(int(juncPos2) - validate_sequence_length) + "-" + str(juncPos2)): if item[0] == ">": continue seq = seq + item.rstrip('\n').upper() + seq = seq.replace('>', '') + seq = seq.replace(juncChr2 + ":" + str(int(juncPos2) - validate_sequence_length) + "-" + str(juncPos2), '') seq = seq + juncSeq for item in pysam.faidx(reference_genome, juncChr1 + ":" + str(juncPos1) + "-" + str(int(juncPos1) + validate_sequence_length)): if item[0] == ">": continue seq = seq + item.rstrip('\n').upper() + seq = seq.replace('>', '') + seq = seq.replace(juncChr1 + ":" + str(juncPos1) + "-" + str(int(juncPos1) + validate_sequence_length), '') print >> hOUT, '>' + ','.join([juncChr1, str(juncPos1), juncDir1, juncChr2, str(juncPos2), juncDir2]) + "_alt" print >> hOUT, seq @@ -257,6 +267,8 @@ def getRefAltForSV(outputFilePath, juncChr1, juncPos1, juncDir1, juncChr2, juncP for item in pysam.faidx(reference_genome, juncChr1 + ":" + str(int(juncPos1) - validate_sequence_length) + "-" + str(int(juncPos1) + validate_sequence_length)): if item[0] == ">": continue seq = seq + item.rstrip('\n').upper() + seq = seq.replace('>', '') + seq = seq.replace(juncChr1 + ":" + str(int(juncPos1) - validate_sequence_length) + "-" + str(int(juncPos1) + validate_sequence_length), '') print >> hOUT, '>' + ','.join([juncChr1, str(juncPos1), juncDir1, juncChr2, str(juncPos2), juncDir2]) + "_ref1" print >> hOUT, seq @@ -265,7 +277,9 @@ def getRefAltForSV(outputFilePath, juncChr1, juncPos1, juncDir1, juncChr2, juncP for item in pysam.faidx(reference_genome, juncChr2 + ":" + str(int(juncPos2) - validate_sequence_length) + "-" + str(int(juncPos2) + validate_sequence_length)): if item[0] == ">": continue seq = seq + item.rstrip('\n').upper() - + seq = seq.replace('>', '') + seq = seq.replace(juncChr2 + ":" + str(int(juncPos2) - validate_sequence_length) + "-" + str(int(juncPos2) + validate_sequence_length), '') + print >> hOUT, '>' + ','.join([juncChr1, str(juncPos1), juncDir1, juncChr2, str(juncPos2), juncDir2]) + "_ref2" print >> hOUT, seq @@ -276,11 +290,16 @@ def getRefAltForSV(outputFilePath, juncChr1, juncPos1, juncDir1, juncChr2, juncP for item in pysam.faidx(reference_genome, juncChr1 + ":" + str(int(juncPos1) - validate_sequence_length) + "-" + str(juncPos1)): if item[0] == ">": continue tseq = tseq + item.rstrip('\n').upper() + tseq = tseq.replace('>', '') + tseq = tseq.replace(juncChr1 + ":" + str(int(juncPos1) - validate_sequence_length) + "-" + str(juncPos1), '') else: tseq = "" for item in pysam.faidx(reference_genome, juncChr1 + ":" + str(juncPos1) + "-" + str(int(juncPos1) + validate_sequence_length)): if item[0] == ">": continue tseq = tseq + item.rstrip('\n').upper() + tseq = tseq.replace('>', '') + tseq = tseq.replace(juncChr1 + ":" + str(juncPos1) + "-" + str(int(juncPos1) + validate_sequence_length), '') + tseq = utils.reverseComplement(tseq) seq = tseq + juncSeq @@ -290,11 +309,17 @@ def getRefAltForSV(outputFilePath, juncChr1, juncPos1, juncDir1, juncChr2, juncP for item in pysam.faidx(reference_genome, juncChr2 + ":" + str(juncPos2) + "-" + str(int(juncPos2) + validate_sequence_length)): if item[0] == ">": continue tseq = tseq + item.rstrip('\n').upper() + tseq = tseq.replace('>', '') + tseq = tseq.replace(juncChr2 + ":" + str(juncPos2) + "-" + str(int(juncPos2) + validate_sequence_length), '') + else: tseq = "" for item in pysam.faidx(reference_genome, juncChr2 + ":" + str(int(juncPos2) - validate_sequence_length) + "-" + str(juncPos2)): if item[0] == ">": continue tseq = tseq + item.rstrip('\n').upper() + tseq = tseq.replace('>', '') + tseq = tseq.replace(juncChr2 + ":" + str(int(juncPos2) - validate_sequence_length) + "-" + str(juncPos2), '') + tseq = utils.reverseComplement(tseq) seq = seq + tseq diff --git a/setup.py b/setup.py index e072ee4..ac2d9d9 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='genomonsv', - version='0.4.1', + version='0.4.2rc', description='Python tools for detecting somatic structural variation from cancer genome sequencing data.', author='Yuichi Shiraishi', author_email='friend1ws@gamil.com',