#Script developped by group 9 of the Bioinformatics course at Universitat Pompeu Fabra. Autumn-Winter of 2012.
#You are allowed to use and modify this sript.

#Replaces all Us (selenocysteins) for Xs in an aminoacidic sequence. This way blast can be run without warnings.


#!/usr/bin/perl -w
use strict;
use warnings;
use File::Spec;


print "Enter the fasta where you want to replace the Us by Xs:\n";
my $protein_sequence = <STDIN>;
chomp($protein_sequence);

open my $prot_seq, "<", "$protein_sequence" or die $!;
open my $prot_seq_out, ">>", "./$protein_sequence.out" or die $!;

while (<$prot_seq>) {
	if ($_ =~ m/^[^\>]/) {
		$_ =~ s/[Uu]/X/g;
	}
	print $prot_seq_out "$_";
}
