@orcabus/platform-cdk-constructs 0.0.34 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +2 -2
- package/api-gateway/api-gateway.js +1 -1
- package/deployment-stack-pipeline/artifact-bucket.js +1 -1
- package/deployment-stack-pipeline/pipeline.js +1 -1
- package/dynamodb/index.js +2 -2
- package/ecs/index.js +1 -1
- package/lambda/index.js +1 -1
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/data_sharing/__init__.py +70 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/data_sharing/globals.py +15 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/data_sharing/models.py +28 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/data_sharing/update_helpers.py +53 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/__init__.py +12 -2
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/create_helpers.py +22 -5
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/globals.py +1 -1
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/job_helpers.py +16 -4
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/models.py +80 -24
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/query_helpers.py +25 -14
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/update_helpers.py +42 -18
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/workflow_helpers.py +3 -2
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq_decompression/create_helpers.py +14 -14
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq_decompression/models.py +7 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq_unarchiving/__init__.py +4 -1
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq_unarchiving/create_helpers.py +2 -2
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq_unarchiving/globals.py +0 -8
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq_unarchiving/models.py +13 -14
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq_unarchiving/query_helpers.py +3 -3
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq_unarchiving/update_helpers.py +3 -3
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/__init__.py +2 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/file_helpers.py +18 -11
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/globals.py +0 -28
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/models.py +24 -2
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/utils/requests_helpers.py +9 -2
- package/monitored-queue/index.js +1 -1
- package/named-lambda-role/index.js +1 -1
- package/package.json +1 -1
- package/provider-function/index.js +1 -1
- package/shared-config/networking.js +2 -2
- package/shared-config/slack.js +1 -1
package/.jsii
CHANGED
|
@@ -6756,6 +6756,6 @@
|
|
|
6756
6756
|
"symbolId": "shared-config/slack:SlackAlerts"
|
|
6757
6757
|
}
|
|
6758
6758
|
},
|
|
6759
|
-
"version": "0.0.
|
|
6760
|
-
"fingerprint": "
|
|
6759
|
+
"version": "0.0.36",
|
|
6760
|
+
"fingerprint": "AQT2JtcqQttpFxgpSQBleYyVLEKOYHPF4q1ii9wJBZ4="
|
|
6761
6761
|
}
|
|
@@ -15,7 +15,7 @@ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
|
|
|
15
15
|
const aws_route53_targets_1 = require("aws-cdk-lib/aws-route53-targets");
|
|
16
16
|
const config_1 = require("./config");
|
|
17
17
|
class OrcaBusApiGateway extends constructs_1.Construct {
|
|
18
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.
|
|
18
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.36" };
|
|
19
19
|
/**
|
|
20
20
|
* The AWS region where the API Gateway is deployed.
|
|
21
21
|
*/
|
|
@@ -13,7 +13,7 @@ exports.CROSS_DEPLOYMENT_ARTIFACT_BUCKET_NAME = "orcabus-cross-deployment-codepi
|
|
|
13
13
|
exports.CROSS_DEPLOYMENT_ARTIFACT_KMS_ALIAS = "orcabus-cross-deployment-codepipeline-artifact";
|
|
14
14
|
exports.CROSS_DEPLOYMENT_ARTIFACT_KMS_ARN_SSM_PARAMETER_NAME = "/orcabus/deployment-stack-pipeline/artifact-bucket/kms-key-arn";
|
|
15
15
|
class CrossDeploymentArtifactBucket extends constructs_1.Construct {
|
|
16
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.
|
|
16
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.36" };
|
|
17
17
|
/**
|
|
18
18
|
* The S3 bucket used to store artifacts for cross-deployment pipelines.
|
|
19
19
|
*/
|
|
@@ -32,7 +32,7 @@ exports.DEFAULT_SYNTH_STEP_PARTIAL_BUILD_SPEC = {
|
|
|
32
32
|
* before using this construct.
|
|
33
33
|
*/
|
|
34
34
|
class DeploymentStackPipeline extends constructs_1.Construct {
|
|
35
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.
|
|
35
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.36" };
|
|
36
36
|
/**
|
|
37
37
|
* The code pipeline construct that is created.
|
|
38
38
|
*/
|
package/dynamodb/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const dynamodb = __importStar(require("aws-cdk-lib/aws-dynamodb"));
|
|
|
40
40
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
41
41
|
const config_1 = require("./config");
|
|
42
42
|
class DynamoDbPartitionedConstruct extends constructs_1.Construct {
|
|
43
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.
|
|
43
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.36" };
|
|
44
44
|
table;
|
|
45
45
|
constructor(scope, id, props) {
|
|
46
46
|
super(scope, id);
|
|
@@ -75,7 +75,7 @@ class DynamoDbPartitionedConstruct extends constructs_1.Construct {
|
|
|
75
75
|
}
|
|
76
76
|
exports.DynamoDbPartitionedConstruct = DynamoDbPartitionedConstruct;
|
|
77
77
|
class DynamoDbNonPartitionedConstruct extends constructs_1.Construct {
|
|
78
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.
|
|
78
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.36" };
|
|
79
79
|
table;
|
|
80
80
|
constructor(scope, id, props) {
|
|
81
81
|
super(scope, id);
|
package/ecs/index.js
CHANGED
|
@@ -55,7 +55,7 @@ exports.LAMBDA_ARCHITECTURE_MAP = {
|
|
|
55
55
|
['ARM64']: lambda.Architecture.ARM_64
|
|
56
56
|
};
|
|
57
57
|
class EcsFargateTaskConstruct extends constructs_1.Construct {
|
|
58
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.
|
|
58
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.36" };
|
|
59
59
|
cluster;
|
|
60
60
|
taskDefinition;
|
|
61
61
|
taskExecutionRole;
|
package/lambda/index.js
CHANGED
|
@@ -56,7 +56,7 @@ function getPythonUvDockerImage() {
|
|
|
56
56
|
return aws_cdk_lib_1.DockerImage.fromBuild(path_1.default.join(__dirname, 'build_python'));
|
|
57
57
|
}
|
|
58
58
|
class PythonUvFunction extends aws_lambda_python_alpha_1.PythonFunction {
|
|
59
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.
|
|
59
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.36" };
|
|
60
60
|
// Class constructs, to be used for caching the layers
|
|
61
61
|
// This means that if there are multiple lambdas throughout the stack
|
|
62
62
|
// They will all use the same layer
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# FIMXE Implement the following imports
|
|
2
|
+
from typing import Optional, Dict
|
|
3
|
+
|
|
4
|
+
from .globals import DATA_SHARING_SUBDOMAIN_NAME
|
|
5
|
+
from ..utils.requests_helpers import get_url, get_request, get_request_response_results, patch_request
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Get url for the subdomain
|
|
9
|
+
def get_data_sharing_url(endpoint: str) -> str:
|
|
10
|
+
"""
|
|
11
|
+
Get the URL for the data sharing endpoint
|
|
12
|
+
:param endpoint:
|
|
13
|
+
:return:
|
|
14
|
+
"""
|
|
15
|
+
return get_url(
|
|
16
|
+
endpoint=endpoint,
|
|
17
|
+
subdomain=DATA_SHARING_SUBDOMAIN_NAME,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# Wrappers
|
|
22
|
+
def get_data_sharing_request(
|
|
23
|
+
endpoint: str,
|
|
24
|
+
params: Optional[Dict] = None,
|
|
25
|
+
):
|
|
26
|
+
return get_request(
|
|
27
|
+
url=get_data_sharing_url(endpoint),
|
|
28
|
+
params=params
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_data_sharing_request_response_results(
|
|
33
|
+
endpoint: str,
|
|
34
|
+
params: Optional[Dict] = None,
|
|
35
|
+
):
|
|
36
|
+
return get_request_response_results(
|
|
37
|
+
url=get_data_sharing_url(endpoint),
|
|
38
|
+
params=params
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def data_sharing_patch_request(
|
|
43
|
+
endpoint: str,
|
|
44
|
+
params: Optional[Dict] = None,
|
|
45
|
+
):
|
|
46
|
+
return patch_request(
|
|
47
|
+
url=get_data_sharing_url(endpoint),
|
|
48
|
+
params=params
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def data_sharing_post_request(
|
|
53
|
+
endpoint: str,
|
|
54
|
+
params: Optional[Dict] = None,
|
|
55
|
+
):
|
|
56
|
+
return patch_request(
|
|
57
|
+
url=get_data_sharing_url(endpoint),
|
|
58
|
+
params=params
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
from .update_helpers import (
|
|
63
|
+
update_package_status,
|
|
64
|
+
update_push_job_status,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
__all__ = [
|
|
68
|
+
"update_package_status",
|
|
69
|
+
"update_push_job_status",
|
|
70
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Imports
|
|
2
|
+
import re
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
# AWS PARAMETERS
|
|
6
|
+
DATA_SHARING_SUBDOMAIN_NAME = "data-sharing"
|
|
7
|
+
|
|
8
|
+
# API ENDPOINTS
|
|
9
|
+
PACKAGE_ENDPOINT = "api/v1/package"
|
|
10
|
+
PUSH_ENDPOINT = "api/v1/push"
|
|
11
|
+
|
|
12
|
+
# REGEX
|
|
13
|
+
ORCABUS_ULID_REGEX_MATCH = re.compile(r'^[a-z0-9]{3}\.[A-Z0-9]{26}$')
|
|
14
|
+
|
|
15
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from typing import Literal, TypedDict, NotRequired
|
|
2
|
+
|
|
3
|
+
PackageStatusType = Literal[
|
|
4
|
+
"PENDING",
|
|
5
|
+
"RUNNING",
|
|
6
|
+
"FAILED",
|
|
7
|
+
"ABORTED",
|
|
8
|
+
"SUCCEEDED",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
PushJobStatusType = Literal[
|
|
12
|
+
"PENDING",
|
|
13
|
+
"RUNNING",
|
|
14
|
+
"FAILED",
|
|
15
|
+
"ABORTED",
|
|
16
|
+
"SUCCEEDED",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class PackageObject(TypedDict):
|
|
22
|
+
id: str
|
|
23
|
+
packageName: str
|
|
24
|
+
stepsExecutionArn: str
|
|
25
|
+
status: PackageStatusType
|
|
26
|
+
requestTime: str
|
|
27
|
+
completionTime: NotRequired[str]
|
|
28
|
+
hasExpired: NotRequired[bool]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from . import data_sharing_patch_request
|
|
4
|
+
from .globals import PACKAGE_ENDPOINT, PUSH_ENDPOINT
|
|
5
|
+
from .models import PackageStatusType, PackageObject, PushJobStatusType
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def update_package_status(
|
|
9
|
+
package_id: str,
|
|
10
|
+
package_status: PackageStatusType,
|
|
11
|
+
error_message: Optional[str] = None
|
|
12
|
+
) -> PackageObject:
|
|
13
|
+
"""
|
|
14
|
+
Add QC stats to a fastq_id.
|
|
15
|
+
|
|
16
|
+
:param package_id: The package id
|
|
17
|
+
:param package_status: The package status to set
|
|
18
|
+
:param error_message: Optional error message
|
|
19
|
+
"""
|
|
20
|
+
return data_sharing_patch_request(
|
|
21
|
+
f"{PACKAGE_ENDPOINT}/{package_id}",
|
|
22
|
+
params=dict(filter(
|
|
23
|
+
lambda x: x[1] is not None,
|
|
24
|
+
{
|
|
25
|
+
"status": package_status,
|
|
26
|
+
"error_message": error_message
|
|
27
|
+
}.items()
|
|
28
|
+
))
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def update_push_job_status(
|
|
33
|
+
push_job_id: str,
|
|
34
|
+
push_job_status: PushJobStatusType,
|
|
35
|
+
error_message: Optional[str] = None
|
|
36
|
+
) -> PackageObject:
|
|
37
|
+
"""
|
|
38
|
+
Add push job status to a push job.
|
|
39
|
+
|
|
40
|
+
:param push_job_id: The push job id
|
|
41
|
+
:param push_job_status: The push job status to set
|
|
42
|
+
:param error_message: Optional error message
|
|
43
|
+
"""
|
|
44
|
+
return data_sharing_patch_request(
|
|
45
|
+
f"{PUSH_ENDPOINT}/{push_job_id}",
|
|
46
|
+
params=dict(filter(
|
|
47
|
+
lambda x: x[1] is not None,
|
|
48
|
+
{
|
|
49
|
+
"status": push_job_status,
|
|
50
|
+
"error_message": error_message
|
|
51
|
+
}.items()
|
|
52
|
+
))
|
|
53
|
+
)
|
|
@@ -70,14 +70,16 @@ def fastq_post_request(
|
|
|
70
70
|
# Create
|
|
71
71
|
from .create_helpers import (
|
|
72
72
|
create_fastq_set_object,
|
|
73
|
-
create_fastq_list_row_object
|
|
73
|
+
create_fastq_list_row_object,
|
|
74
|
+
create_fastq_object,
|
|
74
75
|
)
|
|
75
76
|
|
|
76
77
|
# Job
|
|
77
78
|
from .job_helpers import (
|
|
78
79
|
run_qc_stats,
|
|
79
80
|
run_ntsm,
|
|
80
|
-
run_file_compression_stats
|
|
81
|
+
run_file_compression_stats,
|
|
82
|
+
run_read_count_stats
|
|
81
83
|
)
|
|
82
84
|
|
|
83
85
|
# Query
|
|
@@ -97,6 +99,7 @@ from .query_helpers import (
|
|
|
97
99
|
get_fastqs_in_individual,
|
|
98
100
|
get_fastqs_in_project,
|
|
99
101
|
get_fastq_list_rows_in_fastq_set,
|
|
102
|
+
get_fastqs_in_fastq_set,
|
|
100
103
|
get_fastq_jobs,
|
|
101
104
|
)
|
|
102
105
|
|
|
@@ -111,7 +114,9 @@ from .update_helpers import (
|
|
|
111
114
|
validate_fastq,
|
|
112
115
|
invalidate_fastq,
|
|
113
116
|
link_fastq_list_row_to_fastq_set,
|
|
117
|
+
link_fastq_to_fastq_set,
|
|
114
118
|
unlink_fastq_list_row_from_fastq_set,
|
|
119
|
+
unlink_fastq_from_fastq_set,
|
|
115
120
|
allow_additional_fastqs_to_fastq_set,
|
|
116
121
|
disallow_additional_fastqs_to_fastq_set,
|
|
117
122
|
set_is_current_fastq_set,
|
|
@@ -135,10 +140,12 @@ __all__ = [
|
|
|
135
140
|
# Create
|
|
136
141
|
"create_fastq_set_object",
|
|
137
142
|
"create_fastq_list_row_object",
|
|
143
|
+
"create_fastq_object",
|
|
138
144
|
# Job
|
|
139
145
|
"run_qc_stats",
|
|
140
146
|
"run_ntsm",
|
|
141
147
|
"run_file_compression_stats",
|
|
148
|
+
"run_read_count_stats",
|
|
142
149
|
# Query
|
|
143
150
|
"get_fastq",
|
|
144
151
|
"get_fastq_set",
|
|
@@ -155,6 +162,7 @@ __all__ = [
|
|
|
155
162
|
"get_fastqs_in_individual",
|
|
156
163
|
"get_fastqs_in_project",
|
|
157
164
|
"get_fastq_list_rows_in_fastq_set",
|
|
165
|
+
"get_fastqs_in_fastq_set",
|
|
158
166
|
"get_fastq_jobs",
|
|
159
167
|
# Updaters
|
|
160
168
|
"add_qc_stats",
|
|
@@ -166,7 +174,9 @@ __all__ = [
|
|
|
166
174
|
"validate_fastq",
|
|
167
175
|
"invalidate_fastq",
|
|
168
176
|
"link_fastq_list_row_to_fastq_set",
|
|
177
|
+
"link_fastq_to_fastq_set",
|
|
169
178
|
"unlink_fastq_list_row_from_fastq_set",
|
|
179
|
+
"unlink_fastq_from_fastq_set",
|
|
170
180
|
"allow_additional_fastqs_to_fastq_set",
|
|
171
181
|
"disallow_additional_fastqs_to_fastq_set",
|
|
172
182
|
"set_is_current_fastq_set",
|
|
@@ -17,18 +17,30 @@ from typing import Unpack
|
|
|
17
17
|
|
|
18
18
|
# Local imports
|
|
19
19
|
from . import fastq_post_request
|
|
20
|
-
from .globals import
|
|
21
|
-
from .models import
|
|
20
|
+
from .globals import FASTQ_ENDPOINT, FASTQ_SET_ENDPOINT
|
|
21
|
+
from .models import Fastq, FastqSet, FastqCreate, FastqSetCreate
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def create_fastq_list_row_object(**kwargs: Unpack[
|
|
24
|
+
def create_fastq_list_row_object(**kwargs: Unpack[FastqCreate]) -> Fastq:
|
|
25
|
+
"""
|
|
26
|
+
DEPRECATED: Use create_fastq_object instead.
|
|
27
|
+
"""
|
|
28
|
+
return create_fastq_object(**kwargs)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def create_fastq_object(**kwargs: Unpack[FastqCreate]) -> Fastq:
|
|
25
32
|
"""
|
|
26
33
|
Add a fastq list row object to the database.
|
|
27
34
|
Returns the created fastq list row object
|
|
28
35
|
"""
|
|
29
|
-
|
|
36
|
+
# Raise error if any of the kwargs are not in the FastqCreate
|
|
37
|
+
for key in kwargs.keys():
|
|
38
|
+
if key not in FastqCreate.__annotations__:
|
|
39
|
+
raise ValueError(f"Invalid parameter: {key}")
|
|
40
|
+
|
|
41
|
+
return Fastq(
|
|
30
42
|
**fastq_post_request(
|
|
31
|
-
endpoint=
|
|
43
|
+
endpoint=FASTQ_ENDPOINT,
|
|
32
44
|
params=dict(kwargs)
|
|
33
45
|
)
|
|
34
46
|
)
|
|
@@ -39,6 +51,11 @@ def create_fastq_set_object(**kwargs: Unpack[FastqSetCreate]) -> FastqSet:
|
|
|
39
51
|
Add a fastq set object to the database.
|
|
40
52
|
Returns the created fastq set object
|
|
41
53
|
"""
|
|
54
|
+
# Raise error if any of the kwargs are not in the FastqCreate
|
|
55
|
+
for key in kwargs.keys():
|
|
56
|
+
if key not in FastqSetCreate.__annotations__:
|
|
57
|
+
raise ValueError(f"Invalid parameter: {key}")
|
|
58
|
+
|
|
42
59
|
return FastqSet(
|
|
43
60
|
**fastq_post_request(
|
|
44
61
|
endpoint=FASTQ_SET_ENDPOINT,
|
|
@@ -11,7 +11,7 @@ Update helpers for the update script.
|
|
|
11
11
|
|
|
12
12
|
# Local imports
|
|
13
13
|
from . import fastq_patch_request
|
|
14
|
-
from .globals import
|
|
14
|
+
from .globals import FASTQ_ENDPOINT
|
|
15
15
|
from .models import Job
|
|
16
16
|
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ def run_qc_stats(fastq_id: str) -> Job:
|
|
|
23
23
|
"""
|
|
24
24
|
return Job(
|
|
25
25
|
**fastq_patch_request(
|
|
26
|
-
f"{
|
|
26
|
+
f"{FASTQ_ENDPOINT}/{fastq_id}:runQcStats"
|
|
27
27
|
)
|
|
28
28
|
)
|
|
29
29
|
|
|
@@ -36,7 +36,7 @@ def run_ntsm(fastq_id: str) -> Job:
|
|
|
36
36
|
"""
|
|
37
37
|
return Job(
|
|
38
38
|
**fastq_patch_request(
|
|
39
|
-
f"{
|
|
39
|
+
f"{FASTQ_ENDPOINT}/{fastq_id}:runNtsm"
|
|
40
40
|
)
|
|
41
41
|
)
|
|
42
42
|
|
|
@@ -48,6 +48,18 @@ def run_file_compression_stats(fastq_id: str) -> Job:
|
|
|
48
48
|
"""
|
|
49
49
|
return Job(
|
|
50
50
|
**fastq_patch_request(
|
|
51
|
-
f"{
|
|
51
|
+
f"{FASTQ_ENDPOINT}/{fastq_id}:runFileCompressionInformation"
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def run_read_count_stats(fastq_id: str) -> Job:
|
|
56
|
+
"""
|
|
57
|
+
Run file compression stats for a fastq_id.
|
|
58
|
+
|
|
59
|
+
:param fastq_id: Fastq str
|
|
60
|
+
"""
|
|
61
|
+
return Job(
|
|
62
|
+
**fastq_patch_request(
|
|
63
|
+
f"{FASTQ_ENDPOINT}/{fastq_id}:runReadCountInformation"
|
|
52
64
|
)
|
|
53
65
|
)
|
|
@@ -40,22 +40,27 @@ from typing import (
|
|
|
40
40
|
TypedDict,
|
|
41
41
|
Optional,
|
|
42
42
|
Dict,
|
|
43
|
-
List, NotRequired, Union,
|
|
43
|
+
List, NotRequired, Union,
|
|
44
|
+
Literal
|
|
44
45
|
)
|
|
45
46
|
from datetime import datetime
|
|
46
47
|
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
JobType = Literal[
|
|
50
|
+
'QC',
|
|
51
|
+
'FILE_COMPRESSION',
|
|
52
|
+
'NTSM',
|
|
53
|
+
'READ_COUNT',
|
|
54
|
+
]
|
|
55
|
+
|
|
52
56
|
|
|
57
|
+
JobStatus = Literal[
|
|
58
|
+
"PENDING",
|
|
59
|
+
"RUNNING",
|
|
60
|
+
"FAILED",
|
|
61
|
+
"SUCCEEDED",
|
|
62
|
+
]
|
|
53
63
|
|
|
54
|
-
class JobStatus(Enum):
|
|
55
|
-
PENDING = "PENDING"
|
|
56
|
-
RUNNING = "RUNNING"
|
|
57
|
-
FAILED = "FAILED"
|
|
58
|
-
SUCCEEDED = "SUCCEEDED"
|
|
59
64
|
|
|
60
65
|
|
|
61
66
|
class FileStorageObject(TypedDict):
|
|
@@ -81,6 +86,7 @@ class Library(TypedDict):
|
|
|
81
86
|
libraryId: str
|
|
82
87
|
|
|
83
88
|
|
|
89
|
+
# Deprecated: Use FastqCreate instead
|
|
84
90
|
class FastqListRowCreate(TypedDict):
|
|
85
91
|
fastqSetId: Optional[str]
|
|
86
92
|
index: str
|
|
@@ -98,6 +104,7 @@ class FastqListRowCreate(TypedDict):
|
|
|
98
104
|
ntsm: Optional[FileStorageObject]
|
|
99
105
|
|
|
100
106
|
|
|
107
|
+
# Deprecated: Use Fastq instead
|
|
101
108
|
class FastqListRow(TypedDict):
|
|
102
109
|
id: str
|
|
103
110
|
fastqSetId: Optional[str]
|
|
@@ -116,9 +123,44 @@ class FastqListRow(TypedDict):
|
|
|
116
123
|
ntsm: Optional[FileStorageObject]
|
|
117
124
|
|
|
118
125
|
|
|
126
|
+
class Fastq(TypedDict):
|
|
127
|
+
id: str
|
|
128
|
+
fastqSetId: Optional[str]
|
|
129
|
+
index: str
|
|
130
|
+
lane: int
|
|
131
|
+
instrumentRunId: str
|
|
132
|
+
library: Library
|
|
133
|
+
platform: Optional[str]
|
|
134
|
+
center: Optional[str]
|
|
135
|
+
date: Optional[datetime]
|
|
136
|
+
readSet: Optional[ReadSet]
|
|
137
|
+
qc: Optional[Dict]
|
|
138
|
+
readCount: Optional[int]
|
|
139
|
+
baseCountEst: Optional[int]
|
|
140
|
+
isValid: Optional[bool]
|
|
141
|
+
ntsm: Optional[FileStorageObject]
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class FastqCreate(TypedDict):
|
|
145
|
+
fastqSetId: Optional[str]
|
|
146
|
+
index: str
|
|
147
|
+
lane: int
|
|
148
|
+
instrumentRunId: str
|
|
149
|
+
library: Library
|
|
150
|
+
platform: Optional[str]
|
|
151
|
+
center: Optional[str]
|
|
152
|
+
date: Optional[datetime]
|
|
153
|
+
readSet: Optional[ReadSet]
|
|
154
|
+
qc: Optional[Dict]
|
|
155
|
+
readCount: Optional[int]
|
|
156
|
+
baseCountEst: Optional[int]
|
|
157
|
+
isValid: Optional[bool]
|
|
158
|
+
ntsm: Optional[FileStorageObject]
|
|
159
|
+
|
|
160
|
+
|
|
119
161
|
class FastqSetCreate(TypedDict):
|
|
120
162
|
library: Library
|
|
121
|
-
fastqSet: List[Union[str,
|
|
163
|
+
fastqSet: List[Union[str, Fastq]]
|
|
122
164
|
allowAdditionalFastq: bool
|
|
123
165
|
isCurrentFastqSet: bool
|
|
124
166
|
|
|
@@ -126,7 +168,7 @@ class FastqSetCreate(TypedDict):
|
|
|
126
168
|
class FastqSet(TypedDict):
|
|
127
169
|
id: str
|
|
128
170
|
library: Library
|
|
129
|
-
fastqSet: List[
|
|
171
|
+
fastqSet: List[Fastq]
|
|
130
172
|
allowAdditionalFastq: bool
|
|
131
173
|
isCurrentFastqSet: bool
|
|
132
174
|
|
|
@@ -138,6 +180,7 @@ class QcStats(TypedDict):
|
|
|
138
180
|
r2Q20Fraction: float
|
|
139
181
|
r1GcFraction: float
|
|
140
182
|
r2GcFraction: float
|
|
183
|
+
duplicationFractionEstimate: float
|
|
141
184
|
|
|
142
185
|
|
|
143
186
|
class ReadCount(TypedDict):
|
|
@@ -176,15 +219,15 @@ class Job(TypedDict):
|
|
|
176
219
|
startTime: datetime
|
|
177
220
|
endTime: Optional[datetime]
|
|
178
221
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
222
|
+
BoolLiteral = Literal[
|
|
223
|
+
'ALL',
|
|
224
|
+
True,
|
|
225
|
+
False
|
|
226
|
+
]
|
|
184
227
|
|
|
185
228
|
|
|
186
229
|
class FastqGetResponseParameters(TypedDict):
|
|
187
|
-
includeS3Details: NotRequired[
|
|
230
|
+
includeS3Details: NotRequired[bool]
|
|
188
231
|
|
|
189
232
|
|
|
190
233
|
class StandardQueryParameters(TypedDict):
|
|
@@ -224,15 +267,28 @@ InstrumentRunIdQueryParametersList = TypedDict(
|
|
|
224
267
|
)
|
|
225
268
|
|
|
226
269
|
|
|
227
|
-
|
|
270
|
+
# Deprecated: Use FastqQueryParameters instead
|
|
271
|
+
class FastqParameters(
|
|
272
|
+
StandardQueryParameters,
|
|
273
|
+
MetadataQueryParameter,
|
|
274
|
+
InstrumentRunIdQueryParameters,
|
|
275
|
+
MetadataQueryParametersList,
|
|
276
|
+
InstrumentRunIdQueryParametersList
|
|
277
|
+
):
|
|
278
|
+
valid: NotRequired[BoolLiteral]
|
|
279
|
+
includeS3Details: NotRequired[BoolLiteral]
|
|
280
|
+
fastqSetId: NotRequired[str]
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
class FastqQueryParameters(
|
|
228
284
|
StandardQueryParameters,
|
|
229
285
|
MetadataQueryParameter,
|
|
230
286
|
InstrumentRunIdQueryParameters,
|
|
231
287
|
MetadataQueryParametersList,
|
|
232
288
|
InstrumentRunIdQueryParametersList
|
|
233
289
|
):
|
|
234
|
-
valid: NotRequired[
|
|
235
|
-
includeS3Details: NotRequired[
|
|
290
|
+
valid: NotRequired[BoolLiteral]
|
|
291
|
+
includeS3Details: NotRequired[BoolLiteral]
|
|
236
292
|
fastqSetId: NotRequired[str]
|
|
237
293
|
|
|
238
294
|
|
|
@@ -242,9 +298,9 @@ class FastqSetQueryParameters(
|
|
|
242
298
|
MetadataQueryParametersList,
|
|
243
299
|
InstrumentRunIdQueryParameters
|
|
244
300
|
):
|
|
245
|
-
currentFastqSet: NotRequired[
|
|
246
|
-
allowAdditionalFastq: NotRequired[
|
|
247
|
-
includeS3Details: NotRequired[
|
|
301
|
+
currentFastqSet: NotRequired[BoolLiteral]
|
|
302
|
+
allowAdditionalFastq: NotRequired[BoolLiteral]
|
|
303
|
+
includeS3Details: NotRequired[BoolLiteral]
|
|
248
304
|
|
|
249
305
|
# Additional types
|
|
250
306
|
VALID_BATCH_KEYS = Literal[
|