Skip to content

Instantly share code, notes, and snippets.

View mfoll's full-sized avatar

Matthieu Foll mfoll

View GitHub Profile
@mfoll
mfoll / seqlen.awk
Last active September 25, 2015 15:02 — forked from danielecook/fasta_sequence_lengths.sh
Generate Fasta sequence lengths
BEGIN {
OFS = "\t"; # tab-delimited output
}
# Use substr instead of regex to match a starting ">"
substr($0, 1, 1) == ">" {
if (seqlen) {
# Only print info for this sequence if no target was given
# or its id matches the target.
if (! target || id == target) {
print id, seqlen;