Skip to content

Commit

Permalink
Remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
seppinho committed Mar 2, 2024
1 parent 5a2d95f commit c69ef5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions modules/local/filter_variants.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ process FILTER_VARIANTS {
if [[ ${method} == "mutserve_fusion" ]]
then
bcftools query \
-f '${vcf_name}.bam\t%FILTER\t%POS\t%REF\t%ALT\t[%AF\t%DP\t%GT]\n' \
${vcf_file} >> ${vcf_file.baseName}.${method}.txt
awk -F'\t' 'NR == 1 || (length(\$4) == 1 && length(\$5) == 1)' \
${vcf_file.baseName}.${method}.txt > ${vcf_file.baseName}.${method}.filtered.tmp.txt
Expand All @@ -35,7 +31,8 @@ process FILTER_VARIANTS {
else
mv ${vcf_file.baseName}.${method}.txt ${vcf_file.baseName}.${method}.filtered.tmp.txt
fi
## annotating SNVS and INDELs for reporting
awk 'BEGIN {OFS="\t"} {
if (NR == 1) { print \$0, "Type"; next }
if ((length(\$4) > 1 || length(\$5) > 1) && length(\$4) != length(\$5)) { \$9="3" }
Expand Down
2 changes: 1 addition & 1 deletion modules/local/merging_variants.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process MERGING_VARIANTS {
csvtk sort \
-t variants.concat.txt \
-k ID:N -k Pos:n -k Type:r \
-k ID:N -k Pos:n -k Type:nr \
-T -o variants.sorted.txt
if [[ ${mode} == "fusion" ]]
Expand Down

0 comments on commit c69ef5f

Please sign in to comment.