Skip to content

Commit ee35794

Browse files
committed
updated paths and reformatting for the test dataset of glosed
1 parent 8edf453 commit ee35794

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

bin/taxref_reformat_glosed.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@
1010

1111
set -eu
1212

13+
stream_seq() {
14+
case "$1" in
15+
*.zip) unzip -p "$1" ;;
16+
*) gzip -dc "$1" ;;
17+
esac
18+
}
19+
1320
SEQ_GZ="${1:-GloSED__OTU_sequences.fasta.gz}"
1421
TAX_ZIP="${2:-GloSED__Taxonomy.tsv.zip}"
1522

23+
if [ -z "${1:-}" ] && [ -z "${2:-}" ] && [ ! -f "$SEQ_GZ" ] && [ ! -f "$TAX_ZIP" ] && [ -f "GloSED__OTU_sequences_first1k.fasta.zip" ] && [ -f "GloSED_Taxonomy_first1k.tsv.zip" ]; then
24+
SEQ_GZ="GloSED__OTU_sequences_first1k.fasta.zip"
25+
TAX_ZIP="GloSED_Taxonomy_first1k.tsv.zip"
26+
fi
27+
1628
[ -f "$SEQ_GZ" ] || { echo "ERROR: missing $SEQ_GZ" >&2; exit 1; }
1729
[ -f "$TAX_ZIP" ] || { echo "ERROR: missing $TAX_ZIP" >&2; exit 1; }
1830

@@ -69,12 +81,12 @@ NR==1 {
6981
}
7082
' "$TAX_TSV" > "$META_TSV"
7183

72-
gzip -dc "$SEQ_GZ" | awk -F '\t' 'NR==FNR { tax[$1] = $2; next }
84+
stream_seq "$SEQ_GZ" | awk -F '\t' 'NR==FNR { tax[$1] = $2; next }
7385
/^>/ { id = substr($0,2); if (id in tax && tax[id] != "") print ">" tax[id]; else print ">" id; next }
7486
{ print }
7587
' "$META_TSV" - > assignTaxonomy.fna
7688

77-
gzip -dc "$SEQ_GZ" | awk -F '\t' 'NR==FNR { if ($3 != "." && $3 != "" && $3 != "NA" && $4 != "." && $4 != "" && $4 != "NA") addsp[$1] = $3 " " $4; next }
89+
stream_seq "$SEQ_GZ" | awk -F '\t' 'NR==FNR { if ($3 != "." && $3 != "" && $3 != "NA" && $4 != "." && $4 != "" && $4 != "NA") addsp[$1] = $3 " " $4; next }
7890
/^>/ { id = substr($0,2); keep = (id in addsp); if (keep) print ">" id " " addsp[id]; next }
7991
{ if (keep) print }
8092
' "$META_TSV" - > addSpecies.fna

conf/test_glosed.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ params {
2424
dada_ref_databases.glosed = [
2525
title:"GloSED - Global standardised Soil Eukaryome Dataset",
2626
file:[
27-
"https://raw.githubusercontent.com/nf-core/test-datasets/ampliseq/GloSED__OTU_sequences_first1k.fasta.zip",
28-
"https://raw.githubusercontent.com/nf-core/test-datasets/ampliseq/GloSED_Taxonomy_first1k.tsv.zip"
27+
"https://raw.githubusercontent.com/nf-core/test-datasets/ampliseq/testdata/GloSED__OTU_sequences_first1k.fasta.zip",
28+
"https://raw.githubusercontent.com/nf-core/test-datasets/amplsieq/testdata/GloSED_Taxonomy_first1k.tsv.zip"
2929
],
3030
citation:"Sundh J, Larsson E, Nilsson RH, et al. GloSED fungal ITS database. Zenodo. https://zenodo.org/records/17827890",
3131
fmtscript:"taxref_reformat_glosed.sh",

0 commit comments

Comments
 (0)