Skip to content

Commit

Permalink
fix PS tag output issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Fu-Yilei committed May 18, 2023
1 parent 4f84b71 commit 4369947
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Empty file modified meth_phaser_parallel
100755 → 100644
Empty file.
8 changes: 6 additions & 2 deletions meth_phaser_post_processing
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ def get_altered_vcf(original_vcf, output_vcf, block_relationship_dfs):
# 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"))
rec = f"{rec}\n"
print(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")
Expand All @@ -315,7 +317,9 @@ def get_altered_vcf(original_vcf, output_vcf, block_relationship_dfs):
# 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("0|1", "1|0"))
rec = f"{rec}\n"
print(rec)
altered_vcf_file.writelines(rec.replace("0|1", "1|0"))
else:
altered_vcf_file.writelines(rec)
flpl = [x[0] for x in flipping_list]
Expand Down
Empty file modified methphasing
100755 → 100644
Empty file.

0 comments on commit 4369947

Please sign in to comment.