percolatorPeptides = per.getPeptides(elems)
        percolatorProteins = per.getProteins(elems)
        
        if(verbose):
            print "Read " + str(len(percolatorPSMs)) + " PSMs"
            print "Read " + str(len(percolatorPeptides)) + " Peptides"
            print "Read " + str(len(percolatorProteins)) + " Proteins"
            
        if(fdr < 1.0 and fdr > 0.0):
            percolatorPSMs = [psm for psm in percolatorPSMs if psm.qvalue <= fdr]
            percolatorPeptides = [pep for pep in percolatorPeptides if pep.qvalue <= fdr]
            percolatorProteins = [prot for prot in percolatorProteins if prot.qvalue <= fdr]
          
        if(len(percolatorPSMs) > 0):
            if(verbose):
                print "writing in " + str(OutputFile)   
            utils.writePsms(percolatorPSMs, "psms_" + OutputFile)
            if(len(percolatorPeptides) > 0):
                utils.writePeptides(percolatorPeptides,"peptides_" + OutputFile)
            if(len(percolatorProteins) > 0):
                utils.writeProteins(percolatorProteins,"proteins_" + OutputFile)
        else:
            sys.stderr.write("the input file does not contain any information\n")
            sys.exit()
        
        if(verbose):
            print "Percolator file parsed"
            
if __name__ == "__main__":
    main(sys.argv[1:]) 
    
            tree2 = etree.parse(infile2,parser)
            
        except Exception, inst:
            sys.stderr.write("Unexpected error opening %s or %s: %s\n" % (infile,infile2, inst))
            sys.exit()
             
        if(verbose):
            print "Reading " + str(argv[0])   
            print "Reading " + str(argv[1])  
                         
        elems = tree.getroot()
        elems2 = tree2.getroot()
        tppPSMs,tppPeptides = tpp.readIprophetPSMsPeptides(elems,decoy_prefix)
        tppProteins = tpp.readIprophetProteins(elems2,decoy_prefix)

        if(len(tppPSMs) > 0 and len(tppPeptides) > 0 and len(tppProteins) > 0):
            if(verbose):
                print "writing in " + str(OutputFile)   
            utils.writePsms(tppPSMs, "psms_" + OutputFile)
            utils.writePeptides(tppPeptides,"peptides_" + OutputFile)
            utils.writeProteins(tppProteins,"proteins_" + OutputFile)
        else:
            sys.stderr.write("\nThe input files does not contain any information\n")
            sys.exit()
        
        if(verbose):
            print "iProphet and Protein Prophet files parsed"
            
if __name__ == "__main__":
    main(sys.argv[1:])