Skip to content

Commit

Permalink
Remove star sequence concatenation from mature fasta file
Browse files Browse the repository at this point in the history
  • Loading branch information
skchronicles committed Sep 27, 2024
1 parent 3283295 commit d5476d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
4 changes: 2 additions & 2 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ rule all:
# @imported from `rule mirdeep2_novel_p1_run` in rules/novel.smk
# This rule is only run if `identify_novel_mirs` is set to True.
provided(
[join(workpath, "novel", "pass1", "cohort_novel_mature_miRNA.tsv")],
[join(workpath, "novel", "pass1", "cohort_novel_mature_miRNA.fa")],
identify_novel_mirs
),
provided(
[join(workpath, "novel", "pass1", "cohort_novel_hairpin_miRNA.tsv")],
[join(workpath, "novel", "pass1", "cohort_novel_hairpin_miRNA.fa")],
identify_novel_mirs
),
# Second-pass rules for novel miR quantification,
Expand Down
24 changes: 8 additions & 16 deletions workflow/rules/novel.smk
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ rule mirdeep2_novel_p1_run:
arf = join(workpath, "novel", "mapper", "cohort_mapped.arf"),
collapsed = join(workpath, "novel", "mapper", "cohort_collapsed.fa"),
output:
mature = join(workpath, "novel", "pass1", "cohort_novel_mature_miRNA.tsv"),
hairpin = join(workpath, "novel", "pass1", "cohort_novel_hairpin_miRNA.tsv"),
mature = join(workpath, "novel", "pass1", "cohort_novel_mature_miRNA.fa"),
hairpin = join(workpath, "novel", "pass1", "cohort_novel_hairpin_miRNA.fa"),
log:
report = join(workpath, "novel", "pass1", "mirdeep2.log")
params:
Expand Down Expand Up @@ -211,18 +211,10 @@ rule mirdeep2_novel_p1_run:
-print \\
-quit
)
star=$(
find "${{tmp}}/" \\
-type f \\
-iname "novel_star_*.fa" \\
-print \\
-quit
)
# Rename the identifier to contain the
# suffix _star to indicate if its a star
# sequence before merging the two files
sed -i '/^>.*/s/$/_star/' "${{star}}"
cat "${{mature}}" "${{star}}" > {output.mature}
# Create a symbolic link to the novel
# mature sequences for quantification
ln -sf "${{mature}}" {output.mature}
# Create a symbolic link to the novel
# hairpin sequences for quantification
Expand Down Expand Up @@ -257,8 +249,8 @@ rule mirdeep2_novel_p2_quantifier:
input:
arf = join(workpath, "mirdeep2", "mapper", "{sample}_mapped.arf"),
collapsed = join(workpath, "mirdeep2", "mapper", "{sample}_collapsed.fa"),
mature = join(workpath, "novel", "pass1", "cohort_novel_mature_miRNA.tsv"),
hairpin = join(workpath, "novel", "pass1", "cohort_novel_hairpin_miRNA.tsv"),
mature = join(workpath, "novel", "pass1", "cohort_novel_mature_miRNA.fa"),
hairpin = join(workpath, "novel", "pass1", "cohort_novel_hairpin_miRNA.fa"),
output:
mirna = join(workpath, "novel", "counts", "{sample}_novel_miRNA_expressed.tsv"),
params:
Expand Down

0 comments on commit d5476d9

Please sign in to comment.