org.forester.io.parsers.util
Class ParserUtils
java.lang.Object
org.forester.io.parsers.util.ParserUtils
public final class ParserUtils
- extends java.lang.Object
|
Method Summary |
static PhylogenyParser |
createParserDependingFileContents(java.io.File file,
boolean phyloxml_validate_against_xsd)
|
static PhylogenyParser |
createParserDependingOnFileType(java.io.File file,
boolean phyloxml_validate_against_xsd)
|
static PhylogenyParser |
createParserDependingOnSuffix(java.lang.String filename,
boolean phyloxml_validate_against_xsd)
Return null if it can not guess the parser to use based on name suffix. |
static PhylogenyParser |
createParserDependingOnUrlContents(java.net.URL url,
boolean phyloxml_validate_against_xsd)
|
static java.io.BufferedReader |
createReader(java.lang.Object source)
|
static java.lang.String |
extractTaxonomyCodeFromNodeName(java.lang.String name,
PhylogenyMethods.TAXONOMY_EXTRACTION taxonomy_extraction)
Extracts a code if and only if:
one and only one _,
shorter than 25,
no |,
no .,
if / present it has to be after the _,
if PFAM_STYLE_ONLY: / must be present,
tax code can only contain uppercase letters and numbers,
and must contain at least one uppercase letter. |
static Phylogeny[] |
readPhylogenies(java.io.File file)
|
static Phylogeny[] |
readPhylogenies(java.lang.String file_name)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ParserUtils
public ParserUtils()
createParserDependingFileContents
public static final PhylogenyParser createParserDependingFileContents(java.io.File file,
boolean phyloxml_validate_against_xsd)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
createParserDependingOnFileType
public static final PhylogenyParser createParserDependingOnFileType(java.io.File file,
boolean phyloxml_validate_against_xsd)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
createParserDependingOnSuffix
public static final PhylogenyParser createParserDependingOnSuffix(java.lang.String filename,
boolean phyloxml_validate_against_xsd)
- Return null if it can not guess the parser to use based on name suffix.
- Parameters:
filename -
- Returns:
createParserDependingOnUrlContents
public static final PhylogenyParser createParserDependingOnUrlContents(java.net.URL url,
boolean phyloxml_validate_against_xsd)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
createReader
public static java.io.BufferedReader createReader(java.lang.Object source)
throws java.io.IOException,
java.io.FileNotFoundException
- Throws:
java.io.IOException
java.io.FileNotFoundException
extractTaxonomyCodeFromNodeName
public static java.lang.String extractTaxonomyCodeFromNodeName(java.lang.String name,
PhylogenyMethods.TAXONOMY_EXTRACTION taxonomy_extraction)
- Extracts a code if and only if:
one and only one _,
shorter than 25,
no |,
no .,
if / present it has to be after the _,
if PFAM_STYLE_ONLY: / must be present,
tax code can only contain uppercase letters and numbers,
and must contain at least one uppercase letter.
Return null if no code extractable.
- Parameters:
name -
- Returns:
readPhylogenies
public static final Phylogeny[] readPhylogenies(java.io.File file)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
readPhylogenies
public static final Phylogeny[] readPhylogenies(java.lang.String file_name)
throws java.io.FileNotFoundException,
java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException