Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: use latest object schemas and dependency releases #293

Merged
merged 48 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3c687d9
build!: updating to vrs 2.0 models
katiestahl Jul 29, 2024
d95f2d5
update pydantic-to-ts2 and update models
katiestahl Jul 29, 2024
77f3088
wip: updating models, making variable casing consistent, converting d…
katiestahl Jul 29, 2024
17beba5
fix: utilities requests
katiestahl Jul 29, 2024
0f390da
fix: response model casing
katiestahl Jul 30, 2024
c20a6f8
wip: updating models
katiestahl Jul 30, 2024
1a1b61d
bug fixes
katiestahl Jul 30, 2024
c8dd15b
updating models and fixing validation
katiestahl Jul 30, 2024
de83ee9
pass around formatted fusion to reduce repeated code
katiestahl Jul 30, 2024
bb71e6b
fixing demo data
katiestahl Jul 30, 2024
6da6b78
specifying fusion type since null param gets dropped and fusor can't …
katiestahl Jul 31, 2024
88503d5
fixing tests and updating data with new models, bug fixes
katiestahl Jul 31, 2024
e42e28b
bug fixes for input elements
katiestahl Aug 2, 2024
12633b3
pin latest fusor
jsstevenson Aug 2, 2024
b8c0f73
update dependencies
jsstevenson Aug 2, 2024
a547518
fix clientification of demos
jsstevenson Aug 2, 2024
84cc680
fix formatting in docstrings
jsstevenson Aug 2, 2024
0ca0401
fix type handling of failed lookup
jsstevenson Aug 2, 2024
17244c9
fix up gene lookup api
jsstevenson Aug 2, 2024
3414fbe
fix tx utils bug
jsstevenson Aug 2, 2024
c4ffe6a
fix bug where region and strand were incorrect in templated sequence,…
katiestahl Aug 3, 2024
61c4168
removing console logs
katiestahl Aug 3, 2024
aa3af6c
fix: bug where error messages no longer displayed on summary page
katiestahl Aug 3, 2024
d28870f
fixing tests and adjusting variable casing
katiestahl Aug 3, 2024
be13369
add reusable function for checking valid sequence locations
katiestahl Aug 3, 2024
8031f47
add reusable function for checking valid sequence locations
katiestahl Aug 3, 2024
c3d2ac6
fixing nomenclature bugs
katiestahl Aug 3, 2024
612d13e
fixing nomenclature bugs
katiestahl Aug 3, 2024
bf1ec41
Merge branch 'staging' into update-vrs
jsstevenson Aug 5, 2024
8e576fb
DOn't bother w/ semver checks (out of control of this app) and use pr…
jsstevenson Aug 5, 2024
52dc2fb
add assertion notes
jsstevenson Aug 5, 2024
105b11a
stash changes
jsstevenson Aug 5, 2024
cb50b9a
stash
jsstevenson Aug 5, 2024
4340865
fix a few fixtures
jsstevenson Aug 5, 2024
64b8425
sequence util fixes
jsstevenson Aug 5, 2024
e5e3e7a
minor rearrange
jsstevenson Aug 5, 2024
488f25c
Merge branch 'staging' into update-vrs
jsstevenson Aug 5, 2024
a2bbf33
Merge branch 'staging' into update-vrs
jsstevenson Aug 5, 2024
9dd4463
fix int/str problem
jsstevenson Aug 5, 2024
aa90292
Merge branch 'staging' into update-vrs
jsstevenson Aug 5, 2024
ce5138b
commit this
jsstevenson Aug 5, 2024
e6ce8f6
Merge branch 'staging' into update-vrs
jsstevenson Aug 5, 2024
d923b70
catch static files error
jsstevenson Aug 5, 2024
927b516
validation tests
jsstevenson Aug 5, 2024
61697d9
fix reg element URL
jsstevenson Aug 6, 2024
105e404
remove todos
jsstevenson Aug 7, 2024
e1d243a
review comments
jsstevenson Aug 7, 2024
645105d
Merge branch 'staging' into update-vrs
jsstevenson Aug 7, 2024
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ source venv/bin/activate
python3 -m pip install -e ".[dev,tests]" # make sure to include the extra dependencies!
```

Acquire two sets of static assets and place all of them within the `server/curation/data` directory:
Acquire two sets of static assets and place all of them within the `server/src/curfu/data` directory:

1. Gene autocomplete files, providing legal gene search terms to the client autocomplete component. One file each is used for entity types `aliases`, `assoc_with`, `xrefs`, `prev_symbols`, `labels`, and `symbols`. Each should be named according to the pattern `gene_<type>_<YYYYMMDD>.tsv`. These can be regenerated with the shell command `curfu_devtools genes`.

Expand All @@ -39,7 +39,7 @@ Acquire two sets of static assets and place all of them within the `server/curat
Your data/directory should look something like this:

```
server/curfu/data
server/src/curfu/data
├── domain_lookup_2022-01-20.tsv
├── gene_aliases_suggest_20211025.tsv
├── gene_assoc_with_suggest_20211025.tsv
Expand Down
36 changes: 18 additions & 18 deletions client/src/components/Pages/Assay/Assay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,52 +61,52 @@ export const Assay: React.FC<Props> = () => {

// initialize field values
const [fusionDetection, setFusionDetection] = useState(
fusion?.assay?.fusion_detection !== undefined
? fusion?.assay?.fusion_detection
fusion?.assay?.fusionDetection !== undefined
? fusion?.assay?.fusionDetection
: null
);

const [assayName, setAssayName] = useState(
fusion?.assay?.assay_name !== undefined ? fusion?.assay?.assay_name : ""
fusion?.assay?.assayName !== undefined ? fusion?.assay?.assayName : ""
);

const [assayId, setAssayId] = useState(
fusion?.assay?.assay_id !== undefined ? fusion?.assay?.assay_id : ""
fusion?.assay?.assayId !== undefined ? fusion?.assay?.assayId : ""
);

const [methodUri, setMethodUri] = useState(
fusion?.assay?.method_uri !== undefined ? fusion?.assay?.method_uri : ""
fusion?.assay?.methodUri !== undefined ? fusion?.assay?.methodUri : ""
);

const handleEvidenceChange = (event: FormEvent<HTMLInputElement>) => {
const evidence_value = event.currentTarget.value;
if (fusion?.assay?.fusion_detection !== evidence_value) {
if (fusion?.assay?.fusionDetection !== evidence_value) {
setFusionDetection(evidence_value);
const assay = JSON.parse(JSON.stringify(fusion.assay));
assay["fusion_detection"] = evidence_value;
assay["fusionDetection"] = evidence_value;
setFusion({ ...fusion, assay: assay });
}
};

const propertySetterMap = {
assayName: [setAssayName, "assay_name"],
assayId: [setAssayId, "assay_id"],
methodUri: [setMethodUri, "method_uri"],
assayName: [setAssayName, "assayName"],
assayId: [setAssayId, "assayId"],
methodUri: [setMethodUri, "methodUri"],
};

// live update fields
useEffect(() => {
if (fusion?.assay?.fusion_detection !== fusionDetection) {
setFusionDetection(fusion?.assay?.fusion_detection);
if (fusion?.assay?.fusionDetection !== fusionDetection) {
setFusionDetection(fusion?.assay?.fusionDetection);
}
if (fusion?.assay?.assay_name !== assayName) {
setAssayName(fusion?.assay?.assay_name);
if (fusion?.assay?.assayName !== assayName) {
setAssayName(fusion?.assay?.assayName);
}
if (fusion?.assay?.assay_id !== assayId) {
setAssayId(fusion?.assay?.assay_id);
if (fusion?.assay?.assayId !== assayId) {
setAssayId(fusion?.assay?.assayId);
}
if (fusion?.assay?.method_uri !== methodUri) {
setMethodUri(fusion?.assay?.method_uri);
if (fusion?.assay?.methodUri !== methodUri) {
setMethodUri(fusion?.assay?.methodUri);
}
}, [fusion]);

Expand Down
18 changes: 9 additions & 9 deletions client/src/components/Pages/CausativeEvent/CausativeEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ export const CausativeEvent: React.FC<Props> = () => {
const { fusion, setFusion } = useContext(FusionContext);

const [eventType, setEventType] = useState<string>(
fusion.causative_event?.event_type || ""
fusion.causativeEvent?.eventType || ""
);
const [eventDescription, setEventDescription] = useState<string>(
fusion.causative_event?.event_type || ""
fusion.causativeEvent?.eventType || ""
);

/**
* Ensure that causative event object exists for getter/setter purposes
*/
const ensureEventInitialized = () => {
if (!fusion.causative_event) {
setFusion({ ...fusion, causative_event: {} });
if (!fusion.causativeEvent) {
setFusion({ ...fusion, causativeEvent: {} });
}
};

Expand All @@ -56,8 +56,8 @@ export const CausativeEvent: React.FC<Props> = () => {
if (eventType !== value) {
setEventType(value);
}
const newCausativeEvent = { event_type: value, ...fusion.causative_event };
setFusion({ causative_event: newCausativeEvent, ...fusion });
const newCausativeEvent = { eventType: value, ...fusion.causativeEvent };
setFusion({ causativeEvent: newCausativeEvent, ...fusion });
};

/**
Expand All @@ -72,10 +72,10 @@ export const CausativeEvent: React.FC<Props> = () => {
setEventDescription(value);
}
const newCausativeEvent = {
event_description: value,
...fusion.causative_event,
eventDescription: value,
...fusion.causativeEvent,
};
setFusion({ causative_event: newCausativeEvent, ...fusion });
setFusion({ causativeEvent: newCausativeEvent, ...fusion });
};

return (
Expand Down
18 changes: 9 additions & 9 deletions client/src/components/Pages/Domains/DomainForm/DomainForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const useStyles = makeStyles((theme) => ({
const DomainForm: React.FC = () => {
// // TODO: shouldn't be necessary
useEffect(() => {
if (fusion.critical_functional_domains === undefined) {
setFusion({ ...fusion, ...{ critical_functional_domains: [] } });
if (fusion.criticalFunctionalDomains === undefined) {
setFusion({ ...fusion, ...{ criticalFunctionalDomains: [] } });
}
}, []);

Expand Down Expand Up @@ -65,7 +65,7 @@ const DomainForm: React.FC = () => {

const handleAdd = () => {
const domainParams = domainOptions[gene].find(
(domainOption: DomainParams) => domainOption.interpro_id == domain
(domainOption: DomainParams) => domainOption.interproId == domain
);
getFunctionalDomain(domainParams, status as DomainStatus, gene).then(
(response) => {
Expand All @@ -74,11 +74,11 @@ const DomainForm: React.FC = () => {
domain_id: uuid(),
...response.domain,
};
const cloneArray = Array.from(fusion["critical_functional_domains"]);
const cloneArray = Array.from(fusion["criticalFunctionalDomains"]);
cloneArray.push(newDomain);
setFusion({
...fusion,
...{ critical_functional_domains: cloneArray },
...{ criticalFunctionalDomains: cloneArray },
});

setStatus("default");
Expand Down Expand Up @@ -107,11 +107,11 @@ const DomainForm: React.FC = () => {
if (domainOptions[gene]) {
const uniqueInterproIds: Set<string> = new Set();
domainOptions[gene].forEach((domain: DomainParams, index: number) => {
if (!uniqueInterproIds.has(domain.interpro_id)) {
uniqueInterproIds.add(domain.interpro_id);
if (!uniqueInterproIds.has(domain.interproId)) {
uniqueInterproIds.add(domain.interproId);
domainOptionMenuItems.push(
<MenuItem key={index} value={domain.interpro_id}>
{domain.domain_name}
<MenuItem key={index} value={domain.interproId}>
{domain.domainName}
</MenuItem>
);
}
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/Pages/Domains/Main/Domains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Domain: React.FC<Props> = () => {
const { fusion, setFusion } = useContext(FusionContext);

const { globalGenes } = useContext(GeneContext);
const domains = fusion.critical_functional_domains || [];
const domains = fusion.criticalFunctionalDomains || [];

const { colorTheme } = useColorTheme();
const useStyles = makeStyles(() => ({
Expand Down Expand Up @@ -73,14 +73,14 @@ export const Domain: React.FC<Props> = () => {

const handleRemove = (domain: ClientFunctionalDomain) => {
let cloneArray: ClientFunctionalDomain[] = Array.from(
fusion.critical_functional_domains
fusion.criticalFunctionalDomains
);
cloneArray = cloneArray.filter((obj) => {
return obj["domain_id"] !== domain["domain_id"];
});
setFusion({
...fusion,
...{ critical_functional_domains: cloneArray || [] },
...{ criticalFunctionalDomains: cloneArray || [] },
});
};

Expand Down Expand Up @@ -108,7 +108,7 @@ export const Domain: React.FC<Props> = () => {
avatar={<Avatar>{domain.status === "preserved" ? "P" : "L"}</Avatar>}
label={
<React.Fragment>
{domainLabelString} <b>{`(${domain.associated_gene.label})`}</b>
{domainLabelString} <b>{`(${domain.associatedGene.label})`}</b>
</React.Fragment>
}
onDelete={() => handleRemove(domain)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export const StructureDiagram: React.FC = () => {
});

const regEls = [];
suggestion.regulatory_elements.forEach((el) => {
regEls.push(el.gene_descriptor.label);
suggestion.regulatoryElements.forEach((el) => {
regEls.push(el.gene.label);
});

return (
Expand Down
18 changes: 9 additions & 9 deletions client/src/components/Pages/ReadingFrame/ReadingFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ export const ReadingFrame: React.FC<Props> = ({ index }) => {
};

const [rFramePreserved, setRFramePreserved] = useState(
assignRadioValue(fusion.r_frame_preserved)
assignRadioValue(fusion.readingFramePreserved)
);

useEffect(() => {
if (
fusion.r_frame_preserved &&
fusion.r_frame_preserved !== rFramePreserved
fusion.readingFramePreserved &&
fusion.readingFramePreserved !== rFramePreserved
) {
setRFramePreserved(assignRadioValue(fusion.r_frame_preserved));
setRFramePreserved(assignRadioValue(fusion.readingFramePreserved));
}

if (fusion.r_frame_preserved === undefined) {
setFusion({ ...fusion, r_frame_preserved: null });
if (fusion.readingFramePreserved === undefined) {
setFusion({ ...fusion, readingFramePreserved: null });
}
}, [fusion]);

Expand All @@ -71,13 +71,13 @@ export const ReadingFrame: React.FC<Props> = ({ index }) => {
if (value !== rFramePreserved) {
if (value === "yes") {
setRFramePreserved("yes");
setFusion({ ...fusion, r_frame_preserved: true });
setFusion({ ...fusion, readingFramePreserved: true });
} else if (value === "no") {
setRFramePreserved("no");
setFusion({ ...fusion, r_frame_preserved: false });
setFusion({ ...fusion, readingFramePreserved: false });
} else {
setRFramePreserved("unspecified");
setFusion({ ...fusion, r_frame_preserved: null });
setFusion({ ...fusion, readingFramePreserved: null });
}
}
};
Expand Down
Loading