WDL-第4學(xué)

問題:用flash批量完成數(shù)據(jù)的拼接,這里面學(xué)到的知識點

  • struct構(gòu)建reads的批量輸入
  • 可選擇參數(shù)

解決辦法:

來源于bioWDL的一個例子

  • flash.wdl
version 1.0
struct FastqPair {
    String sample
    File R1
    File R2
}
task Flash {
    input {
        FastqPair inputFastq
        String outdirPath
        Boolean compress = true
        ## 可選擇
        String preCommand = ''
        Int? minOverlap
        Int? maxOverlap
        Int threads = 2
    }
    String outdir = outdirPath + "/" + inputFastq.sample + "/"
    String outPrefix = inputFastq.sample
    ## 相關(guān)命令
    command <<<
        set -e -o pipefail
        rm -rf ~{outdir}
        mkdir -p ~{outdir}
        cd ~{outdir}
        ~{preCommand}
        flash \
        ~{"--threads=" + threads} \
        ~{"--output-directory=" + outdir} \
        ~{'--output-prefix=' + inputFastq.sample} \
        ~{true="--compress " false="" compress} \
        ~{"--min-overlap=" + minOverlap} \
        ~{"--max-overlap=" + maxOverlap} \
        ~{inputFastq.R1} ~{inputFastq.R2}
    >>>
    output {
        File extendedFrags = outdir + "/" + outPrefix + ".extendedFrags.fastq.gz"
        File notCombined1  = outdir + "/" + outPrefix + ".notCombined_1.fastq.gz"
        File notCombined2  = outdir + "/" + outPrefix + ".notCombined_2.fastq.gz"
        FastqPair notCombined = object {
            R1: notCombined1,
            R2: notCombined2,
            sample: outPrefix
        }
        File hist = outdir + "/" + outPrefix + ".hist"
        File histogram = outdir + "/" + outPrefix + ".histogram"
    }
}
workflow wf_flash {
    input {
        String outdirPath
        Boolean compress = true
        String preCommand = ''
        Int? minOverlap
        Int? maxOverlap
        Int threads = 2
        Array[FastqPair] fastqs
    }
    scatter (fastq in fastqs){
        call Flash {
            input:
                outdirPath = outdirPath,
                compress = compress,
                preCommand = preCommand,
                minOverlap = minOverlap,
                maxOverlap = maxOverlap,
                threads = 2,
                inputFastq = fastq
        }
    }
}
  • flash.json文件
{
  "wf_flash.preCommand": "export PATH=/your_path/FLASH-1.2.7/:$PATH",
  "wf_flash.fastqs": [
      {"sample":"sample1", "R1":"/your_path/sample1_t1.fastq", "R2":"/your_path/sample1_t2.fastq"},
      {"sample":"sample2", "R1":"/your_path/sample2_t1.fastq", "R2":"/your_path/sample2_t2.fastq"}
   ],
  "wf_flash.outdirPath": "/your_path/flash_out"
}
  • 執(zhí)行及輸出信息
$ java -jar cromwell-57.jar run flash.wdl --inputs flash.json
{
  "outputs": {
    "wf_flash.Flash.notCombined2": ["/your_path/sample1.notCombined_2.fastq.gz", "/your_path/sample2.notCombined_2.fastq.gz"],
    "wf_flash.Flash.notCombined1": ["/your_path/sample1.notCombined_1.fastq.gz", "/your_path/sample2.notCombined_1.fastq.gz"],
    "wf_flash.Flash.hist": ["/your_path/sample1.hist", "/your_path/sample2.hist"],
    "wf_flash.Flash.histogram": ["/your_path/sample1.histogram", "/your_path/sample2.histogram"],
    "wf_flash.Flash.extendedFrags": ["/your_path/sample1.extendedFrags.fastq.gz", "/your_path/sample2.extendedFrags.fastq.gz"],
    "wf_flash.Flash.notCombined": [{
      "R1": "/your_path/sample1.notCombined_1.fastq.gz",
      "sample": "sample1",
      "R2": "/your_path/sample1.notCombined_2.fastq.gz"
    }, {
      "R1": "/your_path/sample2.notCombined_1.fastq.gz",
      "sample": "sample2",
      "R2": "/your_path/sample2.notCombined_2.fastq.gz"
    }]
  },
  "id": "c7b6b5ce-3fa9-418a-89fb-16afe694e932"
}
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末歹袁,一起剝皮案震驚了整個濱河市犀变,隨后出現(xiàn)的幾起案子挨约,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 216,372評論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異涩嚣,居然都是意外死亡,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,368評論 3 392
  • 文/潘曉璐 我一進店門航厚,熙熙樓的掌柜王于貴愁眉苦臉地迎上來顷歌,“玉大人,你說我怎么就攤上這事幔睬∶袖觯” “怎么了?”我有些...
    開封第一講書人閱讀 162,415評論 0 353
  • 文/不壞的土叔 我叫張陵溪窒,是天一觀的道長。 經(jīng)常有香客問我冯勉,道長澈蚌,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,157評論 1 292
  • 正文 為了忘掉前任灼狰,我火速辦了婚禮宛瞄,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘交胚。我一直安慰自己份汗,他們只是感情好,可當我...
    茶點故事閱讀 67,171評論 6 388
  • 文/花漫 我一把揭開白布蝴簇。 她就那樣靜靜地躺著杯活,像睡著了一般。 火紅的嫁衣襯著肌膚如雪熬词。 梳的紋絲不亂的頭發(fā)上旁钧,一...
    開封第一講書人閱讀 51,125評論 1 297
  • 那天,我揣著相機與錄音互拾,去河邊找鬼歪今。 笑死,一個胖子當著我的面吹牛颜矿,可吹牛的內(nèi)容都是我干的寄猩。 我是一名探鬼主播,決...
    沈念sama閱讀 40,028評論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼骑疆,長吁一口氣:“原來是場噩夢啊……” “哼田篇!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起箍铭,我...
    開封第一講書人閱讀 38,887評論 0 274
  • 序言:老撾萬榮一對情侶失蹤斯辰,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后坡疼,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體彬呻,經(jīng)...
    沈念sama閱讀 45,310評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,533評論 2 332
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了闸氮。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片剪况。...
    茶點故事閱讀 39,690評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖蒲跨,靈堂內(nèi)的尸體忽然破棺而出译断,到底是詐尸還是另有隱情,我是刑警寧澤或悲,帶...
    沈念sama閱讀 35,411評論 5 343
  • 正文 年R本政府宣布孙咪,位于F島的核電站,受9級特大地震影響巡语,放射性物質(zhì)發(fā)生泄漏翎蹈。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,004評論 3 325
  • 文/蒙蒙 一男公、第九天 我趴在偏房一處隱蔽的房頂上張望荤堪。 院中可真熱鬧,春花似錦枢赔、人聲如沸澄阳。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,659評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽碎赢。三九已至,卻和暖如春速梗,著一層夾襖步出監(jiān)牢的瞬間揩抡,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,812評論 1 268
  • 我被黑心中介騙來泰國打工镀琉, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留峦嗤,地道東北人。 一個月前我還...
    沈念sama閱讀 47,693評論 2 368
  • 正文 我出身青樓屋摔,卻偏偏與公主長得像烁设,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子钓试,可洞房花燭夜當晚...
    茶點故事閱讀 44,577評論 2 353

推薦閱讀更多精彩內(nèi)容