Skip to content

Commit 6bac7ea

Browse files
committed
Improved docstrings.
1 parent 118d028 commit 6bac7ea

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

BAM_to_TCS.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121

2222
def TCSwriter(bamfile_name, fasta_d, minqual, mincov):
23-
"""Convert the bamfile into the TCS format. The writing and the parsing
24-
are done simultaneously."""
23+
"""
24+
Convert the bamfile into the TCS format. SNP filtering is done here.
25+
The TCS writing and BAM parsing are done simultaneously.
26+
"""
2527

2628
# Set TCS file 'settings'
2729
tcsfile_name = bamfile_name[:bamfile_name.rindex(".")] + "_out.short.tcs"
@@ -146,8 +148,10 @@ def TCSwriter(bamfile_name, fasta_d, minqual, mincov):
146148

147149

148150
def covs_and_quals(bases):
149-
"""Take the "bases" dict and returns two lists - one with the
150-
coverage and one with the average quals of each base (in order)."""
151+
"""
152+
Take the "bases" dict and returns two lists - one with the
153+
coverage and one with the average quals of each base (in order).
154+
"""
151155
ordered = ["A", "C", "G", "T", "*"]
152156
covs = []
153157
quals = []
@@ -162,9 +166,11 @@ def covs_and_quals(bases):
162166

163167

164168
def QualityCalc(quals):
165-
"""Calculate and return individual bases qualities, just like mira does,
169+
"""
170+
Calculate and return individual bases qualities, just like mira does,
166171
as seen here:
167-
http://www.freelists.org/post/mira_talk/Quality-Values,4 ."""
172+
http://www.freelists.org/post/mira_talk/Quality-Values,4 .
173+
"""
168174
quals.sort()
169175
min1 = quals[0]
170176
if min1 > 0:
@@ -189,7 +195,9 @@ def QualityCalc(quals):
189195

190196

191197
def RunModule(bamfile_name, padded_fasta_name, minqual, mincov):
192-
"""Run the module."""
198+
"""
199+
Run the module.
200+
"""
193201
TCSwriter(bamfile_name, FASTA_parser(padded_fasta_name), minqual, mincov)
194202

195203
if __name__ == "__main__":

0 commit comments

Comments
 (0)