public ArrayList < String > getProteinAliases ( ) throws XPathExpressionException { ArrayList < String > aliasList = new ArrayList < String > ( ) ; if ( uniprotDoc == null ) { return aliasList ; } Element uniprotElement = uniprotDoc . getDocumentElement ( ) ; Element entryElement = XMLHelper . selectSingleElement ( uniprotElement , "entry" ) ; Element proteinElement = XMLHelper . selectSingleElement ( entryElement , "protein" ) ; // An alternativeName can contain multiple fullNames and multiple shortNames, so we are careful to catch them all ArrayList < Element > keyWordElementList = XMLHelper . selectElements ( proteinElement , "alternativeName" ) ; for ( Element element : keyWordElementList ) { Element fullNameElement = XMLHelper . selectSingleElement ( element , "fullName" ) ; aliasList . add ( fullNameElement . getTextContent ( ) ) ; ArrayList < Element > shortNameElements = XMLHelper . selectElements ( element , "shortName" ) ; for ( Element shortNameElement : shortNameElements ) { if ( null != shortNameElement ) { String shortName = shortNameElement . getTextContent ( ) ; if ( null != shortName && ! shortName . trim ( ) . isEmpty ( ) ) { aliasList . add ( shortName ) ; } } } } // recommendedName seems to allow only one fullName, to be on the safe side, we double check for multiple shortNames for the recommendedName keyWordElementList = XMLHelper . selectElements ( proteinElement , "recommendedName" ) ; for ( Element element : keyWordElementList ) { Element fullNameElement = XMLHelper . selectSingleElement ( element , "fullName" ) ; aliasList . add ( fullNameElement . getTextContent ( ) ) ; ArrayList < Element > shortNameElements = XMLHelper . selectElements ( element , "shortName" ) ; for ( Element shortNameElement : shortNameElements ) { if ( null != shortNameElement ) { String shortName = shortNameElement . getTextContent ( ) ; if ( null != shortName && ! shortName . trim ( ) . isEmpty ( ) ) { aliasList . add ( shortName ) ; } } } } Element cdAntigen = XMLHelper . selectSingleElement ( proteinElement , "cdAntigenName" ) ; if ( null != cdAntigen ) { String cdAntigenName = cdAntigen . getTextContent ( ) ; if ( null != cdAntigenName && ! cdAntigenName . trim ( ) . isEmpty ( ) ) { aliasList . add ( cdAntigenName ) ; } } return aliasList ; }
Pull uniprot protein aliases associated with this sequence