#!/usr/bin/perl -w
use strict;


#my $oldref="J Zhang, J Yang, R Jang, Y Zhang. GPCR-I-TASSER: A new hybrid approach to G protein-coupled receptor structure modeling with application to the human genome, submitted, 2014.";
            

my $oldref="J Zhang, J Yang, R Jang, Y Zhang. Novel hybrid approach to G protein-coupled receptor structure modeling and case study on human genome, submitted, 2014.";
my $newref="J Zhang, J Yang, R Jang, Y Zhang. Hybrid structure modeling of G protein-coupled receptors in the human genome, submitted, 2015.";


my @list=`cat ../list.txt`; chomp(@list);

foreach my $l(@list)
{
    if($l =~ /^\t(\S+)\t+/)
    {
	my $id=$1;
	print "$id\n";

	my $buff=`cat $id/index.html`;

	if($buff =~ /$oldref/)
	{
	    #print "yes\n";
	    $buff =~ s/$oldref/$newref/;
	}
	else
	{
	    print "no\n\n";
	    next;
	}
	
	open(OUT, ">$id/index.html");
	print OUT $buff;
	close(OUT);
	#last;
    }
}
