Skip to content

Commit

Permalink
update genome download and labels for sourmash
Browse files Browse the repository at this point in the history
  • Loading branch information
fmalmeida committed Jun 4, 2023
1 parent 88e0e06 commit 887f3a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
6 changes: 6 additions & 0 deletions modules/generic/ncbi_genome.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ process GET_NCBI_GENOME {
mv ncbi_dataset/data/*/*.fna . && \\
rm -rf ncbi_dataset *.md *.txt
done
# rename
for file in *.fna ; do
name=\$( echo \$file | cut -d '_' -f 1,2 ) ;
mv \$file \${name}.fna
done
"""
}
21 changes: 13 additions & 8 deletions modules/generic/sourmash_all.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ process SOURMASH_ALL {
# sketch input genomes
mkdir signatures ;
for genome in genomes/* ; do
export name=\$( echo \${genome} | cut -f 2 -d '/' | cut -f 1,2 -d '_' ) ;
sourmash \\
sketch dna \\
-p scaled=${scale},k=${kmer} \\
\${genome} \\
-o signatures/\${name}.sig ;
done
(
cd genomes && \\
for genome in * ; do
export name=\$( echo \${genome} | cut -f 2 -d '/' | cut -f 1,2 -d '_' ) ;
sourmash \\
sketch dna \\
-p scaled=${scale},k=${kmer} \\
\${genome} \\
-o ../signatures/\${name}.sig ;
done ;
)
# compare
sourmash \\
Expand All @@ -40,9 +43,11 @@ process SOURMASH_ALL {
-o sourmash_cmp
# plot
sourmash plot --labels sourmash_cmp
sourmash \\
plot \\
--pdf \\
--csv sourmash_plot.csv \\
--labels sourmash_cmp
"""
}

0 comments on commit 887f3a3

Please sign in to comment.