#@UGENE_WORKFLOW #For each input multiple alignment the workflow calculates the consensus and saves it to a text file, named according to the name of the input alignment. # #The JalView algorithm (denoted as "default") is used by default to calculate the consensus. For each column of the alignment it returns either "+", if there are 2 characters with high frequency in this column, or a character in uppercase or lowercase. The case of the character depends on the percentage value of the character in the column and the "threshold" value. # #Alternatively, you can use the ClustalW algorithm to calculate the consensus: # - If all characters in a column are exactly the same, the algorithm sets asterisk value ("*") to the corresponding position of the consensus. # - A colon value (":") indicates conservation between groups of strongly similar properties, i.e. the scoring value is greater than 0.5 in the Gonnet PAM 250 matrix (see documentation for details). # - If the scoring value is less than 0.5, the period (".") value is inserted. # - Otherwise, the algorithm inserts space (" "). #The "threshold" parameter is not applied to this algorithm. workflow "Extract consensus as text"{ read-msa { type:read-msa; name:"Read Alignment"; url-in { dataset:"Dataset 1"; } } write-text { type:write-text; name:"Write Plain Text"; url-out { var re = /[\\\/]/; var tokens = url.toString().split(re); var dir = ""; if (tokens.length > 0) { dir = tokens[tokens.length-1]; } url_out = dir + "_consensus.txt" }; write-mode:0; } extract-msa-consensus-string { type:extract-msa-consensus-string; name:"Extract Consensus from Alignment as Text"; algorithm:Clustal; } .actor-bindings { read-msa.out-msa->extract-msa-consensus-string.in-msa extract-msa-consensus-string.out-text->write-text.in-text } extract-msa-consensus-string.text->write-text.in-text.text read-msa.msa->extract-msa-consensus-string.in-msa.msa .meta { parameter-aliases { read-msa.url-in { alias:in; } extract-msa-consensus-string.algorithm { alias:algorithm; } extract-msa-consensus-string.threshold { alias:threshold; } } visual { extract-msa-consensus-string { pos:"-480 -600"; style:ext; bg-color-ext:"0 128 0 64"; in-msa.angle:180; out-text.angle:360; } read-msa { pos:"-720 -600"; style:ext; bg-color-ext:"24 102 175 64"; bounds:"-30 -30 68.25 69"; out-msa.angle:360; } write-text { pos:"-165 -600"; style:ext; bg-color-ext:"64 26 96 64"; bounds:"-30 -30 102 73"; in-text.angle:180; } extract-msa-consensus-string.out-text->write-text.in-text { text-pos:"-30 -24"; } read-msa.out-msa->extract-msa-consensus-string.in-msa { text-pos:"-45 -50"; } } wizard { name:"Extract Alignment Consensus as Text"; help-page-id:16122702; auto-run: true; page { id:1; next:2; title:"Input Multiple Alighments"; parameters-area { read-msa.url-in { type:datasets; } } } page { id:2; next:3; title:"Extracting Consensus Settings"; parameters-area { group { title:"Extracting Consensus as Text Worker Settings"; label-size:120; extract-msa-consensus-string.algorithm { } extract-msa-consensus-string.threshold { } } } } page { id:3; title:"Output Files"; parameters-area { label { text:"For each input alignment the workflow outputs separate text file with consensus in it."; background-color:rgb(203,222,228); } } } } } }