forked from ballesterus/Utensils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseqlike.awk
More file actions
executable file
·31 lines (27 loc) · 853 Bytes
/
seqlike.awk
File metadata and controls
executable file
·31 lines (27 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/awk -f
##############################################################
# Simple awk script to search fasta records #
# #
# Returns the FASTA records whose seq. id. matches a regex #
# Usage: #
# seqlike.awk s=<regex> <file.fasta> #
# #
# Author:J.A. Ballesteros #
# Date:July 2020 #
# GPL vers. 3 #
##############################################################
BEGIN{
FS="\n";
RS=">";
OFS="";
m=0;
}
{
if ($1 ~ s){
print ">" $0;
++m
}
}
END{
print "Matches found: ", m
}