Skip to content

Commit

Permalink
fixed fastani bug
Browse files Browse the repository at this point in the history
  • Loading branch information
erinyoung committed Mar 2, 2023
1 parent 0e9bb28 commit fb13895
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/fastani.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ process fastani {
cat fastani/!{sample}.txt | sed 's/,//g' | sed 's/!{genomes}\\///g' | tr "\\t" "," | awk -v sample=!{sample} '{ print sample "," $0 }' >> fastani/!{sample}_fastani.csv
top_hit=$(head -n 2 fastani/!{sample}_fastani.csv | tail -n 1 | cut -f 3 -d , )
if [ -f "$top_hit" ]; then mkdir -p top_hit ; cp $top_hit top_hit/. ; fi
if [ -f "!{genomes}/$top_hit" ]; then mkdir -p top_hit ; cp !{genomes}/$top_hit top_hit/. ; fi
'''
}
4 changes: 2 additions & 2 deletions subworkflows/phylogenetic_analysis.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ workflow phylogenetic_analysis {
for_prokka = Channel.empty()
if (params.extras) {
ch_top_hit
.map { it -> tuple( it[0] , [ it[1].split("/")[1].split("_")[0], it[1].split("/")[1].split("_")[1]] )}
.map { it -> tuple( it[0] , [ it[1].split("_")[0], it[1].split("_")[1]] )}
.set { ch_organism }

if ( params.fastani_include ) {
ch_top_hit
.map { it -> tuple( it[1].split("/")[1].split("_", 3)[2].replaceAll(~/.fna/,""), it[2], it[1].split("/")[1].split("_")[0, 1]) }
.map { it -> tuple( it[1].split("_", 3)[2].replaceAll(~/.fna/,""), it[2], it[1].split("_")[0, 1]) }
.groupTuple(by: 0)
.map { it -> tuple( it[0], it[1][0], it[2][0] ) }
.unique()
Expand Down

0 comments on commit fb13895

Please sign in to comment.