idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
141,500
public String generateNaturalAnalogSequenceRNA ( String notation ) throws org . helm . notation2 . parser . exceptionparser . NotationException , HELM2HandledException , ValidationException , MonomerLoadingException , ChemistryException { String result = SequenceConverter . getNucleotideNaturalAnalogSequenceFromNotatio...
method to generate the natural analogue sequence for all rna - sequences from an HELM input
141,501
public String convertMolFileSMILESWithAtomMapping ( String molfile , List < Attachment > attachments ) throws CTKException , ChemistryException { return SMILES . convertMolToSMILESWithAtomMapping ( molfile , attachments ) ; }
method to generate a smiles with atom mapping for a given molfile with the given attachments
141,502
public static List < MonomerNotation > getListOfMonomerNotation ( List < PolymerNotation > polymers ) { List < MonomerNotation > items = new ArrayList < MonomerNotation > ( ) ; for ( PolymerNotation polymer : polymers ) { items . addAll ( polymer . getListMonomers ( ) ) ; } return items ; }
method to get all MonomerNotations for all given polymers
141,503
public static List < Monomer > getListOfMonomer ( List < MonomerNotation > monomerNotations ) throws MonomerException , HELM2HandledException , CTKException , NotationException , ChemistryException , MonomerLoadingException { List < Monomer > items = new ArrayList < Monomer > ( ) ; for ( int i = 0 ; i < monomerNotation...
method to get all monomers for all MonomerNotations
141,504
public static Monomer getMonomer ( String type , String id , String info ) throws MonomerException , NotationException , ChemistryException { try { if ( id . startsWith ( "[" ) && id . endsWith ( "]" ) ) { id = id . substring ( 1 , id . length ( ) - 1 ) ; } MonomerFactory monomerFactory = MonomerFactory . getInstance (...
method to get the monomer from the database!
141,505
public static JKLocale valueOf ( final String localeString ) { return localeString . equals ( ARABIC . shortName ) ? ARABIC : ENGLISH ; }
Value of .
141,506
public String getAuditText ( ) { final StringBuffer b = new StringBuffer ( ) ; b . append ( getOldValue ( ) . replaceAll ( "," , "\n" ) ) ; b . append ( "-----------------------------------------\n" ) ; b . append ( getNewValue ( ) . replaceAll ( "," , "\n" ) ) ; b . append ( "-----------------------------------------\...
Gets the audit text .
141,507
public float calculate ( HELM2Notation helm2notation , int unitType ) throws ExtinctionCoefficientException , ChemistryException { LOG . debug ( "ExtinctionCalculation is starting with the unitType: " + unitType ) ; float result = 0.0f ; List < PolymerNotation > polymerNodes = helm2notation . getListOfPolymers ( ) ; fo...
method to calculate the extinction coefficient for the whole HELM molecule
141,508
private static float calculateExtinctionFromRNA ( List < Monomer > monomers ) throws CalculationException , IOException { LOG . debug ( "ExtinctionCalculation of RNA" ) ; float resultSingle = 0.0f ; float resultDi = 0.0f ; String previous = "" ; if ( monomers . size ( ) == 0 ) { throw new CalculationException ( "Input ...
method to calculate the extinction coefficient for rna
141,509
private static float calculateExtinctionFromPeptide ( List < Monomer > monomers ) throws IOException , HELM2HandledException { if ( null == monomers || monomers . isEmpty ( ) ) { return 0.0f ; } Map < String , Integer > countMap = new HashMap < String , Integer > ( ) ; for ( Monomer monomer : monomers ) { if ( aminoAci...
method to calculate the extinction coefficient for peptide
141,510
public static boolean isAuthenticed ( String host , int port , String userName , String password ) throws NamingException { log . info ( "isAuthenticed" ) ; Hashtable < String , String > env = new Hashtable < String , String > ( ) ; env . put ( Context . INITIAL_CONTEXT_FACTORY , "com.sun.jndi.ldap.LdapCtxFactory" ) ; ...
Checks if is authenticed .
141,511
protected static String fixKey ( final String key ) { if ( key . startsWith ( getKeyPrefix ( ) ) ) { return key ; } return getKeyPrefix ( ) + "-" + key ; }
Fix key .
141,512
public static float getFloat ( final String key , final float def ) { try { return systemRoot . getFloat ( fixKey ( key ) , def ) ; } catch ( final Exception e ) { return def ; } }
Gets the float .
141,513
public static Hashtable < String , String > getHashtable ( final String name ) { final Hashtable < String , String > hash = new Hashtable < String , String > ( ) ; try { final String configStr = UserPreferences . get ( fixKey ( name ) , "" ) ; if ( ! configStr . equals ( "" ) ) { final String [ ] rows = configStr . spl...
Gets the hashtable .
141,514
public static int getInt ( final String key , final int def ) { try { return systemRoot . getInt ( fixKey ( key ) , def ) ; } catch ( final Exception e ) { return def ; } }
Gets the int .
141,515
public static void putHashTable ( final String name , final Hashtable hash ) { final Enumeration < String > keys = hash . keys ( ) ; final StringBuffer buf = new StringBuffer ( "" ) ; while ( keys . hasMoreElements ( ) ) { if ( ! buf . toString ( ) . equals ( "" ) ) { buf . append ( ";" ) ; } final String key = keys . ...
Put hash table .
141,516
public static void setKeyPrefix ( final String keyPrefix ) { UserPreferences . keyPrefix = keyPrefix ; try { systemRoot . sync ( ) ; } catch ( final Exception e ) { JKExceptionUtil . handle ( e ) ; } }
Sets the key prefix .
141,517
private static void initializeNucleotideTemplates ( ) throws NucleotideLoadingException { InputStream in = null ; File localFile = new File ( LOCAL_NUCLEOTIDE_TEMPLATE_FILE_PATH ) ; Map < String , Map < String , String > > templates = null ; if ( localFile . exists ( ) ) { try { in = new FileInputStream ( localFile ) ;...
This method is called during startup use local version if exist otherwise use XML version in jar
141,518
public void saveNucleotideTemplates ( ) throws IOException { File f = new File ( NOTATION_DIRECTORY ) ; if ( ! f . exists ( ) ) { f . mkdir ( ) ; } String nucleotideTemplatesXML = NucleotideParser . getNucleotideTemplatesXML ( getNucleotideTemplates ( ) ) ; FileOutputStream fos = new FileOutputStream ( LOCAL_NUCLEOTIDE...
save Nucleotide Templates to disk file
141,519
@ SuppressWarnings ( "rawtypes" ) public Class [ ] getParamtersTypes ( ) { final Class [ ] types = new Class [ this . paramters . length ] ; for ( int i = 0 ; i < types . length ; i ++ ) { types [ i ] = this . paramters [ i ] . getClass ( ) ; } return types ; }
get the types of the parameters using java reflection .
141,520
private void readConfigFile ( ) { File configFile = new File ( CONFIG_FILE_PATH ) ; if ( ! configFile . exists ( ) ) { resetConfigToDefault ( ) ; } try { PropertiesConfiguration conf = new PropertiesConfiguration ( CONFIG_FILE_PATH ) ; chemistry = conf . getString ( CHEMISTRY_PLUGIN ) ; } catch ( ConfigurationException...
method to read the configuration file
141,521
public static boolean compileJavaClass ( String sourceCode ) { try { String fileName = getClassName ( sourceCode ) . concat ( ".java" ) ; logger . info ( "Compiling Java Class ({})" , fileName ) ; File rootDir = JKIOUtil . createTempDirectory ( ) ; String packageDir = getPackageDir ( sourceCode ) ; File sourceFile ; if...
Compile java class .
141,522
public void showAndChoose ( IConsumer < File > consumer ) { this . consumer = consumer ; initSrvNodeFile ( ) ; Intent activityTreeIntent = new Intent ( activity , ActivityTreeChooser . class ) ; activityTreeIntent . putExtra ( FragmentNodes . ARG_ID_NODE_SRVNODES , new String [ ] { idFolderStart , idSrvGetNodeFile , id...
You must provide fileFilter idFolderStart and title to invoke it!
141,523
public static String getHELMNotationString ( Element rootElement ) { Element helmNotationElement = rootElement . getChild ( "HelmNotation" ) ; return helmNotationElement . getText ( ) ; }
Extracts the HELM string from the root node of the XHELM document
141,524
public static String getComplexNotationString ( Element rootElement ) { Element helmNotationElement = rootElement . getChild ( "HelmNotation" ) ; return helmNotationElement . getText ( ) ; }
Extracts the complex notation string from the root node of the XHELM document
141,525
public static MonomerStore getMonomerStore ( Element rootElement ) throws MonomerException , IOException { MonomerStore monomerStore = new MonomerStore ( ) ; Element monomerListElement = rootElement . getChild ( "Monomers" ) ; if ( monomerListElement != null ) { @ SuppressWarnings ( "unchecked" ) List < Element > eleme...
Generates the monomer store from a given XHELM document
141,526
public boolean isNumeric ( ) { final Class c = getColumnClass ( ) ; return c . equals ( Integer . class ) || c . equals ( Float . class ) || c . equals ( Long . class ) || c . equals ( BigDecimal . class ) ; }
Checks if is numeric .
141,527
public void setColumnClassName ( final String columnClassName ) throws ClassNotFoundException { if ( columnClassName . equals ( "byte[]" ) ) { setColumnClass ( Object . class ) ; } else { setColumnClass ( Class . forName ( columnClassName ) ) ; } this . columnClassName = columnClassName ; }
Sets the column class name .
141,528
public static String generateMDL ( final HELM2Notation helm2notation ) throws BuilderMoleculeException , CTKException , NotationException , ChemistryException { LOG . debug ( "Generate smiles representation for the whole HELM molecule" ) ; String smiles = SMILES . getSMILESForAll ( helm2notation ) ; LOG . debug ( "Conv...
method to generate MDL for a HELM molecule
141,529
public void callMethod ( final MethodCallInfo info ) { this . logger . info ( "calling remote method " . concat ( info . toString ( ) ) ) ; try ( Socket socket = new Socket ( this . host , this . port ) ) { final ObjectOutputStream out = new ObjectOutputStream ( socket . getOutputStream ( ) ) ; out . writeObject ( info...
Call the remote method based on the passed MethodCallInfo parameter .
141,530
protected static Vector convertToVector ( final Object [ ] anArray ) { if ( anArray == null ) { return null ; } final Vector v = new Vector ( anArray . length ) ; for ( final Object element : anArray ) { v . addElement ( element ) ; } return v ; }
Returns a vector that contains the same objects as the array .
141,531
private static Vector newVector ( final int size ) { final Vector v = new Vector ( size ) ; v . setSize ( size ) ; return v ; }
New vector .
141,532
public String getColumnName ( final int column ) { Object id = null ; if ( column < this . columnIdentifiers . size ( ) && column >= 0 ) { id = this . columnIdentifiers . elementAt ( column ) ; } return id == null ? super . getColumnName ( column ) : id . toString ( ) ; }
Returns the column name .
141,533
private void justifyRows ( final int from , final int to ) { this . dataVector . setSize ( getRowCount ( ) ) ; for ( int i = from ; i < to ; i ++ ) { if ( this . dataVector . elementAt ( i ) == null ) { this . dataVector . setElementAt ( new Vector ( ) , i ) ; } } }
Justify rows .
141,534
public static String findPathJar ( final Class clas ) throws IllegalStateException { URL url ; String extURL ; try { url = clas . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) ; } catch ( final SecurityException ex ) { url = clas . getResource ( clas . getSimpleName ( ) + ".class" ) ; } extURL = url . t...
If the provided class has been loaded from a jar file that is on the local file system will find the absolute path to that jar file .
141,535
public static byte [ ] readStream ( final InputStream inStream ) { try { return IOUtils . toByteArray ( inStream ) ; } catch ( IOException e ) { throw new JKException ( e ) ; } }
Read stream .
141,536
public static String convertToString ( InputStream input ) throws IOException { try { if ( input == null ) { throw new IOException ( "Input Stream Cannot be NULL" ) ; } StringBuilder sb1 = new StringBuilder ( ) ; String line ; try { BufferedReader r1 = new BufferedReader ( new InputStreamReader ( input , "UTF-8" ) ) ; ...
Convert to string .
141,537
public static Reader getReader ( String name ) { InputStream inputStream = getInputStream ( name ) ; if ( inputStream != null ) { BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; return reader ; } return null ; }
Gets the reader .
141,538
public static String getExtension ( final String fileName , final boolean withPoint ) { final int lastIndexOf = fileName . lastIndexOf ( "." ) ; if ( ! withPoint ) { return fileName . substring ( lastIndexOf + 1 ) ; } return fileName . substring ( lastIndexOf ) ; }
Gets the extension .
141,539
public static String removeExtension ( String fileName ) { final String separator = FILE_SEPARATOR ; String filename ; final int lastSeparatorIndex = fileName . lastIndexOf ( separator ) ; if ( lastSeparatorIndex == - 1 ) { filename = fileName ; } else { filename = fileName . substring ( lastSeparatorIndex + 1 ) ; } fi...
Removes the extension .
141,540
public static File writeDataToFile ( final byte [ ] data , final File file , final boolean append ) { try ( FileOutputStream out = new FileOutputStream ( file , append ) ) { out . write ( data ) ; out . flush ( ) ; out . close ( ) ; return file ; } catch ( Exception e ) { JKExceptionUtil . handle ( e ) ; return null ; ...
Write data to file .
141,541
public static Properties readPropertiesStream ( InputStream inputStream ) { try { final Properties prop = new Properties ( ) ; prop . load ( new InputStreamReader ( inputStream , Charset . forName ( "utf-8" ) ) ) ; JKCollectionUtil . fixPropertiesKeys ( prop ) ; return prop ; } catch ( IOException e ) { JKExceptionUtil...
Read properties stream .
141,542
public static File writeFileToTempDirectory ( final byte [ ] data , final String fileName ) { try { File file = createTempDirectory ( ) ; File out = new File ( file , fileName ) ; out . deleteOnExit ( ) ; file . deleteOnExit ( ) ; return writeDataToFile ( data , out ) ; } catch ( IOException e ) { JKExceptionUtil . han...
Write file to temp directory .
141,543
public static File createTempFile ( final String ext ) { try { File file ; file = File . createTempFile ( "jk-" , "." + ext ) ; return file ; } catch ( IOException e ) { JK . throww ( e ) ; return null ; } }
Creates the temp file .
141,544
public static Process executeFile ( final String fileName ) { try { final String command = "cmd /c \"" + fileName + "\"" ; logger . info ( command ) ; return Runtime . getRuntime ( ) . exec ( command ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Execute file .
141,545
public static String getSqlFile ( String fileName ) { String file = "/jk/sql/" . concat ( fileName ) ; logger . debug ( "Loading sql file: " , file ) ; return readFile ( file ) ; }
Gets the sql file .
141,546
public static void clearTempFiles ( ) { String userFolderPath = getUserFolderPath ( false ) ; File file = new File ( userFolderPath ) ; deleteDir ( file ) ; }
Clear temp files .
141,547
public static void startFakeThread ( ServerSocket server ) { Thread thread = new Thread ( new FakeRunnable ( server ) ) ; thread . start ( ) ; }
Start fake thread .
141,548
public static String getReportsOutPath ( boolean appendFileSeprator ) { String userLocalPath = getUserFolderPath ( true ) ; String reportPath = userLocalPath + REPORTS_OUT_PATH ; checkFolderPath ( reportPath , true ) ; if ( appendFileSeprator ) { reportPath += FILE_SEPARATOR ; } return reportPath ; }
Gets the reports out path .
141,549
public static List < String > getFilesInFolder ( String folder , String ext ) { List < String > files = new Vector < > ( ) ; File dir = new File ( folder ) ; if ( dir . exists ( ) && dir . isDirectory ( ) ) { String [ ] list = dir . list ( ) ; for ( String file : list ) { if ( file . endsWith ( ext ) ) { files . add ( ...
Gets the files in folder .
141,550
public static void copResourcesFromJarToDir ( String sourceClassPath , File dest ) { try { List < File > resourcesInnPackage = getResourcesInnPackage ( sourceClassPath ) ; for ( File file : resourcesInnPackage ) { JK . printBlock ( "Copying file: " + file . getName ( ) + " to folder " + dest . getAbsolutePath ( ) ) ; F...
Cop resources from jar to dir .
141,551
public static List < File > getResourcesInnPackage ( String root ) { try { logger . debug ( "getResourcesInnPackage for package: " + root ) ; ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; URL url = loader . getResource ( root ) ; if ( url != null ) { logger . debug ( " URL :" + url . to...
Gets the resources inn package .
141,552
public static JKConfig readConfigFile ( String configFileName ) { URL url = getURL ( configFileName ) ; logger . debug ( configFileName + " Url is " , url . toString ( ) ) ; JKConfig config = new JKConfig ( url ) ; return config ; }
Read config file .
141,553
private static String convertLessThanOneThousand ( int number ) { String soFar ; if ( number % 100 < 20 ) { soFar = numNames [ number % 100 ] ; number /= 100 ; } else { soFar = numNames [ number % 10 ] ; number /= 10 ; soFar = tensNames [ number % 10 ] + soFar ; number /= 10 ; } if ( number == 0 ) { return soFar ; } re...
Convert less than one thousand .
141,554
public static double addAmounts ( final double num1 , final double num2 ) { final BigDecimal b1 = new BigDecimal ( num1 ) ; final BigDecimal b2 = new BigDecimal ( num2 ) ; BigDecimal b3 = b1 . add ( b2 ) ; b3 = b3 . setScale ( 3 , BigDecimal . ROUND_HALF_UP ) ; final double result = b3 . doubleValue ( ) ; return result...
Adds the amounts .
141,555
public static double fixAmount ( final double value ) { final BigDecimal b1 = new BigDecimal ( value ) ; final BigDecimal b2 = b1 . setScale ( 3 , BigDecimal . ROUND_HALF_UP ) ; return b2 . doubleValue ( ) ; }
Fix amount .
141,556
public static double subAmounts ( final double n1 , final double n2 ) { final BigDecimal b1 = new BigDecimal ( n1 ) ; final BigDecimal b2 = new BigDecimal ( n2 ) ; BigDecimal b3 = b1 . subtract ( b2 ) ; b3 = b3 . setScale ( 3 , BigDecimal . ROUND_HALF_UP ) ; final double result = b3 . doubleValue ( ) ; return result ; ...
Sub amounts .
141,557
public void fillEmail ( final MultiPartEmail email ) throws EmailException , IOException { email . setHostName ( getHost ( ) ) ; email . setSmtpPort ( getSmtpPort ( ) ) ; email . addTo ( getTo ( ) ) ; email . setFrom ( getFrom ( ) ) ; email . setSubject ( getSubject ( ) ) ; email . setMsg ( getMsg ( ) ) ; email . setSS...
Fill email .
141,558
public static Date toDate ( final Object value ) { if ( value instanceof Date ) { return ( Date ) value ; } if ( value == null || value . equals ( "null" ) ) { return null ; } if ( value instanceof String ) { throw new IllegalStateException ( "fix me" ) ; } return null ; }
To date .
141,559
public static float toFloat ( final Object value ) { if ( value instanceof Float ) { return ( float ) value ; } if ( value == null ) { return 0 ; } return new Float ( value . toString ( ) ) ; }
To float .
141,560
public static java . sql . Time toTime ( final Object value ) { if ( value == null ) { return null ; } if ( value instanceof java . sql . Time ) { return ( java . sql . Time ) value ; } if ( value instanceof java . util . Date ) { final Date date = ( java . util . Date ) value ; return new java . sql . Time ( date . ge...
To time .
141,561
public static boolean toBoolean ( Object value , boolean defaultValue ) { boolean result ; if ( value != null ) { if ( value instanceof Boolean ) { return ( ( Boolean ) value ) . booleanValue ( ) ; } if ( value . toString ( ) . trim ( ) . equals ( "1" ) || value . toString ( ) . trim ( ) . toLowerCase ( ) . equals ( "t...
To boolean .
141,562
public static double toDouble ( Object value , double defaultValue ) { if ( value == null || value . toString ( ) . trim ( ) . equals ( "" ) ) { return defaultValue ; } if ( value instanceof Double ) { return ( double ) value ; } if ( value instanceof Date ) { final Date date = ( Date ) value ; return date . getTime ( ...
To double .
141,563
public static int toInteger ( Object value , int defaultValue ) { if ( value == null || value . toString ( ) . trim ( ) . equals ( "" ) ) { return defaultValue ; } if ( value instanceof Integer ) { return ( Integer ) value ; } return ( int ) JKConversionUtil . toDouble ( value ) ; }
To integer .
141,564
public static void validateNotationObjects ( HELM2Notation helm2notation ) throws PolymerIDsException , MonomerException , GroupingNotationException , ConnectionNotationException , NotationException , ChemistryException , MonomerLoadingException , org . helm . notation2 . parser . exceptionparser . NotationException { ...
method to check if the generated notation objects by the parser are correct the polymer ids have to be unique ; all monomers have to be valid ; all used polymer ids in the grouping section have to be there ; all connections have to be valid
141,565
protected static boolean validateMonomers ( List < MonomerNotation > mon ) throws ChemistryException , MonomerLoadingException , org . helm . notation2 . parser . exceptionparser . NotationException { for ( MonomerNotation monomerNotation : mon ) { if ( ! ( isMonomerValid ( monomerNotation . getUnit ( ) , monomerNotati...
method to validate a list of MonomerNotation objects
141,566
private static boolean isConnectionSpecific ( ConnectionNotation connectionNotation ) { String connection = connectionNotation . getSourceUnit ( ) + ":" + connectionNotation . getrGroupSource ( ) + "-" + connectionNotation . getTargetUnit ( ) + ":" + connectionNotation . getrGroupTarget ( ) ; if ( connection . matches ...
method to check if the given connection is specific
141,567
private static List < Integer > getOccurencesOfMonomerNotation ( String sourceUnit , HELMEntity e , HELM2Notation helm2notation ) throws org . helm . notation2 . parser . exceptionparser . NotationException , AttachmentException { List < Integer > occurences = new ArrayList < Integer > ( ) ; try { occurences . add ( In...
method to get all occurences of the MonomerNotation
141,568
public static boolean validateGrouping ( HELM2Notation helm2notation ) { List < GroupingNotation > listGroupings = helm2notation . getListOfGroupings ( ) ; List < String > listPolymerIDs = helm2notation . getPolymerAndGroupingIDs ( ) ; for ( GroupingNotation grouping : listGroupings ) { for ( GroupingElement groupingEl...
method to validate every GroupNotation of the Notation objects
141,569
public static boolean validateUniquePolymerIDs ( HELM2Notation helm2notation ) { List < String > listPolymerIDs = helm2notation . getPolymerAndGroupingIDs ( ) ; Map < String , String > uniqueId = new HashMap < String , String > ( ) ; for ( String polymerID : listPolymerIDs ) { uniqueId . put ( polymerID , "" ) ; } if (...
method to check if all existent polymer ids are unique
141,570
private static void checkExistenceOfPolymerID ( String str , List < String > listPolymerIDs ) throws PolymerIDsException { if ( ! ( listPolymerIDs . contains ( str ) ) ) { LOG . info ( "Polymer Id does not exist" ) ; throw new PolymerIDsException ( "Polymer ID does not exist" ) ; } }
method to check if the given polymer id exists in the given list of polymer ids
141,571
private static boolean isMonomerValid ( String str , String type ) throws ChemistryException , MonomerLoadingException , org . helm . notation2 . parser . exceptionparser . NotationException { LOG . info ( "Is Monomer valid: " + str ) ; MonomerFactory monomerFactory = null ; monomerFactory = MonomerFactory . getInstanc...
method to check the monomer s validation
141,572
private static void checkPolymerIDSConnection ( ConnectionNotation not , List < String > listPolymerIDs ) throws PolymerIDsException { checkExistenceOfPolymerID ( not . getSourceId ( ) . getId ( ) , listPolymerIDs ) ; checkExistenceOfPolymerID ( not . getTargetId ( ) . getId ( ) , listPolymerIDs ) ; }
method to check for one connection if the two polymer ids exist
141,573
public static List < Monomer > getAllMonomers ( MonomerNotation not , int position ) throws HELM2HandledException , MonomerException , NotationException , ChemistryException , CTKException , MonomerLoadingException { List < Monomer > monomers = new ArrayList < Monomer > ( ) ; MonomerFactory monomerFactory = MonomerFact...
method to get for one MonomerNotation all valid contained monomers
141,574
public static List < Monomer > getAllMonomersOnlyBase ( MonomerNotation not ) throws HELM2HandledException , MonomerException , NotationException , ChemistryException , CTKException , MonomerLoadingException { LOG . debug ( "Get base for " + not ) ; List < Monomer > monomers = new ArrayList < Monomer > ( ) ; MonomerFac...
method to get for one MonomerNotation all valid contained monomers . But only the Base
141,575
private static void checkAttachmentPoint ( Monomer mon , String str ) throws AttachmentException { if ( ! ( mon . getAttachmentListString ( ) . contains ( str ) ) ) { if ( ! ( str . equals ( "?" ) || str . equals ( "pair" ) ) && ! mon . getAlternateId ( ) . equals ( "?" ) ) { LOG . info ( "Attachment point for source i...
method to check the attachment point s existence
141,576
private static boolean checkSingleAttachment ( List < Monomer > monomers , String rGroup , HELM2Notation helm2notation , ConnectionNotation not , InterConnections interconnection , String id ) throws AttachmentException { for ( Monomer monomer : monomers ) { checkAttachmentPoint ( monomer , rGroup ) ; String detail = n...
method to check for one attachment point the validation
141,577
private static List < Monomer > getMonomersRNA ( MonomerNotationUnitRNA rna , MonomerStore monomerStore , int position ) throws HELM2HandledException { try { List < Monomer > monomers = new ArrayList < Monomer > ( ) ; for ( int index = 0 ; index < rna . getContents ( ) . size ( ) ; index ++ ) { String id = rna . getCon...
method to get all monomers for MonomerNotationUnitRNA
141,578
private static List < Monomer > getMonomersRNAOnlyBase ( MonomerNotationUnitRNA rna , MonomerStore monomerStore ) throws HELM2HandledException { try { List < Monomer > monomers = new ArrayList < Monomer > ( ) ; for ( MonomerNotationUnit unit : rna . getContents ( ) ) { String id = unit . getUnit ( ) . replace ( "[" , "...
method to get only the nucleotide base for one MonomerNotationUnitRNA
141,579
private static void initComplementMap ( ) { complementMap = new HashMap < String , String > ( ) ; complementMap . put ( "A" , "U" ) ; complementMap . put ( "G" , "C" ) ; complementMap . put ( "C" , "G" ) ; complementMap . put ( "U" , "A" ) ; complementMap . put ( "T" , "A" ) ; complementMap . put ( "X" , "X" ) ; }
initialize Map to get the complement of each nucleotide
141,580
public static boolean areAntiparallel ( PolymerNotation polymerOne , PolymerNotation polymerTwo ) throws RNAUtilsException , HELM2HandledException , ChemistryException , NucleotideLoadingException { checkRNA ( polymerOne ) ; checkRNA ( polymerTwo ) ; PolymerNotation antiparallel = getAntiparallel ( polymerOne ) ; Strin...
method to check if two given polymers are complement to each other
141,581
public static String getMaxMatchFragment ( String seq1 , String seq2 ) throws NotationException { return getMaxMatchFragment ( seq1 , seq2 , MINUMUM_MATCH_FRAGMENT_LENGTH ) ; }
method to get the largest matched fragment between two sequences replace T with U before Match
141,582
public static String getMaxMatchFragment ( String seq1 , String seq2 , int minLength ) throws NotationException { if ( null == seq1 || null == seq2 ) { throw new NotationException ( "Both sequences must not be null " ) ; } if ( ! seq1 . equals ( seq1 . toUpperCase ( ) ) || ! seq2 . equals ( seq2 . toUpperCase ( ) ) ) {...
This method returns the largest matched fragment between two sequences replace T with U before match
141,583
public static void removeLastP ( PolymerNotation polymer ) throws RNAUtilsException , NotationException , HELM2HandledException { checkRNA ( polymer ) ; MonomerNotation lastObject = polymer . getPolymerElements ( ) . getListOfElements ( ) . get ( polymer . getPolymerElements ( ) . getListOfElements ( ) . size ( ) - 1 )...
method to remove the phosphate of the last nucleotide
141,584
public static void addLastP ( PolymerNotation polymer ) throws RNAUtilsException , NotationException , HELM2HandledException { checkRNA ( polymer ) ; MonomerNotation lastObject = polymer . getPolymerElements ( ) . getListOfElements ( ) . get ( polymer . getPolymerElements ( ) . getListOfElements ( ) . size ( ) - 1 ) ; ...
method to add a phosphate to the last polymer s nucleotide
141,585
public static PolymerNotation getInverse ( PolymerNotation polymer ) throws RNAUtilsException , org . helm . notation2 . exception . NotationException , ChemistryException , NucleotideLoadingException { checkRNA ( polymer ) ; PolymerNotation inverse ; try { inverse = SequenceConverter . readRNA ( generateInverse ( poly...
method to get the polymer with the inverse sequence of the current polymer
141,586
public static PolymerNotation getReverseComplement ( PolymerNotation polymer ) throws RNAUtilsException , org . helm . notation2 . exception . NotationException , ChemistryException , NucleotideLoadingException { checkRNA ( polymer ) ; PolymerNotation complementReversePolymer ; try { complementReversePolymer = Sequence...
method to get the polymer with the reverse complement sequence of the current polymer
141,587
private static StringBuilder generateInverse ( PolymerNotation polymer ) throws HELM2HandledException , RNAUtilsException , org . helm . notation2 . exception . NotationException , ChemistryException { initComplementMap ( ) ; String sequence = getNaturalAnalogSequence ( polymer ) ; StringBuilder sb = new StringBuilder ...
method to generate the inverse sequence of the given polymer
141,588
public static boolean hasNucleotideModification ( PolymerNotation polymer ) throws NotationException { for ( MonomerNotation current : polymer . getPolymerElements ( ) . getListOfElements ( ) ) { if ( hasModification ( current ) ) { return true ; } } return false ; }
method to check if the given PolymerNotation has a nucleotide Modification
141,589
private static boolean hasModification ( MonomerNotation monomerNotation ) throws NotationException { if ( monomerNotation instanceof MonomerNotationUnitRNA ) { if ( hasModification ( ( MonomerNotationUnitRNA ) monomerNotation ) ) { return true ; } } else if ( monomerNotation instanceof MonomerNotationGroup ) { for ( M...
method to check if the MonomerNotation contains a modification
141,590
private static boolean hasModification ( MonomerNotationUnitRNA monomerNotation ) { if ( monomerNotation . getUnit ( ) . contains ( "[" ) || monomerNotation . getUnit ( ) . contains ( "(X)" ) || monomerNotation . getUnit ( ) . endsWith ( ")" ) ) { return true ; } return false ; }
method to check if the MonomerNotationUnitRNA contains modification
141,591
public static List < ConnectionNotation > hybridizeAntiparallel ( PolymerNotation one , PolymerNotation two ) throws RNAUtilsException , NotationException , HELM2HandledException , ChemistryException , NucleotideLoadingException { checkRNA ( one ) ; checkRNA ( two ) ; List < ConnectionNotation > connections = new Array...
method to hybridize two PolymerNotations together if they are antiparallel
141,592
public static String getSequence ( PolymerNotation one ) throws RNAUtilsException , HELM2HandledException , ChemistryException { checkRNA ( one ) ; List < Nucleotide > nucleotideList = getNucleotideList ( one ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < nucleotideList . size ( ) ; i ++ ) { sb . ap...
method to get the rna sequence of the given PolymerNotation
141,593
public static String getModifiedNucleotideSequence ( PolymerNotation polymer ) throws RNAUtilsException , HELM2HandledException , ChemistryException { checkRNA ( polymer ) ; List < Nucleotide > nucleotides = getNucleotideList ( polymer ) ; StringBuilder sb = new StringBuilder ( ) ; for ( Nucleotide nucleotide : nucleot...
method to get the modifiedNucleotideSequence of the given PolymerNotation
141,594
public static String getNucleotideSequence ( PolymerNotation polymer ) throws NotationException , RNAUtilsException , HELM2HandledException , NucleotideLoadingException , ChemistryException { List < Nucleotide > nucleotides = getNucleotideList ( polymer ) ; StringBuffer sb = new StringBuffer ( ) ; int count = 0 ; Map <...
method to get the nucleotide sequence for the polymer
141,595
public static List < Nucleotide > getNucleotideList ( PolymerNotation polymer ) throws RNAUtilsException , HELM2HandledException , ChemistryException { checkRNA ( polymer ) ; List < Nucleotide > nucleotides = new ArrayList < Nucleotide > ( ) ; List < MonomerNotation > monomerNotations = polymer . getPolymerElements ( )...
method to get all nucleotides for one polymer
141,596
public static String getTrimmedNucleotideSequence ( PolymerNotation polymer ) throws RNAUtilsException , HELM2HandledException , ChemistryException { checkRNA ( polymer ) ; List < Nucleotide > list = getNucleotideList ( polymer ) ; int start = 0 ; Nucleotide na = list . get ( start ) ; while ( null == na . getBaseMonom...
method to get the trimmed nucleotide sequence
141,597
public static JKExceptionHandlerFactory getInstance ( ) { if ( JKExceptionHandlerFactory . instance == null ) { JKExceptionHandlerFactory . instance = new JKExceptionHandlerFactory ( ) ; } return JKExceptionHandlerFactory . instance ; }
Gets the single instance of ExceptionHandlerFactory .
141,598
public void setHandler ( final Class < ? extends Throwable > clas , final JKExceptionHandler handler ) { this . handlers . put ( clas , handler ) ; }
Sets the handler .
141,599
public void registerHanders ( String packageString ) { List < String > list = AnnotationDetector . scanAsList ( ExceptionHandler . class , packageString ) ; for ( String handler : list ) { JKExceptionHandler < ? extends Throwable > newInstance = JKObjectUtil . newInstance ( handler ) ; Class < ? extends Throwable > cla...
Register handers .