Skip to content

Commit 37df578

Browse files
committed
geneVersion prop and console logs
1 parent 46d3db1 commit 37df578

File tree

8 files changed

+11
-15
lines changed

8 files changed

+11
-15
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@weng-lab/psychscreen-ui-components",
33
"description": "Typescript and Material UI based components used for psychSCREEN",
44
"author": "SCREEN Team @ UMass Chan Medical School",
5-
"version": "2.0.21",
5+
"version": "2.0.22",
66
"license": "MIT",
77
"type": "module",
88
"typings": "dist/index.d.ts",

src/components/Autocomplete/Autocomplete.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const Search: React.FC<GenomeSearchProps> = ({
3636
queries,
3737
assembly,
3838
showiCREFlag,
39+
geneVersion,
3940
geneLimit,
4041
snpLimit,
4142
icreLimit,
@@ -81,14 +82,13 @@ const Search: React.FC<GenomeSearchProps> = ({
8182
queryFn: () => getCCREs(inputValue, assembly, ccreLimit || 3, showiCREFlag || false),
8283
enabled: false,
8384
});
84-
8585
const {
8686
data: geneData,
8787
refetch: refetchGenes,
8888
isFetching: geneFetching,
8989
} = useQuery({
9090
queryKey: ["genes", inputValue],
91-
queryFn: () => getGenes(inputValue, assembly, geneLimit || 3),
91+
queryFn: () => getGenes(inputValue, assembly, geneLimit || 3, geneVersion || assembly === "GRCh38" ? 29 : 25),
9292
enabled: false,
9393
});
9494

@@ -143,7 +143,6 @@ const Search: React.FC<GenomeSearchProps> = ({
143143
);
144144
}
145145
if (ccreData && searchCCRE && inputValue.toLowerCase().startsWith("eh")) {
146-
console.log(ccreData.data.cCREAutocompleteQuery)
147146
resultsList.push(
148147
...ccreResultList(ccreData.data.cCREAutocompleteQuery, ccreLimit || 3)
149148
);

src/components/Autocomplete/queries.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,18 @@ export const getCCREs = async (
147147
export const getGenes = async (
148148
value: string,
149149
assembly: string,
150-
limit: number
150+
limit: number,
151+
geneVersion: number
151152
) => {
153+
console.log(geneVersion)
152154
const response = await fetch("https://screen.api.wenglab.org/graphql", {
153155
method: "POST",
154156
body: JSON.stringify({
155157
query: GENE_AUTOCOMPLETE_QUERY,
156158
variables: {
157159
assembly: assembly.toLowerCase(),
158160
name_prefix: value,
159-
version: assembly.toLowerCase() === "grch38" ? 29 : 25,
161+
version: geneVersion,
160162
limit: limit,
161163
},
162164
}),

src/components/Autocomplete/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export type GenomeSearchProps = Partial<AutocompleteProps<Result, false, true, f
66
onSearchSubmit: (result: Result) => void;
77
defaultResults?: Result[];
88
showiCREFlag?: boolean;
9+
geneVersion?: number;
910
// queries
1011
queries: ResultType[];
1112
geneLimit?: number;

src/components/Autocomplete/utils.ts

-4
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,6 @@ export function isDomain(input: string) {
197197
const hasTabs = input.includes("\t");
198198
const hasHyphens = input.includes("-");
199199
const hasChromosomeNumber = input.length >= 4 && /^\d$/.test(input[3]);
200-
console.log(
201-
input,
202-
hasTabs || hasHyphens || (input.startsWith("chr") && hasChromosomeNumber)
203-
);
204200
return (
205201
(hasTabs || hasHyphens) && input.startsWith("chr") && hasChromosomeNumber
206202
);

src/components/Graph/Legend.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const Legend: React.FC<LegendProps> = ({
4848
const uniqueCategories = order
4949
? order
5050
: Array.from(new Set(simpleCategories)); // simple names
51-
console.log(toggles);
5251

5352
// loop on uniqueCat if there is order, else loop on uniqueCategories
5453
return (

src/components/Table/Table.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ const CustomizedTable: React.FC<CustomizedTableProps> = (props) => {
4545
};
4646

4747
let rows = props.tabledata;
48-
console.log(rows)
49-
console.log(rows
50-
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage))
48+
5149
return (
5250
<>
5351
<TableContainer>

src/test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { GenomeSearch, Result, ResultType } from "./components/Autocomplete";
44
import { useState } from "react";
55

66
function App() {
7-
const query: ResultType[] = ["cCRE"]
7+
const query: ResultType[] = ["Gene"]
88
const [result, setResult] = useState<Result>()
99
return (
1010
<Box display="flex" flexDirection="column" justifyContent="start" alignItems="center" height="100vh" width="100%">
@@ -13,6 +13,7 @@ function App() {
1313
assembly="GRCh38"
1414
queries={query}
1515
showiCREFlag
16+
geneVersion={29}
1617
onSearchSubmit={(result) => {
1718
setResult(result)
1819
}}

0 commit comments

Comments
 (0)