Skip to content

Commit

Permalink
fixed activity value naming and updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Syed Zayyan Masud committed Nov 17, 2024
1 parent 17da530 commit c3fc94b
Show file tree
Hide file tree
Showing 35 changed files with 5,123 additions and 33,490 deletions.
Binary file modified .DS_Store
Binary file not shown.
24 changes: 0 additions & 24 deletions .storybook/main.ts

This file was deleted.

14 changes: 0 additions & 14 deletions .storybook/preview.ts

This file was deleted.

1 change: 1 addition & 0 deletions app/tools/screen/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function ScreenLayout({ children }) {
const { pyodide } = useContext(PyodideContext);

async function callofScreenFunction(data) {
console.log(data)
setLoaded(false);
setTimeout(async () => {
const fp_mols = await screenData.map((x) => {
Expand Down
3 changes: 0 additions & 3 deletions components/dataloader/CSVLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ const CSVLoader: React.FC<Props> = ({
let data = convertToJSON(results.data);
csvSetter(data);
setCsvData(data);
const mimi = headers.findIndex((head, i) => {
data[0][head].toLowerCase().includes("smiles" || "smi") ? i : null;
});
}}
onDragOver={(event: DragEvent) => {
event.preventDefault();
Expand Down
28 changes: 22 additions & 6 deletions components/utils/mol_cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,30 @@ export default function molDataCleanUp(rdkit, mol_data, activity_columns, formSt
localStorage.setItem("nBits", formStuff.nBits.toString());

if (formStuff.log10) {
var new_activity_columns = activity_columns.map((col) => "p" + col);
mol_data.map((lig, i) => {
new_activity_columns.map((col, j) => {
temp_ligand_process[i][col] = -1 * Math.log10(lig[activity_columns[j]] * 10e-9);
})
// Determine which columns contain "p"
const truthyOrFalsy = activity_columns.map((col) => col.includes("p"));

// Prepare new activity column names based on the truthy/falsy values
var new_activity_columns = activity_columns.map((col, index) =>
!truthyOrFalsy[index] ? "p" + col : col
);

// Process the data with log10 only for columns that contained "p"
mol_data.map((lig, i) => {
new_activity_columns.map((col, j) => {
if (!truthyOrFalsy[j]) {
temp_ligand_process[i][col] = -1 * Math.log10(lig[activity_columns[j]] * 10e-9);
} else {
// If the column does not contain "p", keep the original value
temp_ligand_process[i][col] = lig[activity_columns[j]];
}
});
activity_columns = new_activity_columns;
});

// Update activity_columns with new column names
activity_columns = new_activity_columns;
}


if (formStuff.dedup) {
temp_ligand_process = temp_ligand_process.filter((ligand, index, self) =>
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
Loading

0 comments on commit c3fc94b

Please sign in to comment.