src/Reader/FastaEntry/PeffFastaEntry.php
private function parseAttributes(Protein $protein, array $attributes)
    {
        if (isset($attributes[PsiVerb::NCBI_TAX_ID])) {
            $organism = Organism::getInstance($attributes[PsiVerb::NCBI_TAX_ID]);
            $protein->setOrganism($organism);
        }

        if (isset($attributes[PsiVerb::TAX_NAME])) {
            if (! $protein->getOrganism()) {
                $protein->setOrganism(new Organism());
            }

            $protein->getOrganism()->setName($attributes[PsiVerb::TAX_NAME]);
        }

        foreach ($attributes as $key => $value) {
            switch ($key) {
                case 'DbUniqueId':
                    $protein->setAccession($value);
                    break;
                case 'GName':
                    $gene = Gene::getInstance($value);
                    $protein->setGene($gene);
                    break;
                case 'SV':
                    $protein->getDatabaseEntry()->setSequenceVersion($value);
                    break;
                case 'EV':
                    $protein->getDatabaseEntry()->setEntryVersion($value);
                    break;
                case 'PE':
                    $protein->getDatabaseEntry()->setEvidence($value);
                    break;
                case 'PName':
                    $protein->setDescription($value);
                    break;
                case 'ModRes':
                case 'ModResPsi':
                case 'ModResUnimod':
                    $modifications = self::parseModifications($value);
                    $protein->addModifications($modifications);
                    break;
                case PsiVerb::NCBI_TAX_ID:
                case PsiVerb::TAX_NAME:
                    // Safe to ignore - already handled
                    break;
                case 'Length':
                case 'VariantSimple ':
                case 'VariantComplex':
                case 'Processed':
                    // Not supported
                    break;
                default:
                    // Not supported
                    break;
            }
        }
    }
private function parseAttributes(Protein $protein, array $attributes)
    {
        if (isset($attributes[PsiVerb::NCBI_TAX_ID])) {
            $organism = Organism::getInstance($attributes[PsiVerb::NCBI_TAX_ID]);
            $protein->setOrganism($organism);
        }

        if (isset($attributes[PsiVerb::TAX_NAME])) {
            if (! $protein->getOrganism()) {
                $protein->setOrganism(new Organism());
            }

            $protein->getOrganism()->setName($attributes[PsiVerb::TAX_NAME]);
        }

        foreach ($attributes as $key => $value) {
            switch ($key) {
                case 'DbUniqueId':
                    $protein->setAccession($value);
                    break;
                case 'GName':
                    $gene = Gene::getInstance($value);
                    $protein->setGene($gene);
                    break;
                case 'SV':
                    $protein->getDatabaseEntry()->setSequenceVersion($value);
                    break;
                case 'EV':
                    $protein->getDatabaseEntry()->setEntryVersion($value);
                    break;
                case 'PE':
                    $protein->getDatabaseEntry()->setEvidence($value);
                    break;
                case 'PName':
                    $protein->setDescription($value);
                    break;
                case 'ModRes':
                case 'ModResPsi':
                case 'ModResUnimod':
                    $modifications = self::parseModifications($value);
                    $protein->addModifications($modifications);
                    break;
                case PsiVerb::NCBI_TAX_ID:
                case PsiVerb::TAX_NAME:
                    // Safe to ignore - already handled
                    break;
                case 'Length':
                case 'VariantSimple ':
                case 'VariantComplex':
                case 'Processed':
                    // Not supported
                    break;
                default:
                    // Not supported
                    break;
            }
        }
    }
private function parseAttributes ( Protein $ protein , array $ attributes ) { if ( isset ( $ attributes [ PsiVerb :: NCBI_TAX_ID ] ) ) { $ organism = Organism :: getInstance ( $ attributes [ PsiVerb :: NCBI_TAX_ID ] ) ; $ protein -> setOrganism ( $ organism ) ; } if ( isset ( $ attributes [ PsiVerb :: TAX_NAME ] ) ) { if ( ! $ protein -> getOrganism ( ) ) { $ protein -> setOrganism ( new Organism ( ) ) ; } $ protein -> getOrganism ( ) -> setName ( $ attributes [ PsiVerb :: TAX_NAME ] ) ; } foreach ( $ attributes as $ key => $ value ) { switch ( $ key ) { case 'DbUniqueId' : $ protein -> setAccession ( $ value ) ; break ; case 'GName' : $ gene = Gene :: getInstance ( $ value ) ; $ protein -> setGene ( $ gene ) ; break ; case 'SV' : $ protein -> getDatabaseEntry ( ) -> setSequenceVersion ( $ value ) ; break ; case 'EV' : $ protein -> getDatabaseEntry ( ) -> setEntryVersion ( $ value ) ; break ; case 'PE' : $ protein -> getDatabaseEntry ( ) -> setEvidence ( $ value ) ; break ; case 'PName' : $ protein -> setDescription ( $ value ) ; break ; case 'ModRes' : case 'ModResPsi' : case 'ModResUnimod' : $ modifications = self :: parseModifications ( $ value ) ; $ protein -> addModifications ( $ modifications ) ; break ; case PsiVerb :: NCBI_TAX_ID : case PsiVerb :: TAX_NAME : // Safe to ignore - already handled break ; case 'Length' : case 'VariantSimple ' : case 'VariantComplex' : case 'Processed' : // Not supported break ; default : // Not supported break ; } } }
Parses the attribute array and inputs the data into the protein

@param Protein $protein
Object to input values to
@param array $attributes
Array to read from
@return void
Parses the attribute array and inputs the data into the protein