Skip to content

Instantly share code, notes, and snippets.

@poeli
Created June 10, 2020 05:27
Show Gist options
  • Save poeli/d54e66d39aa9b8c6a77628b1e6705277 to your computer and use it in GitHub Desktop.
Save poeli/d54e66d39aa9b8c6a77628b1e6705277 to your computer and use it in GitHub Desktop.
remove sequences from FASTA in pattern file
#!/usr/bin/bash
awk '{ if ((NR>1)&&($0~/^>/)) { printf("\n%s", $0); } else if (NR==1) { printf("%s", $0); } else { printf("\t%s", $0); } }' \
| grep -vwf $1 - \
| tr "\t" "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment