Skip to content

Commit

Permalink
Merge pull request #5 from treangenlab/main_orphan
Browse files Browse the repository at this point in the history
Main orphan
  • Loading branch information
Fu-Yilei committed May 16, 2023
2 parents f9588ba + 4f84b71 commit 70cff08
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions meth_phaser_post_processing
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,17 @@ def get_altered_vcf(original_vcf, output_vcf, block_relationship_dfs):
if "1|0" in rec:
if "PS" in rec.split("\t")[-2]:
split_rec = rec.split("\t")
start_loc = split_rec[-1].split(":")[-3]
ps_tag_location = split_rec[-2].split(":").index("PS")
start_loc = split_rec[-1].split(":")[ps_tag_location]
# print(split_rec, start_loc)
split_rec[-1] = split_rec[-1].replace(start_loc, get_altered_block_start_loc(current_chrom_final_block, int(start_loc))) # type: ignore
rec = "\t".join(split_rec)
altered_vcf_file.writelines(rec.replace("1|0", "0|1"))
elif "0|1" in rec:
if "PS" in rec.split("\t")[-2]:
split_rec = rec.split("\t")
start_loc = split_rec[-1].split(":")[-3]
ps_tag_location = split_rec[-2].split(":").index("PS")
start_loc = split_rec[-1].split(":")[ps_tag_location]
# print(split_rec, start_loc)
split_rec[-1] = split_rec[-1].replace(start_loc, get_altered_block_start_loc(current_chrom_final_block, int(start_loc))) # type: ignore
rec = "\t".join(split_rec)
Expand Down

0 comments on commit 70cff08

Please sign in to comment.