public abstract class BatchMetadataParser extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BatchMetadataParser.Field |
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
defaults |
protected Map<String,String> |
fields |
protected boolean |
interactive |
Constructor and Description |
---|
BatchMetadataParser(Metadata metadata,
Map<String,String> fields,
boolean interactive) |
Modifier and Type | Method and Description |
---|---|
protected String |
choiceOf(String sampleName,
String title,
String[] choices,
String deflt)
Handles prompting for a choice out of a list of choices using integers.
|
protected Integer |
findOrganismId(String organism) |
protected LaneInfo |
generateLaneInfo(String laneNumber,
int studyTypeAccession)
Generates lane info with the given parameters.
|
protected RunInfo |
generateRunInfo(String runName,
String runDescription,
String studyTitle,
String studyDescription,
String studyCenterName,
String studyCenterProject,
String experimentName,
String experimentDescription,
String filePath,
int platformId,
int studyType,
boolean isPairedEnd,
String workflowType,
String assayType)
Generates a RunInfo object with the given parameters.
|
protected SampleInfo |
generateSampleInfo(String prettyName,
String projectCode,
String individualNumber,
String librarySourceTemplateType,
String tissueOrigin,
String tissueType,
String libraryType,
String librarySizeCode,
String barcode,
int organismId,
String targetedResequencing,
String tissuePreparation,
String sampleDescription,
String iusName,
String iusDescription)
Generates a sample info object given the fields, and prompts for null fields if the interactive flag is on.
|
protected void |
printLaneInfo(LaneInfo info,
Appendable writer) |
protected void |
printRunInfo(RunInfo info,
Appendable writer) |
protected void |
printSampleInfo(SampleInfo info,
Appendable writer) |
protected int |
promptAccession(String description,
int deflt,
net.sourceforge.seqware.pipeline.plugins.batchmetadatainjection.BatchMetadataParser.KeyVal[] values,
BatchMetadataParser.Field fieldName) |
protected int |
promptInteger(String description,
int deflt,
BatchMetadataParser.Field fieldName) |
protected int |
promptPositiveInteger(String description,
int deflt,
BatchMetadataParser.Field fieldName,
int lowNum,
int highNum) |
protected String |
promptString(String description,
String deflt,
BatchMetadataParser.Field fieldName) |
protected String |
promptString(String sampleName,
String title,
String[] choices,
String deflt,
BatchMetadataParser.Field fieldName)
Determine a value for a field 'title' of sample 'sampleName'.
|
protected String choiceOf(String sampleName, String title, String[] choices, String deflt)
sampleName
- the sample name used for the prompting messagetitle
- the name of the field that is being setchoices
- the list of choices for the value of 'title'deflt
- the default choice to fall back on, which can be one of the list of 'choices'. This is the string value, not the integer.protected RunInfo generateRunInfo(String runName, String runDescription, String studyTitle, String studyDescription, String studyCenterName, String studyCenterProject, String experimentName, String experimentDescription, String filePath, int platformId, int studyType, boolean isPairedEnd, String workflowType, String assayType)
runName
- studyTitle
- experimentName
- filePath
- platformId
- studyType
- assayType
- workflowType
- protected LaneInfo generateLaneInfo(String laneNumber, int studyTypeAccession)
laneNumber
- studyTypeAccession
- protected SampleInfo generateSampleInfo(String prettyName, String projectCode, String individualNumber, String librarySourceTemplateType, String tissueOrigin, String tissueType, String libraryType, String librarySizeCode, String barcode, int organismId, String targetedResequencing, String tissuePreparation, String sampleDescription, String iusName, String iusDescription) throws Exception
prettyName
- projectCode
- individualNumber
- librarySourceTemplateType
- tissueOrigin
- tissueType
- libraryType
- librarySizeCode
- barcode
- organismId
- targetedResequencing
- tissuePreparation
- iusDescription
- iusName
- Exception
protected int promptInteger(String description, int deflt, BatchMetadataParser.Field fieldName) throws joptsimple.OptionException
joptsimple.OptionException
protected int promptAccession(String description, int deflt, net.sourceforge.seqware.pipeline.plugins.batchmetadatainjection.BatchMetadataParser.KeyVal[] values, BatchMetadataParser.Field fieldName) throws joptsimple.OptionException
joptsimple.OptionException
protected String promptString(String description, String deflt, BatchMetadataParser.Field fieldName) throws joptsimple.OptionException
joptsimple.OptionException
protected String promptString(String sampleName, String title, String[] choices, String deflt, BatchMetadataParser.Field fieldName)
sampleName
- the sample name used for promptingtitle
- the name of the field being setchoices
- the list of choices (Strings) that the user can select from in interactive modedeflt
- the default string if everything else failsfieldName
- the Field that is used for command-line defaults.protected int promptPositiveInteger(String description, int deflt, BatchMetadataParser.Field fieldName, int lowNum, int highNum)
protected void printSampleInfo(SampleInfo info, Appendable writer)
protected void printRunInfo(RunInfo info, Appendable writer)
protected void printLaneInfo(LaneInfo info, Appendable writer)
Copyright © 2015 SeqWare. All rights reserved.