Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion R/fuzznuc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ echo "BED file created: ${output_base}.bed"

# Generate sequence name and length table
echo "Generating sequence name and length table..."
awk 'BEGIN {OFS="\t"} /^>/ {if (seq) print id, length(seq); id=substr($1, 2); seq=""} !/^>/ {seq = seq $0} END {if (seq) print id, length(seq)}' "$genome" > "${output_base}_length.tsv"
awk 'BEGIN {OFS="\t"}
/^>/ { if (len) print id, len; id=substr($1, 2); len=0 }
!/^>/ { len += length($0) }
END { if (len) print id, len }' "$genome" > "${output_base}_length.tsv"
echo "Sequence name and length table created: ${output_base}_length.tsv"

# Clean up intermediate files
Expand Down