Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .swo
Binary file not shown.
Binary file added .swp
Binary file not shown.
749 changes: 624 additions & 125 deletions src/MGRAST/lib/resources/inbox.pm

Large diffs are not rendered by default.

35 changes: 34 additions & 1 deletion src/MGRAST/lib/resources/resource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@ sub get_download_set {
stage_name => $attr->{stage_name},
data_type => $attr->{data_type},
file_id => $file_id,
file_name => $file->{name},
file_size => $file->{size} || undef,
file_md5 => $file->{checksum}{md5} || undef
};
Expand All @@ -623,6 +622,40 @@ sub get_download_set {
if ($data->{stage_name} =~ /\.cluster$/) {
$data->{stage_name} .= ($attr->{data_type} eq 'cluster') ? '.map' : '.seq';
}
# build proper file name
my $suffix = "";
if (exists $data->{cluster_percent}) {
my $seqtype = (exists($data->{seq_format}) && ($data->{seq_format} eq 'bp')) ? 'rna' : 'aa';
$suffix = ".cluster.".$seqtype.$data->{cluster_percent};
if ($data->{data_type} eq "cluster") {
$suffix .= '.mapping';
} elsif ($seqtype eq 'rna') {
$suffix .= '.fna';
} elsif ($seqtype eq 'aa') {
$suffix .= '.faa';
}
}
elsif (($data->{data_type} =~ /^sequence|passed|removed$/) && exists($data->{file_format})) {
$suffix = ".".$data->{stage_name};
if ($data->{file_format} eq 'fastq') {
$suffix .= '.fastq';
} elsif (exists($data->{seq_format}) && ($data->{seq_format} eq 'bp')) {
$suffix .= '.fna';
} elsif (exists($data->{seq_format}) && ($data->{seq_format} eq 'aa')) {
$suffix .= '.faa';
}
} elsif ($data->{stage_name} eq 'filter.sims') {
$suffix = '.annotation.sims.filter.seq';
} elsif ($data->{data_type} eq 'lca') {
$suffix = '.annotation.lca.summary';
} elsif ($data->{data_type} eq 'coverage') {
$suffix = '.assembly.coverage';
} elsif ($data->{data_type} eq 'statistics') {
$suffix = '.statistics.json';
} else {
$suffix = ".".$data->{stage_name};
}
$data->{file_name} = $data->{id}.".".$data->{stage_id}.$suffix;
push @$stages, $data;
}
return $stages;
Expand Down
43 changes: 43 additions & 0 deletions src/MGRAST/workflows/demultiplex.awf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"info": {
"pipeline": "inbox_demultiplex",
"name": "[% job_name %]",
"user": "[% user_id %]",
"clientgroups":"[% clientgroups %]",
"userattr": {
"type": "inbox",
"id": "[% user_id %]",
"user": "[% user_name %]",
"email": "[% user_email %]"
}
},
"tasks": [
{
"cmd": {
"args": "-f [% file_type %] -b @[% bar_file %] -i @[% seq_file %]",
"description": "demultiplex",
"name": "demultiplex.py"
},
"dependsOn": [],
"inputs": {
"[% seq_file %]": {
"host": "[% shock_url %]",
"node": "[% seq_file_id %]"
},
"[% bar_file %]": {
"host": "[% shock_url %]",
"node": "[% bar_file_id %]"
}
},
"outputs": {[% outputs %]
},
"userattr": {
"file_format": "[% file_type %]",
"seq_format": "bp",
"parent_file": "[% seq_file_id %]"
},
"taskid": "0",
"totalwork": 1
}
]
}
49 changes: 49 additions & 0 deletions src/MGRAST/workflows/pair_join.awf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"info": {
"pipeline": "inbox_pair_join",
"name": "[% job_name %]",
"user": "[% user_id %]",
"clientgroups":"[% clientgroups %]",
"userattr": {
"type": "inbox",
"id": "[% user_id %]",
"user": "[% user_name %]",
"email": "[% user_email %]"
}
},
"tasks": [
{
"cmd": {
"args": "[% retain %]-m 8 -p 10 -t . -o [% out_file %] @[% p1_file %] @[% p2_file %]",
"description": "merge mate-pairs",
"name": "pairend_join.py"
},
"dependsOn": [],
"inputs": {
"[% p1_file %]": {
"host": "[% shock_url %]",
"node": "[% p1_file_id %]"
},
"[% p2_file %]": {
"host": "[% shock_url %]",
"node": "[% p2_file_id %]"
}
},
"outputs": {
"[% out_file %]": {
"host": "[% shock_url %]",
"node": "-",
"attrfile": "userattr.json"
}
},
"userattr": {
"file_format": "fastq",
"seq_format": "bp",
"parent_file_1": "[% p1_file_id %]",
"parent_file_2": "[% p2_file_id %]"
},
"taskid": "0",
"totalwork": 1
}
]
}
110 changes: 110 additions & 0 deletions src/MGRAST/workflows/pair_join_demultiplex.awf
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"info": {
"pipeline": "inbox_pair_join_demultiplex",
"name": "[% job_name %]",
"user": "[% user_id %]",
"clientgroups":"[% clientgroups %]",
"userattr": {
"type": "inbox",
"id": "[% user_id %]",
"user": "[% user_name %]",
"email": "[% user_email %]"
}
},
"tasks": [
{
"cmd": {
"args": "[% retain %]-m 8 -p 10 -t . -r -i [% index_file %] -o [% prefix %].join.fastq @[% p1_file %] @[% p2_file %]",
"description": "merge mate-pairs",
"name": "pairend_join.py"
},
"dependsOn": [],
"inputs": {
"[% p1_file %]": {
"host": "[% shock_url %]",
"node": "[% p1_file_id %]"
},
"[% p2_file %]": {
"host": "[% shock_url %]",
"node": "[% p2_file_id %]"
},
"[% index_file %]": {
"host": "[% shock_url %]",
"node": "[% index_id %]"
}
},
"outputs": {
"[% prefix %].join.fastq": {
"host": "[% shock_url %]",
"node": "-",
"attrfile": "userattr.json"
}
},
"userattr": {
"file_format": "fastq",
"seq_format": "bp",
"parent_file_1": "[% p1_file_id %]",
"parent_file_2": "[% p2_file_id %]"
},
"taskid": "0",
"totalwork": 1
},
{
"cmd": {
"args": "-r -i @[% index_file %] -p [% prefix %] -o [% prefix %].barcodes.txt",
"description": "build barcodes",
"name": "index2barcode.py"
},
"dependsOn": [],
"inputs": {
"[% index_file %]": {
"host": "[% shock_url %]",
"node": "[% index_id %]"
}
},
"outputs": {
"[% prefix %].barcodes.txt": {
"host": "[% shock_url %]",
"node": "-",
"attrfile": "userattr.json"
}
},
"userattr": {
"file_format": "text",
"parent_file": "[% index_id %]"
},
"taskid": "1",
"totalwork": 1
},
{
"cmd": {
"args": "-f fastq -b @[% prefix %].barcodes.txt -i @[% prefix %].join.fastq",
"description": "demultiplex",
"name": "demultiplex.py"
},
"dependsOn": ["0", "1"],
"inputs": {
"[% prefix %].join.fastq": {
"host": "[% shock_url %]",
"origin": "0",
"node": "-"
},
"[% prefix %].barcodes.txt": {
"host": "[% shock_url %]",
"origin": "1",
"node": "-"
}
},
"outputs": {[% outputs %]
},
"userattr": {
"file_format": "fastq",
"seq_format": "bp",
"parent_file_1": "[% p1_file_id %]",
"parent_file_2": "[% p2_file_id %]"
},
"taskid": "0",
"totalwork": 1
}
]
}
24 changes: 12 additions & 12 deletions src/MGRAST/workflows/seq_stats.awf
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"info": {
"pipeline": "seq_stats",
"pipeline": "inbox_seq_stats",
"name": "[% job_name %]",
"user": "[% user_id %]",
"clientgroups":"[% clientgroups %]"
},
},
"tasks": [
{
"cmd": {
"args": "-input=@inputfile -input_json=input_attr.json -output_json=output_attr.json -type=[% file_type %]",
"description": "seq_stats",
"args": "-input=@[% seq_file %] -input_json=input_attr.json -output_json=output_attr.json -type=[% file_type %]",
"description": "sequence stats",
"name": "awe_seq_length_stats.pl"
},
"dependsOn": [],
},
"dependsOn": [],
"inputs": {
"inputfile": {
"[% seq_file %]": {
"host": "[% shock_url %]",
"node": "[% input_file_id %]",
"node": "[% seq_file_id %]",
"attrfile": "input_attr.json"
}
},
},
"outputs": {
"inputfile": {
"[% seq_file %]": {
"host": "[% shock_url %]",
"node": "[% input_file_id %]",
"node": "[% seq_file_id %]",
"type": "update",
"attrfile": "output_attr.json"
}
},
"taskid": "0",
"taskid": "0",
"totalwork": 1
}
]
Expand Down
44 changes: 44 additions & 0 deletions src/MGRAST/workflows/sff_to_fastq.awf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"info": {
"pipeline": "inbox_sff_to_fastq",
"name": "[% job_name %]",
"user": "[% user_id %]",
"clientgroups":"[% clientgroups %]",
"userattr": {
"type": "inbox",
"id": "[% user_id %]",
"user": "[% user_name %]",
"email": "[% user_email %]"
}
},
"tasks": [
{
"cmd": {
"args": "-Q @[% sff_file %] -s [% fastq_file %]",
"description": "sff to fastq",
"name": "sff_extract_0_2_8"
},
"dependsOn": [],
"inputs": {
"[% sff_file %]": {
"host": "[% shock_url %]",
"node": "[% sff_file_id %]"
}
},
"outputs": {
"[% fastq_file %]": {
"host": "[% shock_url %]",
"node": "-",
"attrfile": "userattr.json"
}
},
"userattr": {
"file_format": "fastq",
"seq_format": "bp",
"parent_file": "[% sff_file_id %]"
},
"taskid": "0",
"totalwork": 1
}
]
}