joergen7 / cuneiform

Cuneiform distributed programming language
https://cuneiform-lang.org/
Apache License 2.0
232 stars 16 forks source link

EnumHelper has problems enumerating nested correlation #8

Closed joergen7 closed 10 years ago

joergen7 commented 10 years ago
deftask analysis( target( File ) : [ fastq1( File ) fastq2( File ) ] [ ref( File ) refdict( File ) reffai( File ) knownVariants( File )  refindextar( File ) ] library platform platformunit samplename ) {
    //Align seperately
    sai1 = map( reference:ref indextar:refindextar read:fastq1 );
    sai2 = map( reference:ref indextar:refindextar read:fastq2 );
    //Combine all
    sam = align( reference:ref indextar:refindextar fwdsai:sai1 revsai:sai2 fwdfq:fastq1 revfq:fastq2 );

    bam = sort( inputsam:sam );
    bam1 = dedup( inputbam:bam );
    bam1-1 = addOrReplaceReadGroups( inputbam:bam1 library:lib  platform:platf platformunit:platfu samplename:samna );
    bam2 = validateBam( inputbam:bam1-1 );

    bami = indexBam( inputbam : bam2 );
    intervals = realignerTargetCreator( reference:ref inputbam:bam2 dict:refdict fai:reffai bami:bami );
    bam3 = realign( reference:ref inputbam:bam2 targetintervals:intervals dict:refdict fai:reffai bami:bami);

    recal = baseRecalibration( reference:ref inputbam:bam3 dict:refdict fai:reffai bami:bami known:knownVariants);
    bam4 = printReads( reference:ref inputbam:bam3 dict:refdict fai:reffai bami:bami recalgroup:recal );

    bami2 = indexBam( inputbam: bam4 );

    vcf = unifyGenotyper( reference:ref inputbam:bam4 dict:refdict fai:reffai bami:bami2 );

    target = vcf;
}

deftask analyseReference( newref( File ) refdict( File ) reffai( File ) indextar( File ) : reference( File ) ) {
    ref = gunzip( gz: ref-gz );
    indextar = bwa-idx( reference: ref );
    newref refdict reffai = indexReference( reference: ref );
}

deftask startWorkflow( vcf( File ) : [ fastq1( File ) fastq2( File ) ] [ ref-gz( File ) knownVariants( File ) ] library platform platformunit samplename ) {
    ref refdict reffai indextar = analyseReference( reference: ref-gz );
    vcf = analysis( fastq1:fastq1 fastq2:fastq2 ref:ref refdict:refdict reffai:reffai knownVariants:knownVariants refindextar:indextar library:lib platform:platf platformunit:platfu samplename:samna );
}

startWorkflow( fastq1:fastq1 fastq2:fastq2 ref-gz:ref-gz knownVariants:known-variants library:lib platform:platf platformunit:platfu samplename:samna );