You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vcf_pysam_allele_pileup.py
+6-5
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
#!/usr/bin/env python
2
+
importgzip
2
3
fromVcfFileimport*
3
4
fromVcfMetaLinesimportFormatLine
4
5
fromoptparseimportOptionParser
@@ -8,11 +9,11 @@
8
9
9
10
defmain():
10
11
11
-
""" given a VCF file and bam file containing the sample(s) in the VCF this willl print out
12
-
a pileup count of the ref and alt allele that is in the VCF file """
12
+
""" given a VCF file and bam file containing the sample(s) in the VCF this will add INFO and FORMAT tags
13
+
to indicate the count of reference and alt alleles observed in total and per-sample and print out a new VCF"""
13
14
14
15
15
-
usage="usage: %prog [option] file.vcf"
16
+
usage="usage: %prog [option] file.vcf.gz"
16
17
parser=OptionParser(usage)
17
18
parser.add_option("--bam", type="string", dest="bam", default=None, help="bam file to perform pileup on")
18
19
parser.add_option("--mapq", type="float", dest="mapq", default=0., help="Exclude alignments from analysis if they have a mapping less than mapq (default is 0)")
@@ -24,7 +25,7 @@ def main():
24
25
sys.exit(1)
25
26
26
27
vcfilename=args[0]
27
-
basename=os.path.splitext(vcfilename)[0]
28
+
28
29
bamfilename=options.bam
29
30
30
31
ra_formatline=FormatLine("RA", number='1', type='Integer', description='number of reference alleles observed')
0 commit comments