$infile = "/home/slaguerr/work/Formation/AssemblyKept/COGs/AllORFFromSelectedContigs_Prot.fasta.rpsblastCOGs";
$outfile = "/home/slaguerr/work/Formation/AssemblyKept/COGs/AllORFFromSelectedContigs_Prot.fasta.rpsblastCOGs.filtered";

open(INFILE,$infile) or die "$infile non ouvert";
open(OUTFILE,">$outfile") or die "$outfile non ouvert";
while(defined($ligne = <INFILE>)) {
	chomp($ligne);
	if ($ligne =~ /Query=/) {
		print OUTFILE "\n$ligne\t";
		
	}
	elsif ($ligne =~ /^>/) {
		print OUTFILE "$ligne";
		$printNext = 1;
	}
	
	elsif ($printNext == 1) {
		$ligne =~ s/\s\s//g;
		print OUTFILE "$ligne\t";
		$printNext = 0;
	
	}
	elsif ($ligne =~ /Score =/) {
		print OUTFILE "$ligne\t";
	}
}
close(INFILE);
close(OUTFILE);


