Skip to content

Instantly share code, notes, and snippets.

@epaule
Created July 22, 2021 08:12
Show Gist options
  • Save epaule/6ff3dc0c13d6775e05f6d2ba0051f771 to your computer and use it in GitHub Desktop.
Save epaule/6ff3dc0c13d6775e05f6d2ba0051f771 to your computer and use it in GitHub Desktop.
remove scaffolds from a TPF based on a decon file
#!/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