-
-
Save pditommaso/77847724c877a70ebe0dcf33b1175ef0 to your computer and use it in GitHub Desktop.
Using Bioclipse in Nextflow.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nextflow | |
@Grab(group='net.bioclipse.bacting', module='managers-cdk', version='0.0.3') | |
import net.bioclipse.managers.CDKManager | |
params.str = "./data.tsv" | |
params.size = 5000 | |
process splitWikidata { | |
input: | |
file str from Channel.fromPath(params.str) | |
output: | |
file 'chunk_*' into smiChunks | |
""" | |
cat $str | tail -n +2 | split -l ${params.size} - chunk_ | |
""" | |
} | |
process checkSMILES { | |
input: | |
val x from smiChunks | |
output: | |
stdout results | |
exec: | |
def cdk = new CDKManager("."); | |
new File(x).readLines().each { | |
def fields = it.split() | |
try { | |
// println "x: " + fields[1] | |
cdk.fromSMILES(fields[1]) | |
} catch (Exception exc) { | |
println fields[0] + ": " + exc.message | |
} | |
} | |
} | |
results.subscribe { | |
println it | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My fault. The input should be declared as: