Skip to content

Commit

Permalink
simplify assembly ftp parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Apr 8, 2020
1 parent d2a4606 commit df282ab
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,11 @@ if( (params.sqlite || ( params.ncbimeta_update && params.ncbimeta_annot) ) && !p
// Shell script to execute
script:
"""
sqlite3 ${sqlite} ${params.sqlite_select_command} | grep . | head -n ${params.max_datasets} | sed 's/ /\\n/g' | while read line;
sqlite3 ${sqlite} ${params.sqlite_select_command} | grep . | head -n ${params.max_datasets} | sed -E -e 's/ |;/\\n/g' | while read line;
do
if [[ ! -z \$line ]]; then
asm_url=\$line;
asm_fasta=`echo \$line | \
awk -F "/" '{print \$NF}' | \
awk -v suffix=${params.genbank_assembly_gz_suffix} '{print \$0 suffix}'`;
asm_ftp=\${asm_url}/\${asm_fasta};
asm_ftp=`echo \$line | \
awk -F "/" -v suffix=${params.genbank_assembly_gz_suffix} '{print \$0 FS \$NF suffix}'`;
echo \$asm_ftp >> ${params.file_assembly_for_download_ftp}
fi;
done;
Expand Down

0 comments on commit df282ab

Please sign in to comment.