Skip to content

Instantly share code, notes, and snippets.

View thanhpp's full-sized avatar
👽
cerca trova

Phan Phú Thành thanhpp

👽
cerca trova
View GitHub Profile
@thanhpp
thanhpp / wfBuildMap.go
Created July 31, 2020 09:09
bug in golang function
//BuildMap export a simple link map from graphviz
func BuildMap(name string, path string) (eMap *ExportMap, err error) {
gr, err := readGraphvizFile(path)
if err != nil {
return nil, err
}
s, err := linkNode(gr)
if err != nil {
return nil, err
{
"dag_id": 1,
"dag_run_id": "1-1-0",
"user_id": 1,
"jobs": [
{
"job_id": "1-1-0-1-0",
"is_boundary": false,
"task_id": "1-0",
"dag_run_id": "1-1-0",
{
"dag_id": 1,
"dag_run_id": "1-1-0",
"user_id": 1,
"jobs": [
{
"job_id": "1-1-0-1-0",
"is_boundary": false,
"task_id": "1-0",
"dag_run_id": "1-1-0",
{
"dag_id": 1,
"dag_run_id": "1-1-0",
"user_id": 1,
"jobs": [
{
"job_id": "1-1-0-1-0",
"is_boundary": false,
"task_id": "1-0",
"dag_run_id": "1-1-0",
{
"dag_id": 1,
"dag_run_id": "1-1-0",
"user_id": 1,
"jobs": [
{
"job_id": "1-1-0-1-0",
"is_boundary": false,
"task_id": "1-0",
"dag_run_id": "1-1-0",
{
"dag_id": 2,
"dag_run_id": "2-1-0",
"user_id": 1,
"jobs": [
{
"job_id": "2-1-0-2-0",
"is_boundary": false,
"task_id": "2-0",
"dag_run_id": "2-1-0",
@thanhpp
thanhpp / reply.json
Last active September 30, 2020 02:17
{{host}}:{{port}}/dag
{
"Error": {
"Code": 200,
"Message": "Created DAG"
},
"Data": {
"dag_id": 1,
"dag_name": "#main",
"user_id": 1,
"tasks": [
out_folder='/home/nguyen/testpackage2/'
data_folder='/home/nguyen/testpackage2/fastq/'
ref_gen='/home/nguyen/ref37/ref37'
ref_fasta='/home/nguyen/ref37/ref37.fa'
ref_dict='/home/nguyen/ref37/ref37.dict'
dbsnp='/home/nguyen/ref37/dbsnp_138.hg19.vcf'
target='/home/nguyen/testpackage2/BED/RB1_padding_100.bed'
NCORE=20
file1=`find $data_folder -type f \( -iname \*1.fastq \)`
file2=`find $data_folder -type f \( -iname \*2.fastq \)`
Create DAG run with Input:
{{host}}:{{port}}/dag/converttorunwithinputs
Send to scheduler:
{{host}}:{{port}}/job/sendjob
API docs:
https://documenter.getpostman.com/view/10191781/TVRd8B32
func appendString(strSl []string, data interface{}) (err error) {
switch castedData := data.(type) {
case string:
strSl = append(strSl, castedData)
return nil
case []string:
strSl = append(strSl, castedData...)
return nil