File: proteinortho_formatUsearch.pl

package info (click to toggle)
proteinortho 6.0.28%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,160 kB
  • sloc: perl: 4,487; cpp: 3,560; python: 655; makefile: 329; ansic: 266; sh: 27
file content (19 lines) | stat: -rwxr-xr-x 483 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env perl

use warnings;
use strict;

unless ($ARGV[0]) {
	print STDERR "Usage: formatU.pl FILE_A\n\nExpecting usearch/ublast '-blast6out' format file FILE_A. Removing the description from each gene name (starting with a whitespace character).\n";
	exit;
}

open(FILE,"<$ARGV[0]") || die("Error, could not open file $ARGV[0]: $!");
while(<FILE>) {
	chomp;
	if ($_ =~ /^#/) {next;}
	$_ =~ s/ {1}[^\t]+\t/\t/;
	$_ =~ s/ {1}[^\t]+\t/\t/;
	print STDOUT $_."\n";
}
close(FILE);