File size: 5,294 Bytes
578fbf9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>RNA Sequence Analysis</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
    <script src="https://unpkg.com/htmx.org@1.9.6"></script>
</head>
<body class="bg-gray-100 min-h-screen">
    <div class="container mx-auto px-4 py-8">
        <header class="mb-8">
            <h1 class="text-3xl font-bold text-gray-800">RNA Sequence Analysis Tool</h1>
            <p class="text-gray-600">Analyze RNA sequences with dimensional reduction techniques</p>
        </header>

        <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
            <!-- Configuration Panel -->
            <div class="bg-white rounded-lg shadow p-6 lg:col-span-1">
                <h2 class="text-xl font-semibold mb-4">Configuration</h2>
                
                <form id="analysisForm" hx-post="/analyze" hx-target="#results" hx-indicator="#loading">
                    <!-- File Input -->
                    <div class="mb-4">
                        <label class="block text-gray-700 mb-2" for="dataFile">Data File (HDF5)</label>
                        <input type="file" id="dataFile" name="dataFile" accept=".h5,.hdf5" 
                            class="w-full px-3 py-2 border border-gray-300 rounded-md">
                    </div>

                    <!-- Model Selection -->
                    <div class="mb-4">
                        <label class="block text-gray-700 mb-2" for="modelName">RNA Model</label>
                        <select id="modelName" name="modelName" class="w-full px-3 py-2 border border-gray-300 rounded-md">
                            <option value="multimolecule/rnaernie">RNAErnie (default)</option>
                            <option value="multimolecule/rnabert">RNABERT</option>
                            <option value="multimolecule/rnadistill">RNADistill</option>
                        </select>
                    </div>

                    <!-- Sequence Column -->
                    <div class="mb-4">
                        <label class="block text-gray-700 mb-2" for="seqCol">Sequence Column</label>
                        <input type="text" id="seqCol" name="seqCol" value="full_sequence" 
                            class="w-full px-3 py-2 border border-gray-300 rounded-md">
                    </div>

                    <!-- Reduction Method -->
                    <div class="mb-4">
                        <label class="block text-gray-700 mb-2">Dimensionality Reduction</label>
                        <div class="flex items-center mb-2">
                            <input type="radio" id="umap" name="reductionMethod" value="umap" checked class="mr-2">
                            <label for="umap">UMAP</label>
                        </div>
                        <div class="flex items-center">
                            <input type="radio" id="pacmap" name="reductionMethod" value="pacmap" class="mr-2">
                            <label for="pacmap">PaCMAP</label>
                        </div>
                    </div>

                    <!-- Dimensions -->
                    <div class="mb-4">
                        <label class="block text-gray-700 mb-2">Dimensions</label>
                        <div class="flex items-center mb-2">
                            <input type="radio" id="2d" name="dimensions" value="2" checked class="mr-2">
                            <label for="2d">2D</label>
                        </div>
                        <div class="flex items-center">
                            <input type="radio" id="3d" name="dimensions" value="3" class="mr-2">
                            <label for="3d">3D</label>
                        </div>
                    </div>

                    <!-- Color By -->
                    <div class="mb-6">
                        <label class="block text-gray-700 mb-2" for="colorBy">Color By Column (optional)</label>
                        <input type="text" id="colorBy" name="colorBy" 
                            class="w-full px-3 py-2 border border-gray-300 rounded-md">
                    </div>

                    <button type="submit" class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 transition">
                        Analyze Sequences
                    </button>
                </form>
            </div>

            <!-- Results Panel -->
            <div class="bg-white rounded-lg shadow p-6 lg:col-span-2">
                <h2 class="text-xl font-semibold mb-4">Results</h2>
                <div id="loading" class="htmx-indicator text-center py-8">
                    <div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div>
                    <p class="text-gray-600">Processing data...</p>
                </div>
                <div id="results" class="min-h-64">
                    <div class="text-center text-gray-500 py-12">
                        <p>Configure and run analysis to see results</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>