Unverified Commit 3cd7019c authored by Ridwan Amode's avatar Ridwan Amode Committed by GitHub
Browse files

Use sequence field instead of sequence_checksum in payloads from Thoas (#537)

* ENSWBSITES-1160: update sequence payload from sequence_checksum to sequence.checksum
* make sequence type mandatory and updated test
parent 39f69fe0
Pipeline #181006 passed with stages
in 4 minutes and 17 seconds
......@@ -18,6 +18,8 @@ import { gql } from '@apollo/client';
import { client } from 'src/gql-client';
import { Sequence } from 'ensemblRoot/src/shared/types/thoas/sequence';
export type TranscriptSequenceMetadata = {
stable_id: string;
unversioned_stable_id: string;
......@@ -46,14 +48,14 @@ type TranscriptInResponse = {
unversioned_stable_id: string;
product_generating_contexts: Array<{
cdna: {
sequence_checksum: string;
sequence: Sequence;
};
cds: {
sequence_checksum: string;
sequence: Sequence;
};
product: {
stable_id: string;
sequence_checksum: string;
sequence: Sequence;
};
}>;
};
......@@ -87,14 +89,20 @@ const transcriptChecksumsQuery = gql`
unversioned_stable_id
product_generating_contexts {
cds {
sequence_checksum
sequence {
checksum
}
}
cdna {
sequence_checksum
sequence {
checksum
}
}
product {
stable_id
sequence_checksum
sequence {
checksum
}
}
}
}
......@@ -120,14 +128,20 @@ const geneChecksumsQuery = gql`
unversioned_stable_id
product_generating_contexts {
cds {
sequence_checksum
sequence {
checksum
}
}
cdna {
sequence_checksum
sequence {
checksum
}
}
product {
stable_id
sequence_checksum
sequence {
checksum
}
}
}
}
......@@ -151,15 +165,15 @@ const processTranscriptData = (transcript: TranscriptInResponse) => {
stable_id,
unversioned_stable_id,
cdna: {
checksum: productGeneratingContext.cdna.sequence_checksum,
checksum: productGeneratingContext.cdna.sequence.checksum,
label: `${stable_id} cdna`
},
cds: {
checksum: productGeneratingContext.cds.sequence_checksum,
checksum: productGeneratingContext.cds.sequence.checksum,
label: `${stable_id} cds`
},
protein: {
checksum: productGeneratingContext.product.sequence_checksum,
checksum: productGeneratingContext.product.sequence.checksum,
label: `${productGeneratingContext.product.stable_id} pep`
}
};
......
......@@ -14,9 +14,11 @@
* limitations under the License.
*/
import { Sequence } from './sequence';
export type CDNA = {
start: number;
end: number;
length: number;
sequence_checksum?: string;
sequence: Sequence;
};
......@@ -14,6 +14,8 @@
* limitations under the License.
*/
import { Sequence } from './sequence';
export type FullCDS = {
start: number;
end: number;
......@@ -21,5 +23,5 @@ export type FullCDS = {
relative_end: number;
protein_length: number;
nucleotide_length: number;
sequence_checksum?: string;
sequence: Sequence;
};
......@@ -16,6 +16,7 @@
import { ExternalReference } from './externalReference';
import { LocationWithinRegion } from './location';
import { Sequence } from './sequence';
export type ProteinDomainsResources = {
[name_of_resource: string]: {
......@@ -52,7 +53,7 @@ export type Product = {
length: number;
protein_domains: ProteinDomain[];
external_references: ExternalReference[];
sequence_checksum?: string;
sequence: Sequence;
};
export type ProteinDomain = {
......
/**
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export type Sequence = {
checksum: string;
};
......@@ -40,6 +40,9 @@ export const createProduct = (fragment: Partial<Product> = {}): Product => {
length: length,
protein_domains: createProteinDomains(length),
external_references: times(2, () => createExternalReference()),
sequence: {
checksum: faker.datatype.uuid()
},
...fragment
};
};
......
......@@ -191,7 +191,10 @@ const createCDS = (transcriptSlice: Slice): FullCDS => {
relative_start: 1,
relative_end: nucleotideLength,
nucleotide_length: nucleotideLength,
protein_length: proteinLength
protein_length: proteinLength,
sequence: {
checksum: faker.datatype.uuid()
}
};
};
......@@ -201,7 +204,10 @@ const createCDNA = (transcriptSlice: Slice): CDNA => {
return {
start,
end,
length: end - start + 1
length: end - start + 1,
sequence: {
checksum: faker.datatype.uuid()
}
};
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment