function ConvertPhylip2Fasta( PhylipDir,FastaDir )
% example:
% FastaDir = '/home/lowie/Software/Mega5/HIVData/ExtendedHIVFull_NaiveNT_SubtypeB.fasta';
% PhylipDir = '/home/lowie/Software/Mega5/HIVData/ExtendedHIVFull_NaiveNT_SubtypeB.phy';
% written by Guangdi Li (lowieli@gmail.com)

Pfid = fopen(PhylipDir,'r');
Ffid = fopen(FastaDir,'w');
Line = fgetl( Pfid );
while feof( Pfid ) == 0
    Line = fgetl( Pfid );
    if isempty( regexp(Line, '[0-9]'))
       fprintf(Ffid,'%s\n',Line);
    else
       fprintf(Ffid,'>%s\n',Line);
    end
end

end
