Skip to content

Instantly share code, notes, and snippets.

LukeGoodsell

Block or report user

Report or block LukeGoodsell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View reset.R
# Commands to completely reset the R session
# Close any connections
closeAllConnections()
# A function to unload a namespace without throwing an exception
catch_unload <- function(pkg) {
rmvd <- 0
tryCatch(
{
@LukeGoodsell
LukeGoodsell / unload_strict.R
Last active Sep 20, 2018
Unload strict library in R
View unload_strict.R
> T
[1] TRUE
> library("strict")
> T
Error: [strict]
Please use TRUE, not T
5: (function ()
{
@LukeGoodsell
LukeGoodsell / input_file_passing.nf
Created Aug 17, 2018
Passing input files to output channels without storing duplicates
View input_file_passing.nf
#!/usr/bin/env nextflow
in_ch = Channel.from(file("test.txt"))
process test {
storeDir 'out/1'
stageInMode 'rellink'
stageOutMode 'move'
input:
@LukeGoodsell
LukeGoodsell / listOfListsOfItems.nf
Last active Jun 20, 2017
Processing each item in a list of lists of items and re-nesting in Nextflow
View listOfListsOfItems.nf
#!/usr/bin/env nextflow
itemLists = [ [1, 2, 3, 4], [5, 6, 7], [8] ]
def groupIdx = 0
itemListChannel =
Channel
.from(itemLists)
.flatMap { it -> L:{ groupIdx++; it.collect { [ groupIdx, it ] } } }
@LukeGoodsell
LukeGoodsell / execFile.nf
Created Jun 20, 2017
Demo of taking input file with exec block
View execFile.nf
#!/usr/bin/env nextflow
process foo {
output:
file "out.txt" into fooFiles
shell:
'''
echo "hi" > "out.txt";
'''
@LukeGoodsell
LukeGoodsell / .nextflow.log
Last active Jun 19, 2017
Nextflow output value & Snakeyaml failure
View .nextflow.log
Jun-19 16:03:13.939 [Actor Thread 4] WARN nextflow.processor.TaskContext - Cannot serialize context map. Cause: java.lang.IllegalArgumentException: type cannot be null. -- Resume will not work on this process
Jun-19 16:03:13.942 [Actor Thread 4] DEBUG nextflow.processor.TaskContext - Failed to serialize delegate map items: [
'x':[null] = [firstName:Jane, lastName:Doe]
'$':[java.lang.Boolean] = true
'task':[nextflow.processor.TaskConfig] = [process:foo, index:2, echo:false, validExitStatus:[0], maxRetries:1, maxErrors:3, shell:[/bin/bash, -ue], executor:local, name:foo (2), cacheable:true, errorStrategy:TERMINATE, workDir:/Volumes/LG_01_WD3TB/tmp/preqctest/work/85/8e1bdbe341d5644034fd3e24426884, hash:858e1bdbe341d5644034fd3e24426884]
'paramsFilePath':[java.io.File] = /Volumes/LG_01_WD3TB/tmp/preqctest/work/85/8e1bdbe341d5644034fd3e24426884/params.yaml
'yaml':[org.yaml.snakeyaml.Yaml] = Yaml:94182769
]
com.esotericsoftware.kryo.KryoException: java.lang.IllegalArgumentException: type cannot be null.
You can’t perform that action at this time.