-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,415 additions
and
701 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...ns/comparative-adapters/src/ComparativeAddTrackComponent/ComparativeAddTrackComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { useEffect, useState } from 'react' | ||
|
||
import { AssemblySelector } from '@jbrowse/core/ui' | ||
import { getSession } from '@jbrowse/core/util' | ||
import { observer } from 'mobx-react' | ||
|
||
const ComparativeAddTrackComponent = observer(function ({ model }: any) { | ||
const session = getSession(model) | ||
const [r0, setR0] = useState(session.assemblies[0]?.name) | ||
const [r1, setR1] = useState(session.assemblies[0]?.name) | ||
useEffect(() => { | ||
model.setMixinData({ | ||
adapter: { | ||
queryAssembly: r0, | ||
targetAssembly: r1, | ||
}, | ||
}) | ||
}, [model, r0, r1]) | ||
return ( | ||
<> | ||
<AssemblySelector | ||
session={session} | ||
label="Query assembly" | ||
helperText="" | ||
selected={r0} | ||
onChange={asm => { | ||
setR0(asm) | ||
}} | ||
TextFieldProps={{ | ||
fullWidth: true, | ||
}} | ||
/> | ||
<AssemblySelector | ||
session={session} | ||
label="Target assembly" | ||
helperText="" | ||
selected={r1} | ||
onChange={asm => { | ||
setR1(asm) | ||
}} | ||
TextFieldProps={{ | ||
fullWidth: true, | ||
}} | ||
/> | ||
</> | ||
) | ||
}) | ||
|
||
export default ComparativeAddTrackComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
plugins/comparative-adapters/src/MCScanAddTrackComponent/MCScanAddTrackComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { useEffect, useState } from 'react' | ||
|
||
import { AssemblySelector, FileSelector } from '@jbrowse/core/ui' | ||
import { getSession } from '@jbrowse/core/util' | ||
import { Typography } from '@mui/material' | ||
import { observer } from 'mobx-react' | ||
|
||
import type { FileLocation } from '@jbrowse/core/util' | ||
|
||
const MCScanAddTrackComponent = observer(function ({ model }: any) { | ||
const session = getSession(model) | ||
const [r0, setR0] = useState(session.assemblies[0]?.name) | ||
const [r1, setR1] = useState(session.assemblies[0]?.name) | ||
const [bed1Location, setBed1Location] = useState<FileLocation>() | ||
const [bed2Location, setBed2Location] = useState<FileLocation>() | ||
useEffect(() => { | ||
model.setMixinData({ | ||
adapter: { | ||
assemblyNamees: [r0, r1], | ||
bed1Location, | ||
bed2Location, | ||
}, | ||
}) | ||
}, [model, bed1Location, bed2Location, r0, r1]) | ||
return ( | ||
<div style={{ marginTop: 20 }}> | ||
<Typography> | ||
JBrowse requires the two BED files that specify the genomic locations of | ||
the genes in the .anchors files | ||
</Typography> | ||
<AssemblySelector | ||
session={session} | ||
label="BED1 assembly" | ||
helperText="" | ||
selected={r0} | ||
onChange={asm => { | ||
setR0(asm) | ||
}} | ||
TextFieldProps={{ | ||
fullWidth: true, | ||
}} | ||
/> | ||
<AssemblySelector | ||
session={session} | ||
label="BED2 assembly" | ||
helperText="" | ||
selected={r1} | ||
onChange={asm => { | ||
setR1(asm) | ||
}} | ||
TextFieldProps={{ | ||
fullWidth: true, | ||
}} | ||
/> | ||
<FileSelector | ||
name="BED1" | ||
inline | ||
description="" | ||
location={bed1Location} | ||
setLocation={loc => { | ||
setBed1Location(loc) | ||
}} | ||
/> | ||
<FileSelector | ||
name="BED2" | ||
inline | ||
description="" | ||
location={bed2Location} | ||
setLocation={loc => { | ||
setBed2Location(loc) | ||
}} | ||
/> | ||
</div> | ||
) | ||
}) | ||
|
||
export default MCScanAddTrackComponent |
20 changes: 20 additions & 0 deletions
20
plugins/comparative-adapters/src/MCScanAddTrackComponent/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { lazy } from 'react' | ||
|
||
import { mcscanTypes } from '../syntenyTypes' | ||
|
||
import type PluginManager from '@jbrowse/core/PluginManager' | ||
|
||
// lazies | ||
const MCScanAddTrackComponent = lazy(() => import('./MCScanAddTrackComponent')) | ||
|
||
export default function MCScanAddTrackComponentF(pluginManager: PluginManager) { | ||
pluginManager.addToExtensionPoint( | ||
'Core-addTrackComponent', | ||
// @ts-expect-error | ||
(comp, { model }: { trackAdapterType: string }) => { | ||
return mcscanTypes.includes(model.trackAdapterType) | ||
? MCScanAddTrackComponent | ||
: comp | ||
}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.