-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Deploy tenx:create_tenx_assemblies to sqlite | ||
-- requires tenx_reads | ||
|
||
BEGIN; | ||
|
||
CREATE TABLE IF NOT EXISTS tenx_assemblies ( | ||
id VARCHAR(32), | ||
directory VARCHAR(256), | ||
reads_id VARCHAR(256), | ||
status VARCHAR(16), | ||
|
||
CONSTRAINT tenxassemblies_pk PRIMARY KEY(id), | ||
CONSTRAINT tenxassemblies_reference_fk FOREIGN KEY(reads_id) REFERENCES tenx_reads(id) | ||
); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Revert tenx:create_tenx_assemblies from sqlite | ||
|
||
BEGIN; | ||
|
||
DROP TABLE IF EXISTS tenx_assemblies; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Verify tenx:create_tenx_assemblies on sqlite | ||
|
||
BEGIN; | ||
|
||
SELECT | ||
id, directory, reads_id, status | ||
FROM tenx_assemblies | ||
WHERE 0; | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Deploy tenx:create_tenx_assemblies to sqlite | ||
-- requires tenx_reads | ||
|
||
BEGIN; | ||
|
||
CREATE TABLE IF NOT EXISTS tenx_assemblies ( | ||
id VARCHAR(32), | ||
directory VARCHAR(256), | ||
reads_id VARCHAR(256), | ||
status VARCHAR(16), | ||
|
||
CONSTRAINT tenxassemblies_pk PRIMARY KEY(id), | ||
CONSTRAINT tenxassemblies_reference_fk FOREIGN KEY(reads_id) REFERENCES tenx_reads(id) | ||
); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Revert tenx:create_tenx_assemblies from sqlite | ||
|
||
BEGIN; | ||
|
||
DROP TABLE IF EXISTS tenx_assemblies; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Verify tenx:create_tenx_assemblies on sqlite | ||
|
||
BEGIN; | ||
|
||
SELECT | ||
id, directory, reads_id, status | ||
FROM tenx_assemblies | ||
WHERE 0; | ||
|
||
ROLLBACK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package Tenx::Assembly; | ||
|
||
use strict; | ||
use warnings 'FATAL'; | ||
|
||
class Tenx::Assembly { | ||
table_name => 'tenx_assemblies', | ||
id_generator => '-uuid', | ||
id_by => { | ||
id => { is => 'Text', }, | ||
}, | ||
has => { | ||
directory => { is => 'Text', doc => 'File system location.', }, | ||
reads => { | ||
is => 'Tenx::Reads', | ||
id_by => 'reads_id', | ||
doc => 'The reads that are assembled.', | ||
}, | ||
}, | ||
has_optional => { | ||
status => { | ||
is => 'Text', | ||
doc => 'The status of the assembly: running, succeeded, failed, etc.', | ||
}, | ||
}, | ||
data_source => Tenx::Config::get('tenx_ds'), | ||
}; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package Tenx::Assembly::Command; | ||
|
||
use strict; | ||
use warnings 'FATAL'; | ||
|
||
use UR::Object::Command::Crud; | ||
UR::Object::Command::Crud->create_command_subclasses( | ||
target_class => 'Tenx::Assembly', | ||
target_name => 'alignment', | ||
namespace => 'Tenx::Assembly::Command', | ||
sub_command_configs => { | ||
copy => { skip => 1, }, | ||
}, | ||
); | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings 'FATAL'; | ||
|
||
use TenxTestEnv; | ||
|
||
use Test::More tests => 1; | ||
|
||
subtest "create" => sub{ | ||
plan tests => 8; | ||
|
||
my $pkg = 'Tenx::Assembly'; | ||
use_ok($pkg) or die; | ||
use_ok('Tenx::Reads') or die; | ||
|
||
my $assembly = $pkg->create( | ||
directory => '/tmp', | ||
reads => Tenx::Reads->__define__(directory => '/tmp/', sample_name => 'TEST-TESTY-MCTESTERSON'), | ||
status => 'running', | ||
); | ||
ok($assembly, 'create tenx assembly'); | ||
|
||
ok($assembly->id, 'assembly id'); | ||
ok($assembly->directory, 'assembly directory'); | ||
is($assembly->reads_id, $assembly->reads->id, 'assembly reads'); | ||
ok($assembly->status, 'assembly status'); | ||
|
||
ok(UR::Context->commit, 'commit'); | ||
|
||
}; | ||
|
||
done_testing(); |
Binary file not shown.
Binary file not shown.