@Override public String toString() { return asText().toString(); } }
@Override public int compareTo( final Accession o ) { if ( equals( o ) ) { return 0; } return _source_value.compareTo( o._source_value ); }
@Override public boolean isEqual( final PhylogenyData data ) { if ( this == data ) { return true; } if ( ( data == null ) || ( getValue() == null ) ) { return false; } final Accession a = ( Accession ) data; if ( ( getSource() != null ) && ( a.getSource() != null ) ) { return ( a.getValue().equals( getValue() ) && a.getSource().equals( getSource() ) ); } return ( a.getValue().equals( getValue() ) ); }
final static String pdbAccToString( final List<Accession> accs, final int i ) { if ( ForesterUtil.isEmpty( accs.get( i ).getComment() ) ) { return accs.get( i ).getValue(); } return accs.get( i ).getValue() + " (" + accs.get( i ).getComment().toLowerCase() + ")"; }
@Override public StringBuffer asText() { final StringBuffer sb = new StringBuffer(); if ( !ForesterUtil.isEmpty( getSource() ) ) { sb.append( getSource() ); sb.append( ": " ); } sb.append( getValue() ); if ( !ForesterUtil.isEmpty( getComment() ) ) { sb.append( " (" ); sb.append( getComment() ); sb.append( ")" ); } return sb; }
@Override public StringBuffer asSimpleText() { return new StringBuffer( getValue() ); }
n.setName( "NP_001025424" ); Accession acc = SequenceDbWsTools.obtainSeqAccession( n ); if ( ( acc == null ) || !acc.getSource().equals( Source.REFSEQ.toString() ) || !acc.getValue().equals( "NP_001025424" ) ) { return false; if ( ( acc == null ) || !acc.getSource().equals( Source.REFSEQ.toString() ) || !acc.getValue().equals( "NP_001025424" ) ) { return false; if ( ( acc == null ) || !acc.getSource().equals( Source.REFSEQ.toString() ) || !acc.getValue().equals( "NP_001025424" ) ) { return false; if ( ( acc == null ) || !acc.getSource().equals( Source.REFSEQ.toString() ) || !acc.getValue().equals( "NM_001030253" ) ) { return false; if ( ( acc == null ) || !acc.getSource().equals( Source.UNIPROT.toString() ) || !acc.getValue().equals( "BCL2_HUMAN" ) ) { System.out.println( acc.toString() ); return false; if ( ( acc == null ) || !acc.getSource().equals( Source.UNIPROT.toString() ) || !acc.getValue().equals( "P10415" ) ) { System.out.println( acc.toString() ); return false; if ( ( acc == null ) || !acc.getSource().equals( Source.UNIPROT.toString() )
public final static Accession obtainAccessorFromDataFields( final PhylogenyNode n ) { String a = obtainUniProtAccessorFromDataFields( n ); if ( !ForesterUtil.isEmpty( a ) ) { return new Accession( a, Source.UNIPROT ); } a = obtainGenbankAccessorFromDataFields( n ); if ( !ForesterUtil.isEmpty( a ) ) { return new Accession( a, Source.NCBI ); } a = obtainRefSeqAccessorFromDataFields( n ); if ( !ForesterUtil.isEmpty( a ) ) { return new Accession( a, Source.REFSEQ ); } a = obtainGiNumberFromDataFields( n ); if ( !ForesterUtil.isEmpty( a ) ) { return new Accession( a, Source.GI ); } return null; }
if ( !ForesterUtil.isEmpty( xrefs ) ) { for( final Accession xref : xrefs ) { if ( xref.getSource().equalsIgnoreCase( "pdb" ) ) { if ( xref.getComment().equalsIgnoreCase( "x-ray" ) || xref.getComment().equalsIgnoreCase( "xray" ) ) { ++xray; if ( xref.getComment().equalsIgnoreCase( "nmr" ) ) { ++nmr; if ( xref.getComment().equalsIgnoreCase( "model" ) ) { ++model;
PhylogenyDataUtil.appendElement( writer, PhyloXmlMapping.SEQUENCE_SYMBOL, getSymbol(), indentation ); if ( ( getAccession() != null ) && !ForesterUtil.isEmpty( getAccession().getValue() ) ) { getAccession().toPhyloXML( writer, level, indentation );
ann.append( n.getNodeData().getSequence().getAccession().asText() ); ann.append( "|" ); case SEQUENCE_ACC: if ( n.getNodeData().isHasSequence() && ( n.getNodeData().getSequence().getAccession() != null ) && !ForesterUtil.isEmpty( n.getNodeData().getSequence().getAccession().toString() ) ) { data.add( n.getNodeData().getSequence().getAccession().toString() );
@Override public boolean equals( final Object o ) { if ( this == o ) { return true; } else if ( o == null ) { return false; } else if ( o.getClass() != this.getClass() ) { throw new IllegalArgumentException( "attempt to check [" + this.getClass() + "] equality to " + o + " [" + o.getClass() + "]" ); } else { return isEqual( ( Accession ) o ); } }
@Override public StringBuffer toNHX() { final StringBuffer sb = new StringBuffer(); if ( getName().length() > 0 ) { sb.append( ":" ); sb.append( NHXtags.GENE_NAME ); sb.append( ForesterUtil.replaceIllegalNhxCharacters( getName() ) ); } if ( getAccession() != null ) { getAccession().toNHX(); } return sb; }
@Override public int hashCode() { if ( getAccession() != null ) { return getAccession().hashCode(); } int result = getName().hashCode(); if ( getSymbol().length() > 0 ) { result ^= getName().hashCode(); } if ( getGeneName().length() > 0 ) { result ^= getGeneName().hashCode(); } if ( getMolecularSequence().length() > 0 ) { result ^= getMolecularSequence().hashCode(); } return result; }
final private List<Accession> getPdbAccs( final PhylogenyNode node ) { final List<Accession> pdb_ids = new ArrayList<Accession>(); if ( node.getNodeData().isHasSequence() ) { final Sequence seq = node.getNodeData().getSequence(); if ( !ForesterUtil.isEmpty( seq.getCrossReferences() ) ) { final SortedSet<Accession> cross_refs = seq.getCrossReferences(); for( final Accession acc : cross_refs ) { if ( acc.getSource().equalsIgnoreCase( "pdb" ) ) { pdb_ids.add( acc ); } } } } return pdb_ids; }
seq.setLocation( getLocation() ); if ( getAccession() != null ) { seq.setAccession( ( Accession ) getAccession().copy() );
private final static boolean isAccessionAcceptable( final Accession acc ) { return ( !( ( acc == null ) || ForesterUtil.isEmpty( acc.getSource() ) || ForesterUtil.isEmpty( acc.getValue() ) || ( ( acc .getSource().equals( Source.UNIPROT.toString() ) ) && ( acc.getSource().toString().equals( Source.EMBL.toString() ) ) && ( acc.getSource().toString() .equals( Source.REFSEQ.toString() ) ) ) ) ); }
@Override public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException { if ( ForesterUtil.isEmpty( getSource() ) ) { if ( ForesterUtil.isEmpty( getComment() ) ) { PhylogenyDataUtil.appendElement( writer, PhyloXmlMapping.ACCESSION, getValue(), PhyloXmlMapping.ACCESSION_SOURCE_ATTR, "unknown", PhylogenyDataUtil.appendElement( writer, PhyloXmlMapping.ACCESSION, getValue(), PhyloXmlMapping.ACCESSION_SOURCE_ATTR, "unknown", PhyloXmlMapping.ACCESSION_COMMENT_ATTR, getComment(), indentation ); if ( ForesterUtil.isEmpty( getComment() ) ) { PhylogenyDataUtil.appendElement( writer, PhyloXmlMapping.ACCESSION, getValue(), PhyloXmlMapping.ACCESSION_SOURCE_ATTR, getSource(), indentation ); PhylogenyDataUtil.appendElement( writer, PhyloXmlMapping.ACCESSION, getValue(),
public static List<String> queryEmblDbForRefSeqEntry( final Accession id, final int max_lines_to_return ) throws IOException { final StringBuilder url_sb = new StringBuilder(); url_sb.append( EMBL_REFSEQ ); return queryDb( id.getValue(), max_lines_to_return, url_sb.toString() ); }