Class Normalization
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.modules.diffana.Normalization
-
-
Field Summary
Fields Modifier and Type Field Description protected Design
design
protected RExecutor
executor
protected String
expressionFilesPrefix
protected String
expressionFilesSuffix
protected static String
NORMALIZATION_FUNCTIONS
protected RSConnection
rConnection
protected static String
TARGET_CREATION
-
Constructor Summary
Constructors Constructor Description Normalization(RExecutor executor, Design design)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkRepTechGroupCoherence(List<String> rRepTechGroup, List<String> rCondNames)
Check if there is a problem in the repTechGroup coherence.protected String
escapeUnderScore(String s)
Escape underscore for LaTeX title.protected void
generateConditionPart(List<String> rCondNames, StringBuilder sb)
Add condition vector to R script.protected void
generateExpressionFileNamesPart(StringBuilder sb)
Add expression file name vector to R script.protected void
generateRepTechGroupPart(List<String> rRepTechGroup, StringBuilder sb)
Write the section of the script that handle technical replicate groups.protected StringBuilder
generateRnwpreamble(List<Sample> experimentSamplesList, String title, String filePrefix)
Write Rnw preamble.protected void
generateSampleIdsPart(List<Integer> rSampleIds, StringBuilder sb)
Add SampleIds vector to R script.protected void
generateSampleNamePart(List<String> rSampleNames, StringBuilder sb)
Add sampleNames vector to R script.protected String
generateScript(Experiment experiment, TaskContext context)
Generate the R script.protected boolean
isTechnicalReplicates(List<String> rRepTechGroup)
Test if there is Technical replicates into rRepTechGroup field.protected String
readStaticScript(String staticFile)
Read a static part of the generated script.protected void
replaceRtgNA(List<String> rRepTechGroup, List<String> rSampleNames)
Replace na values in RepTechGroup list to avoid pooling error.void
run(TaskContext context, Data data)
Run normalisation stepprotected void
runRExecutor(TaskContext context, Data data)
Execute Rnw script.
-
-
-
Field Detail
-
TARGET_CREATION
protected static final String TARGET_CREATION
- See Also:
- Constant Field Values
-
NORMALIZATION_FUNCTIONS
protected static final String NORMALIZATION_FUNCTIONS
- See Also:
- Constant Field Values
-
design
protected final Design design
-
expressionFilesPrefix
protected final String expressionFilesPrefix
-
expressionFilesSuffix
protected final String expressionFilesSuffix
-
rConnection
protected RSConnection rConnection
-
executor
protected final RExecutor executor
-
-
Constructor Detail
-
Normalization
public Normalization(RExecutor executor, Design design) throws EoulsanException
Public constructor.- Parameters:
executor
- executor to use to execute the normalizationdesign
- The design object- Throws:
EoulsanException
- if an error occurs if connection to RServe server cannot be established
-
-
Method Detail
-
run
public void run(TaskContext context, Data data) throws EoulsanException
Run normalisation step- Throws:
EoulsanException
- if the number of sample to analyze if lower than one
-
runRExecutor
protected void runRExecutor(TaskContext context, Data data) throws EoulsanException
Execute Rnw script.- Parameters:
context
- Step contextdata
- data to process- Throws:
EoulsanException
- if an error occurs while executing the script
-
isTechnicalReplicates
protected boolean isTechnicalReplicates(List<String> rRepTechGroup)
Test if there is Technical replicates into rRepTechGroup field.- Parameters:
rRepTechGroup
- list of the technical replicate group
-
readStaticScript
protected String readStaticScript(String staticFile) throws EoulsanException
Read a static part of the generated script.- Parameters:
staticFile
- the name of a file containing a part of the script- Returns:
- A String with the static part of the script
- Throws:
EoulsanException
- if an error occurs while reading the script
-
generateScript
protected String generateScript(Experiment experiment, TaskContext context) throws EoulsanException
Generate the R script.- Parameters:
experiment
- the experimentcontext
- step context- Returns:
- String rScript R script to execute
- Throws:
EoulsanException
- if an error occurs while generate the R script
-
generateRnwpreamble
protected StringBuilder generateRnwpreamble(List<Sample> experimentSamplesList, String title, String filePrefix)
Write Rnw preamble.- Parameters:
experimentSamplesList
- sample experiment listtitle
- title of the documentfilePrefix
- Sweave file prefix- Returns:
- a StringBuilder with Rnw preamble
-
generateSampleNamePart
protected void generateSampleNamePart(List<String> rSampleNames, StringBuilder sb)
Add sampleNames vector to R script.- Parameters:
rSampleNames
- sample namessb
- StringBuilder where write the part of the script
-
generateSampleIdsPart
protected void generateSampleIdsPart(List<Integer> rSampleIds, StringBuilder sb)
Add SampleIds vector to R script.- Parameters:
rSampleIds
- samples identifierssb
- StringBuilder where write the part of the script
-
generateExpressionFileNamesPart
protected void generateExpressionFileNamesPart(StringBuilder sb)
Add expression file name vector to R script.- Parameters:
sb
- StringBuilder where write the part of the script
-
generateRepTechGroupPart
protected void generateRepTechGroupPart(List<String> rRepTechGroup, StringBuilder sb)
Write the section of the script that handle technical replicate groups.- Parameters:
rRepTechGroup
- list of technical replicate groupssb
- StringBuilder where write the part of the script
-
generateConditionPart
protected void generateConditionPart(List<String> rCondNames, StringBuilder sb)
Add condition vector to R script.- Parameters:
rCondNames
- condition namessb
- StringBuilder where write the part of the script
-
checkRepTechGroupCoherence
protected void checkRepTechGroupCoherence(List<String> rRepTechGroup, List<String> rCondNames) throws EoulsanException
Check if there is a problem in the repTechGroup coherence.- Parameters:
rRepTechGroup
- technical replicate grouprCondNames
- condition names- Throws:
EoulsanException
- if an error if found in the design file
-
escapeUnderScore
protected String escapeUnderScore(String s)
Escape underscore for LaTeX title.- Parameters:
s
- string to escape- Returns:
- s with escaped underscore
-
-