Skip to content

Commit

Permalink
fix trimming rules
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimens committed May 11, 2021
1 parent 0aeb22f commit a8f5e66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions rules/trim.smk
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ rule trim_summary:
input:
expand("5_Trim/ordered.{lg}.trimmed", lg = lg_range)
output:
"5_Trim/trim.summary"
detailed = "5_Trim/trim.details",
summary = "5_Trim/trim.summary"
message:
"Summarizing trim logs >> {output}"
priority: 1
shell:
"""
echo "# this is a summary of which markers were removed from which linkage group via trimming distant edge clusters" >> {output}
echo -e "LG\trm_marker" >> {output}
echo "# this is a summary of which markers were removed from which linkage group via trimming distant edge clusters" >> {output.detailed}
echo -e "LG\trm_marker" >> {output.detailed}
for each in 5_Trim/logs/ordered.*.removed ; do
BASE=$(basename $each | cut -d "." -f1,2)
sed -e "s/^/$BASE /" $each >> {output}.tmp
sed -e "s/^/$BASE /" $each >> {output.detailed}.tmp
done
sort -V {output}.tmp > {output} && rm {output}.tmp
sort -V {output.detailed}.tmp > {output.detailed} && rm {output.detailed}.tmp
echo "n_removed map" > {output.summary}.tmp
cut -d" " -f1 {output.detailed} | uniq -c >> {output.summary}.tmp
column -t {output.summary}.tmp > {output.summary} && rm {output.summary}.tmp
"""
4 changes: 2 additions & 2 deletions scripts/LepWrapQA.r
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ filename_trunc <- paste(filename_trunc[1], filename_trunc[2], sep = ".")
# instantiate QC columns
lgfile$Mpass <- c(TRUE)
lgfile$Fpass <- c(TRUE)
outfile_base <- paste(path, "4_OrderMarkers", "best.trim", filename_trunc, sep = "/")
outfile_log_base <- paste(path, "4_OrderMarkers", "logs/trimming", filename_trunc, sep = "/")
outfile_base <- paste(path, "5_Trim", filename_trunc, sep = "/")
outfile_log_base <- paste(path, "5_Trim", "logs", filename_trunc, sep = "/")

#========= PDF instantiation ========#
PDFPath <- paste(outfile_log_base, "trim.pdf", sep = ".")
Expand Down

0 comments on commit a8f5e66

Please sign in to comment.