Skip to content
Snippets Groups Projects
Commit 7a5e1b5c authored by Sander van der Zeeuw's avatar Sander van der Zeeuw
Browse files

added fix mpileup.py scripts to scripts dir in shiva

parent 328be9a6
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
from __future__ import print_function
__author__="Wai Yi Leung"
import sys
if __name__ == "__main__":
"""
Fix the mpileupformat for RNA mpileup
Solution offered by Irina Pulyakhina (LUMC-HG)
http://www.biostars.org/p/78542/
"""
for line in sys.stdin:
l = line.strip().split("\t")
if l[3] == "0":
# no alignment to this position
print("\t".join(map(str, l)))
continue
fix_col = l[4].replace('<', '').replace('>', '')
new_size = len(fix_col)
old_size = len(l[4])
if new_size != old_size:
l[4] = fix_col
l[3] = "{}".format(new_size)
if new_size == 0:
l[5] = ""
print("\t".join(map(str, l)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment