Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify on pos2, add compatibility to indel recs #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions mergesvvcf/mergedfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,12 @@ def passed_variant(record):
formats = []
for hformat in vcf_reader.header.formats.itervalues():
num = None
if hformat.name == "GT" or hformat.number == "G":
num = "G"
continue # Genotype is special cant do multiple
# if hformat.name == "GT" or hformat.number == "G":
# num = "G"
# continue # Genotype is special cant do multiple
if hformat.name == "PL": num = "G"
if hformat.number == "G": num = "G"
if hformat.name == "GL": num = "3"
outvcf.header.formats.add(
"{}_{}".format(program, hformat.name),
num or hformat.number,
Expand Down
6 changes: 4 additions & 2 deletions mergesvvcf/vcftobreakpoints.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ def breakpointsFromRecord(record):
# defaults
if chr2 is None:
chr2 = chr1
if pos2 is None and "<" in altstr:
if pos2 is None and "<" in altstr and ">" in altstr:
pos2 = record.stop
elif pos2 is None and re.match(r'^[ATCG]+$', altstr.strip(".")):
pos2 = record.pos + len(altstr.strip("."))

# look for symbolic SVTYPE information in the alt field (eg, <DEL>)
resultSym = re.match(__symbolicRE__, altstr)
Expand Down Expand Up @@ -189,7 +191,7 @@ def breakpointsFromRecord(record):

reflen = len(ref)
if pos2 is None:
pos2 = pos1 + reflen
pos2 = pos1 + len(altstr.strip("."))
if svlen is None:
svlen = len(altstr) - reflen
if svtype is None:
Expand Down