Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PengNi committed May 16, 2022
1 parent 980a14e commit 3aa386f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ccsmeth/call_modifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ def main():
help="path to genome reference to be aligned, in fasta/fa format.")
p_extract_ref.add_argument("--mapq", type=int, default=10, required=False,
help="MAPping Quality cutoff for selecting alignment items, default 10")
p_extract_ref.add_argument("--identity", type=float, default=0.8, required=False,
help="identity cutoff for selecting alignment items, default 0.8")
p_extract_ref.add_argument("--identity", type=float, default=0.75, required=False,
help="identity cutoff for selecting alignment items, default 0.75")
p_extract_ref.add_argument("--no_supplementary", action="store_true", default=False, required=False,
help="not use supplementary alignment")
p_extract_ref.add_argument("--is_mapfea", type=str, default="no", required=False,
Expand Down
4 changes: 2 additions & 2 deletions ccsmeth/call_mods_freq_bam.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ def main():
help="haplotype tag, default HP")
scfb_callfreq.add_argument("--mapq", type=int, default=10, required=False,
help="MAPping Quality cutoff for selecting alignment items, default 10")
scfb_callfreq.add_argument("--identity", type=float, default=0.8, required=False,
help="identity cutoff for selecting alignment items, default 0.8")
scfb_callfreq.add_argument("--identity", type=float, default=0.75, required=False,
help="identity cutoff for selecting alignment items, default 0.75")
scfb_callfreq.add_argument("--no_supplementary", action="store_true", default=False, required=False,
help="not use supplementary alignment")
scfb_callfreq.add_argument("--motifs", action="store", type=str,
Expand Down
2 changes: 1 addition & 1 deletion ccsmeth/call_mods_freq_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, fields):
self._prob_0 = float(fields[6])
self._prob_1 = float(fields[7])
self._called_label = int(fields[8])
self._kmer = fields[9]
self._kmer = fields[9] if len(fields) > 9 else "-"

def is_record_callable(self, prob_threshold):
if abs(self._prob_0 - self._prob_1) < prob_threshold:
Expand Down
12 changes: 6 additions & 6 deletions ccsmeth/ccsmeth.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ def main():
help="path to genome reference to be aligned, in fasta/fa format.")
scm_extract_ref.add_argument("--mapq", type=int, default=10, required=False,
help="MAPping Quality cutoff for selecting alignment items, default 10")
scm_extract_ref.add_argument("--identity", type=float, default=0.8, required=False,
help="identity cutoff for selecting alignment items, default 0.8")
scm_extract_ref.add_argument("--identity", type=float, default=0.75, required=False,
help="identity cutoff for selecting alignment items, default 0.75")
scm_extract_ref.add_argument("--no_supplementary", action="store_true", default=False, required=False,
help="not use supplementary alignment")
scm_extract_ref.add_argument("--is_mapfea", type=str, default="no", required=False,
Expand Down Expand Up @@ -360,8 +360,8 @@ def main():
help="path to genome reference to be aligned, in fasta/fa format.")
se_extract_ref.add_argument("--mapq", type=int, default=10, required=False,
help="MAPping Quality cutoff for selecting alignment items, default 10")
se_extract_ref.add_argument("--identity", type=float, default=0.8, required=False,
help="identity cutoff for selecting alignment items, default 0.8")
se_extract_ref.add_argument("--identity", type=float, default=0.75, required=False,
help="identity cutoff for selecting alignment items, default 0.75")
se_extract_ref.add_argument("--no_supplementary", action="store_true", default=False, required=False,
help="not use supplementary alignment")
se_extract_ref.add_argument("--is_mapfea", type=str, default="no", required=False,
Expand Down Expand Up @@ -467,8 +467,8 @@ def main():
help="haplotype tag, default HP")
scfb_callfreq.add_argument("--mapq", type=int, default=10, required=False,
help="MAPping Quality cutoff for selecting alignment items, default 10")
scfb_callfreq.add_argument("--identity", type=float, default=0.8, required=False,
help="identity cutoff for selecting alignment items, default 0.8")
scfb_callfreq.add_argument("--identity", type=float, default=0.75, required=False,
help="identity cutoff for selecting alignment items, default 0.75")
scfb_callfreq.add_argument("--no_supplementary", action="store_true", default=False, required=False,
help="not use supplementary alignment")
scfb_callfreq.add_argument("--motifs", action="store", type=str,
Expand Down
4 changes: 2 additions & 2 deletions ccsmeth/extract_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,8 @@ def main():
help="path to genome reference to be aligned, in fasta/fa format.")
p_extract_ref.add_argument("--mapq", type=int, default=10, required=False,
help="MAPping Quality cutoff for selecting alignment items, default 10")
p_extract_ref.add_argument("--identity", type=float, default=0.8, required=False,
help="identity cutoff for selecting alignment items, default 0.8")
p_extract_ref.add_argument("--identity", type=float, default=0.75, required=False,
help="identity cutoff for selecting alignment items, default 0.75")
p_extract_ref.add_argument("--no_supplementary", action="store_true", default=False, required=False,
help="not use supplementary alignment")
p_extract_ref.add_argument("--is_mapfea", type=str, default="no", required=False,
Expand Down
10 changes: 6 additions & 4 deletions scripts/call_mods_freq_bam.per_readsite.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ def _readmods_to_bed_of_one_region(bam_reader, regioninfo, dnacontigs, motifs_fi
for refpositem in refposinfo[refpos]:
mprob, hap, read_name = refpositem
label = 1 if mprob > 0.5 else 0
perreadsite_res.append((ref_name, refpos, "+", read_name, "-1", "1,1", 1-mprob, mprob, label))
perreadsite_res.append((ref_name, refpos, "+", read_name, "-1", "1,1",
1 - mprob, mprob, label, "-"))
if not (args.motifs == "CG" and not args.no_comb):
for refpos in refposinfo_rev:
if motifs_filter is not None:
Expand All @@ -344,7 +345,8 @@ def _readmods_to_bed_of_one_region(bam_reader, regioninfo, dnacontigs, motifs_fi
for refpositem in refposinfo_rev[refpos]:
mprob, hap, read_name = refpositem
label = 1 if mprob > 0.5 else 0
perreadsite_res.append((ref_name, refpos, "-", read_name, "-1", "1,1", 1-mprob, mprob, label))
perreadsite_res.append((ref_name, refpos, "-", read_name, "-1", "1,1",
1 - mprob, mprob, label, "-"))
return perreadsite_res


Expand Down Expand Up @@ -482,8 +484,8 @@ def main():
help="haplotype tag, default HP")
scfb_callfreq.add_argument("--mapq", type=int, default=10, required=False,
help="MAPping Quality cutoff for selecting alignment items, default 10")
scfb_callfreq.add_argument("--identity", type=float, default=0.8, required=False,
help="identity cutoff for selecting alignment items, default 0.8")
scfb_callfreq.add_argument("--identity", type=float, default=0.75, required=False,
help="identity cutoff for selecting alignment items, default 0.75")
scfb_callfreq.add_argument("--no_supplementary", action="store_true", default=False, required=False,
help="not use supplementary alignment")
scfb_callfreq.add_argument("--motifs", action="store", type=str,
Expand Down

0 comments on commit 3aa386f

Please sign in to comment.