public static String generateFasta ( HELM2Notation helm2Notation2 ) throws FastaFormatException , ChemistryException { List < PolymerNotation > polymersPeptides = new ArrayList < PolymerNotation > ( ) ; List < PolymerNotation > polymerNucleotides = new ArrayList < PolymerNotation > ( ) ; StringBuilder fasta = new StringBuilder ( ) ; for ( PolymerNotation polymer : helm2Notation2 . getListOfPolymers ( ) ) { if ( polymer . getPolymerID ( ) instanceof RNAEntity ) { polymerNucleotides . add ( polymer ) ; } if ( polymer . getPolymerID ( ) instanceof PeptideEntity ) { polymersPeptides . add ( polymer ) ; } } fasta . append ( generateFastaFromPeptidePolymer ( polymersPeptides ) ) ; fasta . append ( generateFastaFromRNAPolymer ( polymerNucleotides ) ) ; return fasta . toString ( ) ; }
method to generate for the whole HELM2Notation fasta - files it contains fasta for all rna and peptides