Advertisement
Guest User

Untitled

a guest
Sep 16th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.38 KB | None | 0 0
  1. BEGIN {
  2.     # Get the id's
  3.     var = 0;
  4.     while(( getline line < "E0.txt") > 0) {
  5.         ids[var++] = "^>" line ".*";
  6.     }
  7.     protein = "";
  8.     doProcess = 0; # False
  9. }
  10. {
  11.     if (!doProcess || substr($, 1, 1) == ">") {
  12.         doProcess = 0;
  13.         for (id in ids) {
  14.             if (match($0, ids[id])) {
  15.                 doProcess = 1; # True
  16.                 print $0;
  17.                 break;
  18.             }
  19.         }
  20.     } else if (doProcess) {
  21.         print $0;
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement