@@ -128,7 +128,7 @@ protected File createRmd(SequenceOutputHandler.JobContext ctx, List<SeuratObject
128128 try (PrintWriter out = PrintWriters .getPrintWriter (outfile ))
129129 {
130130 Markdown markdown = new Markdown ();
131- markdown .headerYml = getDefaultHeader ();
131+ markdown .headerYml = markdown . getDefaultHeader ();
132132 markdown .setup = new SetupChunk (getRLibraries ());
133133 markdown .chunks = new ArrayList <>();
134134 markdown .chunks .add (createParamChunk (inputObjects , outputPrefix ));
@@ -145,28 +145,6 @@ protected File createRmd(SequenceOutputHandler.JobContext ctx, List<SeuratObject
145145 return outfile ;
146146 }
147147
148- protected List <String > getDefaultHeader ()
149- {
150- List <String > ret = new ArrayList <>();
151-
152- ret .add ("title: \" Single Cell Report\" " );
153- ret .add ("date: \" `r Sys.Date()`\" " );
154- ret .add ("output:" );
155- ret .add (" rmdformats::html_clean:" );
156- ret .add (" highlight: kate" );
157- ret .add (" self_contained: true" );
158- ret .add (" thumbnails: true" );
159- ret .add (" fig_width: 12" );
160- ret .add (" code_folding: hide" );
161- ret .add (" keep_md: true" );
162- ret .add (" gallery: true" );
163- ret .add (" lightbox: true" );
164- ret .add (" cache: false" );
165- ret .add (" df_print: paged" );
166-
167- return ret ;
168- }
169-
170148 protected List <Chunk > getChunks () throws PipelineJobException
171149 {
172150 List <Chunk > ret = new ArrayList <>();
@@ -183,9 +161,9 @@ public boolean requiresHashingOrCiteSeq()
183161
184162 public static class Markdown
185163 {
186- List <Chunk > chunks ;
187- Chunk setup ;
188- List <String > headerYml ;
164+ public List <Chunk > chunks ;
165+ public Chunk setup ;
166+ public List <String > headerYml ;
189167
190168 public void print (PrintWriter out )
191169 {
@@ -196,6 +174,28 @@ public void print(PrintWriter out)
196174
197175 chunks .forEach (chunk -> chunk .print (out ));
198176 }
177+
178+ public List <String > getDefaultHeader ()
179+ {
180+ List <String > ret = new ArrayList <>();
181+
182+ ret .add ("title: \" Single Cell Report\" " );
183+ ret .add ("date: \" `r Sys.Date()`\" " );
184+ ret .add ("output:" );
185+ ret .add (" rmdformats::html_clean:" );
186+ ret .add (" highlight: kate" );
187+ ret .add (" self_contained: true" );
188+ ret .add (" thumbnails: true" );
189+ ret .add (" fig_width: 12" );
190+ ret .add (" code_folding: hide" );
191+ ret .add (" keep_md: true" );
192+ ret .add (" gallery: true" );
193+ ret .add (" lightbox: true" );
194+ ret .add (" cache: false" );
195+ ret .add (" df_print: paged" );
196+
197+ return ret ;
198+ }
199199 }
200200
201201 protected void executeR (SequenceOutputHandler .JobContext ctx , File rmd , String outputPrefix ) throws PipelineJobException
@@ -383,11 +383,17 @@ public static class Chunk
383383 List <String > bodyLines ;
384384
385385 public Chunk (String chunkName , @ Nullable String header , @ Nullable String extraText , List <String > bodyLines )
386+ {
387+ this (chunkName , header , extraText , bodyLines , null );
388+ }
389+
390+ public Chunk (String chunkName , @ Nullable String header , @ Nullable String extraText , List <String > bodyLines , String chunkOpts )
386391 {
387392 this .chunkName = chunkName ;
388393 this .extraText = extraText ;
389394 this .header = header ;
390395 this .bodyLines = new ArrayList <>(bodyLines );
396+ this .chunkOpts = chunkOpts ;
391397 }
392398
393399 public void print (PrintWriter out )
@@ -423,4 +429,13 @@ public SetupChunk(Collection<String> libraries)
423429 chunkOpts = "include=FALSE" ;
424430 }
425431 }
432+
433+ public static class SessionInfoChunk extends Chunk
434+ {
435+ public SessionInfoChunk ()
436+ {
437+ super ("sessionInfo" , "Session Info" , null , new ArrayList <>());
438+ bodyLines .add ("sessionInfo()" );
439+ }
440+ }
426441}
0 commit comments