Created
July 22, 2021 08:12
-
-
Save epaule/6ff3dc0c13d6775e05f6d2ba0051f771 to your computer and use it in GitHub Desktop.
remove scaffolds from a TPF based on a decon file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# filter_tpf.pl decon_file TPF | |
# * will leave gaps/etc in the file | |
my %ids; | |
open IN,$ARGV[0]; | |
while (<IN>){ | |
$ids{$1}=1 if /^REMOVE\s+(\w+)/ | |
} | |
close IN; | |
open IN,$ARGV[1]; | |
while(<IN>){ | |
if (/(scaffold_\d+)/){ | |
print unless $ids{$1} | |
}else{print} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment